TORIBASH 30
INFO 10; 10 0 0 49 0 100 0 0 1
SERVER 0; 176.9.64.22:20180 judo1
CLIENTS 2; RichardPT Kuraimaru Sid6Point7 Sean39mo TapWatr Grodark NotThatGuy Silvantor ginopchoka frizbe
NEWGAME 1; 1000 70 20 0 0 3 80 0 1 judo.tbm 0 0 100 0 0 0 1 0 2 0 0 0 0 0 0 0.000000 0.000000 -9.820000 0 0 0
DESC 0; ^16Beginner^07:: Judo 1
Lets break down the response from the lobby server (game.toribash.com:22000).
TORIBASH 30 // Not sure here, but it's included every server.
INFO 10; 10 0 0 49 0 100 0 0 1 // Some information about the server, iirc this is stuff like minbet, among other things.
SERVER 0; <ip>:<port> <servername> // This is the meat of what we want from this connection.
CLIENTS 2; <space delimited list of usernames in the server> // Pretty simple.
NEWGAME 1; 1000 70 20 0 0 3 80 0 1 judo.tbm 0 0 100 0 0 0 1 0 2 0 0 0 0 0 0 0.000000 0.000000 -9.820000 0 0 0 // I'll go back through this later and define each one, but it's obvious that it's the game settings.
DESC 0; <server /desc> // Simple enough.
99% of the time with a bot, we'll be joining a predetermined room, so we connect to the lobby and use it as a DNS, resolving the name to the actual port we want to connect to.
Here's a small ruby script to resolve a server to it's destination. It's a quickie, and is free to use and improve.
https://gist.github.com/Eleeleth/5793630
e: and a version that will give you an IP if the room doesn't already exist:
https://gist.github.com/Eleeleth/5793836
e: and a basic idlebot, because I can.
https://gist.github.com/Eleeleth/5794591
Last edited by Eleeleth; Jun 17, 2013 at 02:24 PM.