SRL Archive - Research & Development Lounge

login function for new rs


Waddo

2008-07-01 12:01:21

if you can improve repost an improved version post any problems or improvements

ive just put this together in bout 30 mins it will have bugs and faults
if any admins wanna make it better and shove it into srl quickly for an emergency release

im gunna make some more stuff now to patch up damage

ek left my user and pass in for my main thank god i noticed that quick




function loginplayer2:boolean;
var
PX, PY,trys,clickheretoplay,time:integer;
click:boolean;
begin
activateclient;
if loggedin then exit;
if getcolor(402, 204)=0 then
begin
mousebox(336, 400,421, 409,1);
wait(100+random(100));
end;
click:=false;
clickheretoplay := BitmapFromString(3, 41, 'beNq7UX13ETME/X' +
'40G4L+PFkCRc9WoSO4IEwNXBdC+4OpEPT7bjcU3W6GIG1VyaGCfhy' +
'1gqCfJ5wh6NdpHwj6eTYEgn5fiIGgX5ezEehaMQq6UY2CAOcHroc=' +
'');
mousebox(358,165,403,177,1);
repeat
wait(500+random(100));
click:=getcolor(402, 204)=0;
inc(trys);
until (trys>=15) or click=true;
if click=false then
begin
writeln('failed to login');
exit;
end;
click:=false
mousebox(310, 250, 452, 267,1);
wait(100+random(100));
TypeSend(Players[CurrentPlayer].Name);
Wait(100 + Random(100));
TypeSend(Players[CurrentPlayer].Pass);
Wait(100 + Random(100));
mousebox(336, 400,403, 371,1);
marktime(time);
repeat
wait(10+random(100));
if findbitmap(clickheretoplay,PX,PY) then
begin
mouse(PX, PY, 2,2,true);
click:=true;
exit;
end;
until click=true or (timefrommark(time)>=180000);
if click<>true then
begin
writeln('failed to login');
exit;
end;
FreeBitmap(ClickHereToPlay);
end;

PvH

2008-07-01 12:18:21


if click=false and (trys>=15) then
begin
writeln('failed to login');
exit;
end;
Could be shortened to:

if click=false then exit;
Because there is only a need tto check if click is false, because it will only check when the repeat is done;)


mouse(380, 366,5,10,true);
Maybe a mousebox there?


if click<>true then
begin
writeln('failed to login');
exit;
end;
There is no need to debug there, so, just do this:

if click<>true then exit;

Other than that, it looks good;)
I didn't test it btw, just looked at the code:rolleyes:
Good job;)

PvH

Waddo

2008-07-01 12:19:43

pvh the writelns anrnt for debug its so that the user can see what is going on

Naum

2008-07-01 12:41:18

Use a GetTextAtEx to find out what happens when you log in badly.

Waddo

2008-07-01 12:42:19

erm will that work do we have that font

PvH

2008-07-01 15:19:59

Look in the login.scar as it is now for information like that:rolleyes:

jakeyboy29

2008-07-01 15:25:39

were does it go? :/