SRL Archive - SRL Bugs

Updated Login Procedure


traveler

2010-11-29 11:33:51

I updated the current LoginPlayerToLob to work with the new usernames as emails. I have tested it and it works.

function LoginPlayerToLob: Boolean;
var
Members, RetryLogin: Boolean;
Actions: TVariantArray;
T, Attempts{, I}: LongInt;
//ATPA: T2dPointArray;
TPA: TPointArray;
//B: TBox;
label
ProcStart;
begin
ActivateClient;
Wait(100);
TypeByte(vk_Escape);
Wait(500);

{Check for lobby screen already open/ already logged in}

Result := ((LobbyScreen) or (LoggedIn));
if (Result) then
Exit;

{Check for active player.}

if (not (Players[CurrentPlayer].Active)) then
begin
WriteLn('Player is not Active...');
if (AllPlayersInActive) then
begin
WriteLn('All players not active!');
Exit;
end;
NextPlayer(False);
Exit;
end;

{Wait for the client to finish loading.}

T := GetSystemTime;
repeat
if (RSReady) then
Break;
if ((GetSystemTime - T) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
Wait(RandomRange(1000, 2000));
until (False);
WriteLn('Welcome to Runescape.');


{New graphics have changed box}
Case CountColor(LOGIN_TEXTCOLOUR, 198, 192, 567, 259) of
1079: MouseBox(347, 295, 414, 303, 1);
1745: MouseBox(347, 305, 414, 312, 1);
end;

{Click less info if needed.}
{
if (not (SimilarColors(GetColor(382, 11), 14285562, 20))) then //Runescae sword green bead
begin
MouseBox(212, 479, 550, 495, 1); //Less info button
Wait(RandomRange(1000, 2000));
end;
}
{Click Members/free.}

Members := Players[CurrentPlayer].Member;
if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
Members := Players[CurrentPlayer].WorldInfo[0];

ProcStart:

{if (Members) then
I := 1;

if (GetColor(248, 359) <> 1381653) then //Black outline on forgotten pwd button.
begin
FindColors(TPA, 9291999, 10, 370, 675, 475);
ATPA := SplitTPA(TPA, 4);
if (Length(ATPA) > 2) then
begin
if (I = 1) then
I := 0
else
I := 1;
B := GetTPABounds(ATPA[1 + I]); //If demo mode is still up
end
else
if (Length(ATPA) = 2) then
B := GetTPABounds(ATPA[0 + I]) //When there's no demo mode
else
B := IntToBox(210, 424, 367, 446);

with B do
MouseBox(X1 + 20, Y1 + 10, X2 - 20, Y2 + 8, 1);

T := GetSystemTime; //Black outline on forgotten pwd button.
while ((GetSystemTime - T < 3000) and (GetColor(248, 359) <> 1381653)) do
Wait(RandomRange(100, 200));

end; }

{Type in username}

FindColors(TPA, LOGIN_TEXTCOLOUR, UBx1, UBy1, UBx2, UBy2);
if (Length(TPA) > 0) then
begin
SortTPAFrom(TPA, Point(UBx2, UBy1+(UBy2-UBy1) div 2));
Mouse(TPA[0].X + 20, TPA[0].Y, 5, 5, True);
end
else
MouseBox(UBx1, UBy1, UBx2, UBy2, 1); //Username box
while (CountColor(LOGIN_TEXTCOLOUR, UBx1, UBy1, UBx2, UBy2) > 0) do
begin
TypeByte(VK_BACK);
Wait(50+Random(50));
end;
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
{$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Name);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Name);
{$endif}
Wait(100 + Random(50));

{Type in password}

while (CountColor(LOGIN_TEXTCOLOUR, PBx1, PBy1, PBx2, PBy2) > 0) do
begin
TypeByte(VK_BACK);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
{$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Pass);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Pass);
{$endif}
Wait(500 + Random(300));

