snollygolly / sourceio-automation

:video_game: A bot to automatically play s0urce.io for you
MIT License
28 stars 27 forks source link

Fix bot being stuck & add delay between hacks #22

Closed metal0 closed 7 years ago

metal0 commented 7 years ago

Fixes bot being stuck by adding a check to the loop, and adds a delay between bot restarts.


Also, this is unrelated, but if you find OCR unreliable, you could use my php API instead, although you do need a chrome extension to bypass Access-Control-Allow-Origin on s0urce.io

Example of a call to my Php API (Currently returning "ping")

metal0 commented 7 years ago

From playing with this for quite a bit, the hackDelay var can probably be reduced to about 5seconds safely, 15 seconds is way too much.

snollygolly commented 7 years ago

This looks good to me, but can you extract out the maximum hack fails to it's own variable? Maybe maxHackFails? Just to keep with the theme of being configurable.

In regards to the hack delay, 15 is fine with me, and I'd even been fine with 10. I'd just rather err on the side of caution and leave it to the player to go crazy if they want.

metal0 commented 7 years ago

Sure. I kinda ctrl+c'ed that from my code so I forgot that other people would use it

Edit: Not sure what happened there with github...

snollygolly commented 7 years ago

LGTM! Thanks! :shipit: