Currently, the game's code runs as it always has. Our script's code runs on top and only moves the mouse to direct the snake.
Some enhancements, such as changing the way the game is rendered, can only be done by actually changing the game's underlying code.
We should have an approach for modifying the underlying game.
Ooooooohhhh.....
Hard thing to implement IMO at this moment in time...
Yes indeed, like the zooming error #97
The issue we had is that we can't unload the game's script. And when we tried to modify the game's code, it was already loaded, so our version didn't work. (That was in the early days of the project :+1: ). That's why we have things like oldOef etc. We cannot modify their code, but we can add to their code and to their functions.
@FliiFe What about this? It just updates the existing code without including all in our bot (so if the original changes, the fix would still apply unless the zooming itself has been altered by the game developer).
https://github.com/tjorim/Slither.io-bot/tree/zoomfix -> https://github.com/tjorim/Slither.io-bot/raw/zoomfix/bot.user.js
I like the string replace approach. If it can't find the string, the replace simply fails and the game does not break.
Yes indeed, so it shouldn't affect the main game functions :D
On May 16, 2016 1:25 AM, "Chad Z" [email protected] wrote:
I like the string replace approach. If it can't find the string, the
replace simply fails and the game does not break.—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/ErmiyaEskandary/Slither.io-bot/issues/153#issuecomment-219319723
Closing this issue because we know how to monkeypatch thanks to @tjorim :)
Most helpful comment
The issue we had is that we can't unload the game's script. And when we tried to modify the game's code, it was already loaded, so our version didn't work. (That was in the early days of the project :+1: ). That's why we have things like
oldOefetc. We cannot modify their code, but we can add to their code and to their functions.