{Check responses}

T := GetSystemTime;
repeat

SetLength(Actions, 0);

if ((GetSystemTime - T) > 60000) then
Actions := ['One minute has passed...', 0, 0, 'PlayerFalse', 'Login Failed']
else
case (CountColor(LOGIN_TEXTCOLOUR, 260, 140, 510, 400)) of //text colour points
// WriteLn Error Wait for Retrys Action Player[CurrentPlayer].Loc
763, 2348: Actions := ['Invalid Username / Password', 0, 2, 'PlayerFalse', 'Wrong User/Pass'];
1088: Actions := ['Your account has been disabled', 0, 0, 'PlayerFalse', 'Acc Disabled'];
951: Actions := ['Your account is already logged in', 5000, 0, 'PlayerTrue', 'Already logged in'];
1239: Actions := ['Not a Members Account', 0, 1, 'PlayerTrue', ''];
364: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
1057: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'PlayerFalse', 'Too many logins'];
-1: Actions := ['Runescape has been updated.', 0, 0, 'Terminate', 'RS updated'];
end;
{Respond}

if (Length(Actions) > 0) then
begin
WriteLn(Actions[0]);
if (Actions[0] <> 'Not a Members Account') then
begin
Wait(1000 + Random(500));
TypeByte(vk_Escape);
end;
Wait(Actions[1] + Random(100));
if (Actions[2] <> 0) then
if (Attempts < Actions[2]) or (Actions[2] = -1) then
begin
if (Actions[0] = 'Not a Members Account') then
begin
Players[CurrentPlayer].Member := False;
if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
Players[CurrentPlayer].WorldInfo[0] := False;
MouseBox(267, 321, 496, 350, 1); //Play free game instead button
Wait(3000 + Random(2000));
Result := True;
Exit;
end;
RetryLogin := True;
Wait(2000 + Random(1000));
Break;
end;
if (Actions[4] <> '') then
Players[CurrentPlayer].Loc := Actions[4];
case Actions[3] of
'PlayerFalse': NextPlayer(False);
'PlayerTrue': NextPlayer(True);
'Terminate': TerminateScript;
end;
Exit;
end;
Wait(100);
Result := (LobbyScreen) or (LoggedIn);
until (Result);

{Back to main screen if needed}

if (RetryLogin) then
begin
RetryLogin := False;
Inc(Attempts);
goto ProcStart;
end;

end;

pyroryan

2010-11-29 11:35:49

Didn't you say you were going to post this yesterday? Then again, I probably remembered wrong.

Good job! :P

traveler

2010-11-29 11:40:13

From: pyroryan
Didn't you say you were going to post this yesterday? Then again, I probably remembered wrong.

Good job! :P


your wrong. I did not think about how to fix the login for srl until i was falling asleep last night. Turns out it was very simple.

Shuttleu

2010-11-29 11:40:38

what did you change?

~shut

traveler

2010-11-29 11:43:40

i changed the typesend for the username to this:

  {$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Name);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Name);
{$endif}

and the password typesend to this:

  {$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Pass);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Pass);
{$endif}

Harry

2010-11-29 12:05:22

I think SmartSendKeys is detectable (correct me if I am wrong)… but then again "it shouldn't matter as you're not logged in yet anyways".

traveler

2010-11-29 12:08:36

well if its detectable, then its only a temporary fix. Then again, like u said, we aren't even logged in yet, and a lot of other things are detectable too that they don't look for.

Cstrike

2010-12-03 15:30:51

I only added a wait before it enters the password since there is lag
function LoginPlayerToLob2: Boolean;
var
Members, RetryLogin: Boolean;
Actions: TVariantArray;
T, Attempts{, I}: LongInt;
//ATPA: T2dPointArray;
TPA: TPointArray;
//B: TBox;
label
ProcStart;
begin
ActivateClient;
Wait(100);
TypeByte(vk_Escape);
Wait(500);

