ermiyaeskandary / Slither.io-bot

Just for fun and AI. Written in Javascript, this is a project which the aim is to make a computer play against humans inside a human-driven game, which is in this case Slither.io. The goal is simple - try and make the snake live and get as long as possible.
Mozilla Public License 2.0
193 stars 124 forks source link

Connect to specific servers by IP address (slither-nest functionality) #283

Open clemens-tolboom opened 8 years ago

clemens-tolboom commented 8 years ago

Asked in https://github.com/ErmiyaEskandary/Slither.io-bot/issues/275#issuecomment-223628208 to 'port' https://github.com/LukeeeeBennett/slither-nest

ermiyaeskandary commented 8 years ago

I'm doing the custom server connect functionality - :+1: Much easier way

clemens-tolboom commented 8 years ago

I had this in mind. No fuss

slither_io

            oContent.push('<input type="checkbox" title="Connect to same server"/><input type="text" title="Game server" size="20" placeholder="111.222.333.444:555" pattern="((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$"/>' );

When playing we can set the textbox and when check it keeps connecting to same arena. When not playing one can edit the textbox / checkbox

Please make the IP/port a bot variable so others can reach it/set it too. Like my C&C

Pattern is incomplete and was found on http://html5pattern.com/Miscs Somehow the z-index (or something else) is not good as I cannot edit it.

ermiyaeskandary commented 8 years ago

Somehow the z-index (or something else) is not good as I cannot edit it.

You know why ? Because of where you put it - // Set static display options here.

clemens-tolboom commented 8 years ago

// Set static display options here.

lol ... that's not quite true. 'onPrefChange' is zapped on mouse clicks.

I added some code to branch feature/283-fixed-server-option (quite bad code)

Questions

clemens-tolboom commented 8 years ago

Updated the summary and made my https://github.com/ErmiyaEskandary/Slither.io-bot/issues/283#issuecomment-224625333 more stand out.

ermiyaeskandary commented 8 years ago

@clemens-tolboom We should do it without jQuery... An extra dependency just makes it slower and it's possible. We should do it on the screen with the play button not within the overlays... like slither-nest.

ermiyaeskandary commented 8 years ago

@clemens-tolboom We have to set the values after we die force-server is a built in slither.io function which forces a server after death. I'll double check and report back.

ermiyaeskandary commented 8 years ago

@clemens-tolboom We can integrate with default settings by saving it after it is set and loading it before we play the game - but then run it after each death. I need to double check force-server but you should only need to set it once with that function and it would stay there until page refresh. I disagree with saving it as a setting anyway. We would want to switch servers regularly and we can always set it to something else manually after refresh - we just want the bots to be on the same server when testing. Which server it is doesn't matter TBH.

clemens-tolboom commented 8 years ago

@ErmiyaEskandary I'm still learning. I did some coding to get this issue started. Please take over :p (I know it is assigned to you but was struggling today with my C&C so needed a break).

clemens-tolboom commented 8 years ago

Is your solution scriptable? And without the extra button? slither_io

ermiyaeskandary commented 8 years ago

@clemens-tolboom Yeah - we can just put an input box. I can start working on this soon but really busy currently :( Thanks for having a go by the way!