SRL Archive - First Scripts

Nu2Scar's First Script :Auto 'Logger-iner'


Nu2Scar

2007-04-15 23:37:03

It knows what login screen you are on an acts accordingly. Also has a timeout feature case summut goes wrong. Nuttin special, but it took me hours to iron the damn bugs out. Almost smashed up the computer as a result. Check it out and tell me what you think. :sasmokin:

 program AutoLogin;

{.include SRL/SRL.scar}

var
TimeOut, ScreenCheck : Integer;


const
Username= ('Username'); //Enter username & pass here blah blah obvious
Pass= ('Password');

procedure Login1;
Begin
ScreenCheck:=0;
TimeOut:=0;

Repeat
if (findcolor(x,y,16777215,417,284,503,297)) then
begin
writeln('First login screen found');
ScreenCheck:=1;
end else
TimeOut:=(timeout+1);
wait (1000);
until (ScreenCheck = 1) OR (TimeOut = 2)
if (ScreenCheck = 1) then
Begin
wait (500+random(1000))
mouse(460,292,40,10,true);
end;
end;

Procedure Login2;
Begin
ScreenCheck:=0;
TimeOut:=0;

Repeat
if (findcolor(x,y,65535,434,212,498,231)) then
begin
writeln('Second login screen found');
ScreenCheck:=1;
end else
TimeOut:=(TimeOut+1);
wait (1000);
Until (ScreenCheck = 1) OR (TimeOut = 5)

if (ScreenCheck=1) then
Begin
wait (500+random(1000));
Typesend(username);
wait (500+random(1000));
Typesend(pass);
wait (500+random(1000));
mouse(303,322,40,10,true);
wait (500+random(1000));
end else
Writeln ('Operation Timed Out');
TerminateScript;
End;

Procedure Login3;
Begin
ScreenCheck:=0;
TimeOut:=0;
Repeat
if (findcolor(x,y,0,610,316,650,356)) then
Begin
writeln('Final login screen found');
ScreenCheck:=1
end else
TimeOut:=(TimeOut+1);
Wait (1000);
Until (ScreenCheck=1) OR (TimeOut = 5)

if (ScreenCheck=1) then
Begin
wait (500+random(500))
mouse (400,340,50,30,true)
Writeln ('Grats '+ (username)+ ' you logged in successfully thanks to Nu2Scar!')
end else
Writeln ('Operation Timed Out');
TerminateScript;
end;

//[-----MAIN LOOP------]
begin
SetupSRL;
ActivateClient;
Login1;
Login2;
Login3;
end.

3Garrett3

2007-04-16 17:20:38

Use FindColorTolerance, Im not sure if the login screen is the same as in, it changes colors alot, but use findcolortolerance instead of findcolor.. with a tol of 2 or 3.. I like the way you organised things into procs

Nu2Scar

2007-04-18 08:04:58

Hey cheers for the advice and the feedback. The colour tolerance thing sounds good.. need to explore all these lil commands a bit more.. cheers again. Rep+

me_ntal

2007-04-18 08:13:22

Should make it on work on f6 log in, F7 go to next player and so on or something. else i could simply use the one below and get the same effect and simply push f3 and log in simply.


{.Include SRL\SRL.SCAR}
Procedure DeclarePlayers;
begin
Status('Loading Players')

HowManyPlayers := 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; // 2-4 letters of username
Players[0].Active := True;

end;
begin
SetupSRL;
DeclarePlayers;
ActivateClient;
Loginplayer;
end.


SuperScripter

2007-10-06 11:17:14

Good Script. Amazing for a first script.

#SS

Belt

2007-10-07 20:48:45

I just had to add "x,y : integer" to the var, then it worked like a charm

Lord michie

2007-10-11 14:00:02

well done for your first script lol i wish my first one was as good lol

tidely bit bugy when it gets to the bit after loging pushing the botten part lol you know what i mean other wis well done

MineOrChop

2007-10-11 14:31:41

Very nice for a first script. I have added a few bits and bobs on it, for personal use…I hope you don't mine.

Very nice! :)

Mariuswbz

2007-10-11 17:08:01

Nice.
Keep up good work.