{Check for lobby screen already open/ already logged in}

Result := ((LobbyScreen) or (LoggedIn));
if (Result) then
Exit;

{Check for active player.}

if (not (Players[CurrentPlayer].Active)) then
begin
WriteLn('Player is not Active...');
if (AllPlayersInActive) then
begin
WriteLn('All players not active!');
Exit;
end;
NextPlayer(False);
Exit;
end;

{Wait for the client to finish loading.}

T := GetSystemTime;
repeat
if (RSReady) then
Break;
if ((GetSystemTime - T) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
Wait(RandomRange(1000, 2000));
until (False);
WriteLn('Welcome to Runescape.');


{New graphics have changed box}
Case CountColor(LOGIN_TEXTCOLOUR, 198, 192, 567, 259) of
1079: MouseBox(347, 295, 414, 303, 1);
1745: MouseBox(347, 305, 414, 312, 1);
end;

{Click less info if needed.}
{
if (not (SimilarColors(GetColor(382, 11), 14285562, 20))) then //Runescae sword green bead
begin
MouseBox(212, 479, 550, 495, 1); //Less info button
Wait(RandomRange(1000, 2000));
end;
}
{Click Members/free.}

Members := Players[CurrentPlayer].Member;
if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
Members := Players[CurrentPlayer].WorldInfo[0];

ProcStart:

{if (Members) then
I := 1;

if (GetColor(248, 359) <> 1381653) then //Black outline on forgotten pwd button.
begin
FindColors(TPA, 9291999, 10, 370, 675, 475);
ATPA := SplitTPA(TPA, 4);
if (Length(ATPA) > 2) then
begin
if (I = 1) then
I := 0
else
I := 1;
B := GetTPABounds(ATPA[1 + I]); //If demo mode is still up
end
else
if (Length(ATPA) = 2) then
B := GetTPABounds(ATPA[0 + I]) //When there's no demo mode
else
B := IntToBox(210, 424, 367, 446);

with B do
MouseBox(X1 + 20, Y1 + 10, X2 - 20, Y2 + 8, 1);

T := GetSystemTime; //Black outline on forgotten pwd button.
while ((GetSystemTime - T < 3000) and (GetColor(248, 359) <> 1381653)) do
Wait(RandomRange(100, 200));

end; }

{Type in username}

FindColors(TPA, LOGIN_TEXTCOLOUR, UBx1, UBy1, UBx2, UBy2);
if (Length(TPA) > 0) then
begin
SortTPAFrom(TPA, Point(UBx2, UBy1+(UBy2-UBy1) div 2));
Mouse(TPA[0].X + 20, TPA[0].Y, 5, 5, True);
end
else
MouseBox(UBx1, UBy1, UBx2, UBy2, 1); //Username box
while (CountColor(LOGIN_TEXTCOLOUR, UBx1, UBy1, UBx2, UBy2) > 0) do
begin
TypeByte(VK_BACK);
Wait(50+Random(50));
end;
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
{$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Name);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Name);
{$endif}
Wait(500 + Random(500));

{Type in password}

while (CountColor(LOGIN_TEXTCOLOUR, PBx1, PBy1, PBx2, PBy2) > 0) do
begin
TypeByte(VK_BACK);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
{$ifdef SRL_SMART}
SmartSendKeys(Players[CurrentPlayer].Pass);
TypeByte(VK_Return);
{$else}
TypeSend(Players[CurrentPlayer].Pass);
{$endif}
Wait(500 + Random(300));

{Check responses}

T := GetSystemTime;
repeat

SetLength(Actions, 0);

