AutoLogin script

Post Reply
OldGuy
Posts: 134
Joined: Fri Jul 07, 2017 11:13 am

AutoLogin script

Post 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
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: AutoLogin script

Post 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.
Image
OldGuy
Posts: 134
Joined: Fri Jul 07, 2017 11:13 am

Re: AutoLogin script

Post 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.
User avatar
KILROY
Posts: 1315
Joined: Sat Apr 05, 2014 8:59 pm
Location: Texas

Re: AutoLogin script

Post 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 ;)
OldGuy
Posts: 134
Joined: Fri Jul 07, 2017 11:13 am

Re: AutoLogin script

Post 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 132 times
User avatar
DaRk
Posts: 1001
Joined: Sat Jul 27, 2013 4:22 pm
Location: ID, USA

Re: AutoLogin script

Post by DaRk »

No problem. If you need me to archive anything else I may not have, let me know. I have unlimited space.
User avatar
BeCool
Posts: 55
Joined: Sat Aug 02, 2014 5:36 pm
Location: Germany

Re: AutoLogin script

Post by BeCool »

Also try in chat #help and see all options ^_^
PS: #validatebyinfo in Chat is also autologin :)
Image
Post Reply