snollygolly / sourceio-automation

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

Added word frequency input to GUI #6

Closed LeeConnelly12 closed 7 years ago

LeeConnelly12 commented 7 years ago

Added an input to change the hack speed. Cleaned up gui function - instead of having seperate variables for each element all of the gui's html is now stored into one variable.

Note: Hack value will only take come into effect when app.automate() is called (when hacking finishes). This is because the wordLoop variable is assigned the value of wordFreq in the automate function once. Can't seem to figure out how to go about updating it dynamically elsewhere in the script.

snollygolly commented 7 years ago

Looks good to me :shipit: Thanks!

snollygolly commented 7 years ago

@LeeConnelly12

I just refactored all of the bot, and I wanted to show you how to you can include HTML with template strings instead of concatenation:

https://github.com/snollygolly/sourceio-automation/blob/master/main.js#L330-L354

LeeConnelly12 commented 7 years ago

@snollygolly

I never realised that was a thing, would of saved me quite a lot of time. I'll be sure to use template strings from now on, thanks!