Help making a auto-login script

Kaylie

she/her
So, I have admin on a SRB2 server. What I want it to do is this:

1. Check name of server, checks it against preset string in the script
2. If it matches, then run a login command

so I don't have to type in my login every time.
 
You cannot have conditionals in console scripts, unfortunately, as there is no console command that will act as a conditional.
 
you can technically type this as txt file, then you can use that txt file to "login" in srb2
i used this to auto set bind on buttons, such as -bind + "skin tails; color orange; say hello"

i don't know if that is a console command, but if it is then this is an easy way to do it, so you dont have to type it everytime.

like the command in question (that might not be the same one) require this:
logincommand username password;
the txt file (let's call it login.txt) contain that same command, but with "quotation marks", because it thinks that every word is a command on it's own if there are none;
in game you type exec login.txt;
the game checks (in the srb2 folder, or srb2Kart since it works there too) if there is a file called "login.txt", and if it finds it, it automatically try to use everything inside as a command to do in srb2, BUT careful if you use this way, because if the txt in question is really really big, it can crash the game.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top