if ((GetSystemTime - T) > 60000) then
Actions := ['One minute has passed...', 0, 0, 'PlayerFalse', 'Login Failed']
else
case (CountColor(LOGIN_TEXTCOLOUR, 260, 140, 510, 400)) of //text colour points
// WriteLn Error Wait for Retrys Action Player[CurrentPlayer].Loc
763, 2348: Actions := ['Invalid Username / Password', 0, 2, 'PlayerFalse', 'Wrong User/Pass'];
1088: Actions := ['Your account has been disabled', 0, 0, 'PlayerFalse', 'Acc Disabled'];
951: Actions := ['Your account is already logged in', 5000, 0, 'PlayerTrue', 'Already logged in'];
1239: Actions := ['Not a Members Account', 0, 1, 'PlayerTrue', ''];
364: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
1057: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'PlayerFalse', 'Too many logins'];
-1: Actions := ['Runescape has been updated.', 0, 0, 'Terminate', 'RS updated'];
end;
{Respond}

if (Length(Actions) > 0) then
begin
WriteLn(Actions[0]);
if (Actions[0] <> 'Not a Members Account') then
begin
Wait(1000 + Random(500));
TypeByte(vk_Escape);
end;
Wait(Actions[1] + Random(100));
if (Actions[2] <> 0) then
if (Attempts < Actions[2]) or (Actions[2] = -1) then
begin
if (Actions[0] = 'Not a Members Account') then
begin
Players[CurrentPlayer].Member := False;
if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
Players[CurrentPlayer].WorldInfo[0] := False;
MouseBox(267, 321, 496, 350, 1); //Play free game instead button
Wait(3000 + Random(2000));
Result := True;
Exit;
end;
RetryLogin := True;
Wait(2000 + Random(1000));
Break;
end;
if (Actions[4] <> '') then
Players[CurrentPlayer].Loc := Actions[4];
case Actions[3] of
'PlayerFalse': NextPlayer(False);
'PlayerTrue': NextPlayer(True);
'Terminate': TerminateScript;
end;
Exit;
end;
Wait(100);
Result := (LobbyScreen) or (LoggedIn);
until (Result);

{Back to main screen if needed}

if (RetryLogin) then
begin
RetryLogin := False;
Inc(Attempts);
goto ProcStart;
end;

end;

If we do not support @ and .'s, this NEEDS to be added.

Gu3st...

2010-12-09 16:14:02

Bump for SRL Devs.

Naike

2010-12-09 16:25:34

I can't commit it, as I forgot my pass… again :3

Nava2

2010-12-09 16:53:24

What actually happened? I can commit it later i no one else has..

Camaro'

2010-12-09 17:06:25

From: Nava2
What actually happened? I can commit it later i no one else has..


Runescape makes you login with your email adress now :)(newer accounts only)

Nava2

2010-12-09 19:09:41

[QUOTE=Camaro';757412]Runescape makes you login with your email adress now :)(newer accounts only)[/QUOTE]

Wierd.. o.O

P3rs0nal1ty

2010-12-09 20:18:19

From: Nava2
Wierd.. o.O



yeah haha i was quite surprised when it was asking for my email as well.. >_>
and i hate manually typing my stuff into my bot.

traveler

2010-12-10 23:46:48

when is this going to be added? new people keep posting about the @ and .'s not working.

Wanted

2010-12-11 18:13:35

Committed

From: Naike
I can't commit it, as I forgot my pass… again :3


Check your user-name, it's case sensitive.

P3rs0nal1ty

2010-12-12 18:37:24

From: traveler
when is this going to be added? new people keep posting about the @ and .'s not working.


i keep asking myself the same question. its getting pretty annoying. because i cant even let my bot take a break, because then it wont be able to log in. >_> . need a fix. :fiery:

traveler

2010-12-12 18:43:36

donkey60000, it should be fixed, it was committed. update your srl and it should be able to work now.

P3rs0nal1ty

2010-12-12 18:57:49

From: traveler
donkey60000, it should be fixed, it was committed. update your srl and it should be able to work now.


yes i just figured that out >_< sorry im a bit dull LOL. but yes, thanks to everything that contributed to the fix, its much appreciated.