Page 1 of 1

AutoLogin script

Posted: Wed Dec 19, 2018 5:25 pm
by OldGuy
After a few horrible days of someone smurfing everyone, voting to kick, and all that other nonsense, I registered my username. Of course, that meant I had to login every time I joined the server. So I reached out to Perrinoia for some help. He sent me some ideas and I set out to create a script to log me in when I joined the OZ server.

Here's the result:

Code: Select all

$password["208_100_45_12"] = "yourPassword";

function remoteSetMusic(%player, %track, %mode)
{
   if($password[var($Server::Address)] != "") {
      say(0, "#login "@ $password[var($Server::Address)]);
   }
}

function String::Replace(%string, %search, %replace){
    %len = String::Len(%search);
    for (%i = 0; (%char = String::getSubStr(%string, %i, %len)) != ""; %i++) {
        if (%char @ "s" == %search @ "s")
            %string = String::getSubStr(%string, 0, %i) @ %replace @ String::getSubStr(%string, %i + %len, 255);
    }
    return %string;
}

function var(%this)
{
	%v = String::Replace(%this, ":", " ");
	%v = String::Replace(%v, ".", "_");
	return getWord(%v, 1);
}

The script works great and now I don't have to worry about getting kicked before my old slow fingers get the password typed. That is, of course, if I actually remember to log in. I don't know if the backup server has the login code but if it does, just copy the $password line to a new line below that one and replace the IP address (replacing periods with underscores).

Most of you have been around long enough to understand how to add a script so I won't go into details. Just use a plain text editor to create a file in your config folder named something like autologin.cs. Add the above code replacing yourPassword with your registered password and save the file. Then at the bottom of autoexec.cs, add a new line with the following command: exec("autologin.cs");

P.S. Thanks for the jump start Perrinoia!

Enjoy

Re: AutoLogin script

Posted: Wed Dec 19, 2018 6:57 pm
by perrinoia
No problem. I'm pretty sure the backup server does have the login script, but the two servers don't share data, thus you'll have to register on both.

Since they are hosted by different people, and the passwords are stored as plain text, i recommend using different passwords on each, ands definitely different from your banking or email logins.

Re: AutoLogin script

Posted: Mon Apr 15, 2019 11:42 pm
by OldGuy
To whomever roasted me thoroughly in-game about the crappy script I "stole" - Thank You. It motivated me to find Crow's AutoLogin.cs script which I am now running. It works perfectly.

Thanks perin for motivating me.

Re: AutoLogin script

Posted: Tue Apr 16, 2019 1:20 am
by KILROY
Hey, TXS OldGuy for finding this and bumping it again for those of us who don't know how to register!

And of course, TXS Perr, as always bro ;)

Re: AutoLogin script

Posted: Wed Apr 17, 2019 2:59 pm
by OldGuy
Yea well, the code I posted is the crappy version. This is the one Crow wrote. I changed it a bit since some server IPs have changed or gone away. Just modify the names and passwords you want to use and leave the rest.

[Edit] Forgot to add the register comment in the code. To register, at the global chat (T), type #register <email> <password> without the angle brackets.

Thanks to Dark for archiving it.
AutoLogin.rar
(790 Bytes) Downloaded 139 times

Re: AutoLogin script

Posted: Wed Apr 17, 2019 9:32 pm
by DaRk
No problem. If you need me to archive anything else I may not have, let me know. I have unlimited space.

Re: AutoLogin script

Posted: Sat Feb 27, 2021 12:10 am
by BeCool
Also try in chat #help and see all options ^_^
PS: #validatebyinfo in Chat is also autologin :)