SRL Archive - SRL Archives

LoginPlayer fix


weequ

2009-04-08 10:41:37

Ok so jagex changed the login screen and here is a little fix to get login working ;)

procedure LoginPlayer;
var
Mark, Attempts: Integer;
Actions: TVariantArray;
RetryLogin: Boolean;
label
ProcStart;
begin
ActivateClient;
Wait(100);
TypeByte(vk_Escape);

if (GetColor(212, 327) = 238301) then //At Click To Play screen
begin
Wait(1000 + Random(3000));
MouseBox(227, 337, 555, 364, 1);
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;
if (not(RSReady)) then
begin
MarkTime(Mark);
while (not(RSReady)) do
begin
Wait(100);
if (TimeFromMark(Mark) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
end;
WriteLn('Welcome to Runescape.');
end;

LoginScreenMusic(True);
if (not(GraphicsSet)) then
begin
SetAutoingDefaults;
GraphicsSet := True;
end;
ProcStart:

if (not(LoggedIn)) then
begin
if (not(Players[CurrentPlayer].Active)) then
begin
WriteLn('Player is not Active...');
NextPlayer(False);
Exit;
end;
Wait(900 + random(60));

//Click 'Log In' on main menu
while (GetColor(343, 175) <> 7750) do //while (GetColor(343, 174) <> 7750) do
begin
MouseBox(360, 180, 400, 185, 1);
Wait(100 + Random(100));
end;

//Type Username
Mouse(315, 272, 10, 5, True);
while (CountColor(7750, 311, 269, 452, 284) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
TypeSend(Players[CurrentPlayer].Name);
Wait(100+random(50));

//Type Password
Mouse(315, 334, 10, 5, True);
while (CountColor(7750, 311, 337, 452, 352) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
TypeSend(Players[CurrentPlayer].Pass);
Wait(500 + Random(300));

if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then //If 'enter' from typesend didn't log us in
begin
MouseBox(355, 359, 403, 372, 1); //Click 'login' login screen
Wait(250 + random(100));
end;

MarkTime(Mark);
repeat
SetLength(Actions, 0);

if (TimeFromMark(Mark) > 60000) then
Actions := ['One minute has passed...', 0, 2, 'NextPlayer', 'Login Failed']
else
case (CountColor(12509695, 288, 205, 475, 247)) of //Number of text colour points
// Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
711: Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
787: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
408: Actions := ['World is full.', 5000, 20, 'Terminate', ''];
623: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];
//10: Actions := ['Error loading your profile.', 5000, 10, 'NextPlayer', 'Profile Loading Failed']; // Error loading your profile. Will attempt to re-login 5 more times.)
//11: Actions := ['Login server rejected session.', 1000, 10, 'NextPlayer', 'Login Serv. Rejected']; // Login server rejected session.
end;

if (Length(Actions) > 0) then
begin
WriteLn(Actions[0]);
Wait(Actions[1] + Random(100));
if (Actions[2] <> 0) then
if (Attempts < Actions[2]) or (Actions[2] = -1) then
begin
RetryLogin := True;
Break;
end;
if (Actions[4] <> '') then
Players[CurrentPlayer].Loc := Actions[4];
case Actions[3] of
'NextPlayer': NextPlayer(False);
'RandomNextPlayer': RandomNextPlayer(True);
'Terminate': TerminateScript;
end;
Exit;
end;
Wait(100);
until(GetColor(266, 69) = 1647915);//changed

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

if (GetColor(266, 69) = 1647915) then//changed
begin
Wait(1000 + Random(2000));
MouseBox(210, 410, 560, 450, 1);//changed
end;
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;

if (LoggedIn) then
begin
PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
begin;
Writeln('Nickname isn''t set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
end;
end;

Floor66

2009-04-08 11:14:30

Thanks. Needed it quick.

Dark Arcana

2009-04-08 11:32:20

Nice, thanks antti mies :D

footballjds

2009-04-08 11:58:57

that was fast enough :D
i love srl getting bigger. it used to be a year ago… that when somthing changed it was atleast 3-5 days until a fix was out for public :D

piepolo

2009-04-08 12:03:08

thx;)

70s_dollar

2009-04-08 12:05:06

Am I the only person this isn't working for? :(

piepolo

2009-04-08 12:09:36

From: 70s_dollar
Am I the only person this isn't working for? :(


it works for me.

Richard

2009-04-08 12:19:32

This won't be added permanently, cos its not a permanent update.

70s_dollar

2009-04-08 12:37:26

From: Richard
This won't be added permanently, cos its not a permanent update.


Well I replace this one with the old one and I get errors saying like RSReady error, help?

The_Closer

2009-04-08 12:46:39

Antti you are an absolute stud for making this update

WELL DONE

weequ

2009-04-08 13:04:36

From: 70s_dollar
Well I replace this one with the old one and I get errors saying like RSReady error, help?

Huh I hope you didn't replace the login.scar with this… You were supposed to replace only with the loginplayer function inside the login.scar with this ;)

70s_dollar

2009-04-08 13:52:51

From: antti mies
Huh I hope you didn't replace the login.scar with this… You were supposed to replace only with the loginplayer function inside the login.scar with this ;)


hehehehe, thank you sir!

chewgun

2009-04-08 14:46:52

Thanx a bunch,antti
When the login is back to normal,
do I just replace the updated login.scar with the backup?

Punkgi

2009-04-08 15:28:39

yeah i was about to replace the whole thing. lol good thing im not lazy and read up. and im pretty sure its perm…:

In Other News…

The layout of the welcome screen has been changed slightly to allow us to add further information to it in the future.


my error: Line 468: [Error] (5499:1): 'BEGIN' expected in script

Nava2

2009-04-08 16:06:28

Please see the sticky in this forum for the Developers fix.

Thank you though anti. :)

Skepsis

2009-04-08 21:24:28

From: 70s_dollar
hehehehe, thank you sir!


I did what 70's did, and i changed the script correctly, but the cursor in smart still hovers over that dumb bunny =(

someone help plzz

Bro

2009-04-09 02:21:37

So you just add this to the top of any script?



:norris:


EDIT: Cheer's Arcana.

Dark Arcana

2009-04-09 02:30:43

From: Bro
So you just add this to the top of any script?



:norris:


No, you replace the loginplayer function inside the login.scar with this one.

k1ng duffy

2009-04-09 05:02:16

Line 21: [Error] (4977:9): Unknown identifier 'RSReady' in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar

Dark Arcana

2009-04-09 05:06:40

From: k1ng duffy
Line 21: [Error] (4977:9): Unknown identifier 'RSReady' in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Login.scar


You replaced the whole thing, you only replace loginplayer function.

Replace your Login.scar with this.

Richard

2009-04-09 05:25:02

I've just put the function into my scripts, so that people don't have to worry about inserting this into there includes. I find it easier that way.

drag30

2009-04-09 20:39:31

god can somone please update the login.scar and upload it so it can work im so close to 99 strength and i want to get it please

Nava2

2009-04-09 20:41:25

From: drag30
god can somone please update the login.scar and upload it so it can work im so close to 99 strength and i want to get it please


In the sticky at the top of this thread, just copy the file there and replace your Login.scar with that one.

drag30

2009-04-09 20:45:08

when i do tht it pastes on just one line it doesnt go down. like thers only one line it doesnt go down like the other login

Bro

2009-04-10 06:21:39

Guy's I'm only new to SRL and I can't even find where login.scar is!

Help please, it would be greatly appreciated.



:norris:


EDIT: PPPPPPPPPPPPPPPPPPPPPPLLLLLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAASSSSSSSSSSSSSEEEEEEEEEEEEE

Richard

2009-04-10 08:16:46

Most likely to be: C:\Program Files\Scar3.15\Include\SRL\SRL\core.

Should be in that folder.

79121

2009-04-10 12:52:31

i'm getting an error on line 228 which is this: if (not(Players[CurrentPlayer].Active)) then.
I didn't see anyone else get the same error and i'm not really sure what it means.

Nava2

2009-04-10 13:16:33

Closed. Sorry, read the sticky at the top of this forum. Its what its for ;)