Log in

View Full Version : SRL's LoginPlayer Returns false 100%



footballjds
02-02-2008, 08:39 PM
if you look at it:Function LoginPlayer : boolean;
var
ClickHereToPlay, i,
CHx, CHy, c, LastPlayer,Mark : Integer;
Options : TStringArray;
OneActive : Boolean;
Actions : TVariantArray;
begin
Result := False;
ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888 443D' +
'26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F43 65B7' +
'067D37AC3D95AADF2F50962C79');
OneActive := False;
if LoggedIn = False then
begin;
if (not (Players[CurrentPlayer].Active)) then
begin;
WriteLn('Current player is not Active...');
Repeat
For I := 0 to HowManyPlayers - 1 do
if players[I].Active = true then
OneActive := True;
if OneActive = True then
Break;
Wait(60000);
until false
end;
ActivateClient;
Wait(900 + random(60));
FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft);
Wait(100+random(50));
FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,ClickLeft);
Wait(100+random(50));
if FindTextTpa(clwhite,0,194, 174,564, 367,'Username',UpChars, Clickleft) then
begin
Wait(150 + Random(75));
WriteLn(Players[CurrentPlayer].Name);
TypeSend(Players[CurrentPlayer].Name);
Wait(100 + Random(100));
if FindTextTpa(clwhite,0,194, 174,564, 367,'Password',UpChars,ClickLeft) then
begin;
TypeSend(Players[CurrentPlayer].Pass);
Wait(100 + Random(100));
end;
end;
FindTextTpa(clwhite,0,194, 174,564, 367,'Login',UpChars,ClickLeft);
Wait(250 + random(100));
Mark := GetSystemTime;
repeat
Wait(Random(250) + 100);
if (GetSystemTime - Mark) > 35000 then Break;
until not FindTextTpa(65535,0,194, 174,564, 367,'...',UpChars,Nothing);
Mark := GetSystemTime;
Repeat
if FindTextTpa(65535,0,194, 174,564, 367,'...',UpChars,Nothing) or //Still waiting to log in
FindTextTpa(65535,0,194, 174,564, 367,'trans',UpChars,Nothing) then //Your account is beeing transfered
begin;
Wait(1000 + random(500));
end else
begin;
if (GetSystemTime - Mark) > 180000 then
begin
if (GetSystemTime - Mark) > 240000 then
begin;
NextPlayer(false);
Exit;
end;
WriteLn('three minutes have passed');
WriteFileString(TheFile, Chr(13) + 'THREE MINUTES HAVE PASSED!!!' +
Chr(13));
ActivateClient;
FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft);
Wait(100+random(50));
FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,ClickLeft);
end;
Options := ['nter your','already','nvalid','excee','full','offl','rr or','ontact','reject','reload',
'updat','disabled','member','elcom','incorrect'];
OneActive := False;
For I := 0 to High(Options) do
if FindTextTpa(65535,0,194, 174,564, 367,Options[I],UpChars,Nothing) then
begin;
OneActive := True;
Break;
end;
if OneActive then
begin;
FreeBitmap(ClickHereToPlay);
SetLength(Actions,2);
Case Options[I] of
'reload' : begin; //Runescape updated
WriteLn('ERROR. RuneScape has been updated. Script Terminated.');
Terminatescript;
end;
'disabled' : begin; //Your account has been disabled..
WriteLn('Your account has been disabled');
Players[CurrentPlayer].loc := 'DISABLED';
NextPlayer(False);
Exit;
end;
'member' : begin; // You need a Members account...
WriteLn('You need a Members account...');
Players[CurrentPlayer].loc := 'Non-Member';
NextPlayer(False);
exit;
end;
'already' : begin //Account already logged in
Actions := ['Your account is already logged in',0];
LastPlayer := CurrentPlayer;
repeat
CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
Wait(200);
until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
end;
'nvalid' : begin;// Invalid Username. 3 attempts. If fails, username/pass incorrect
Actions := ['Invalid Username \ Password',0];
Inc(SRL_Attempts);
if SRL_Attempts > 3 then
begin;
Players[CurrentPlayer].Loc := 'Login ERROR';
SRL_Attempts := 0;
Nextplayer(False);
Exit;
end;
end;
'excee' : Actions := ['Login attempts exceeded. Please wait 1 minute and try again.',60000];
'offl' : Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000)]; // Unable to connect. Login Server offline.
'nter your': Actions := ['Enter your username and password',0];//Login failed
'full' : Actions := ['World is full.',5000]; //World is full =]
'rror' : Actions := ['Error Connecting.',10000]; //Error, connection timed out?
'ontact' : Actions := ['Error loading your profile.',2000]; // Error loading your profile. Will attempt to re-login 5 more times.)
'reject' : Actions := ['Login server rejected session.',1000]; // Login server rejected session.
'updat' : Actions := ['The Server is being updated.',60000]; // The Server is being updated. Please wait 1 minute.
'elcom' : Actions := ['Welcome.',0];
'incorrect': Actions := ['To many incorrect logins.',60000 * 5]; //Wrong logins baby.
end;
Writeln(Actions[0]);
Wait(Actions[1] + Random(100));
LoginPlayer;
Exit;
end;
end;
Wait(1000);
until (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390,
5)) or FindColor(CHx, CHy, 723587, 522, 5, 560, 39);
Wait(1000 + Random(500));
if (FindBitmapToleranceIn(ClickHereToPlay, CHx, CHy, 250, 270, 530, 390, 5)) then
Mouse(CHx, CHy, 50, 20, True) // Clicks randomly on the button
else
Writeln('Found Compass');
repeat
Wait(1000);
c := c + 1;
until ((LoggedIn = True) or (c >= 600));
end;
FreeBitmap(ClickHereToPlay);
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 isnt set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
WriteFileString(TheFile, Chr(13) + 'Current player: '+ UpperCase(Players[CurrentPlayer].Name) + Chr(13)); //* Save NAME to file
end;
end;
it has no return := true;
this is a BIG problem! because you can never know if it logged in correctly or not :eek:
luckily this is the worlds easiest fix, right after it says if loggedin then
begin
put: Result := True;

radragon16
02-03-2008, 08:15 AM
That doesn't work. Here is the fix. This is what it needs to look like to work:

if LoggedIn then
begin
Result := True;
if Result = True then

n3ss3s
02-03-2008, 10:55 AM
this is a BIG problem! because you can never know if it logged in correctly or not

Lol, don't worry about it, when was the last time you saw someone use

"If Not LoginPlayer Then NextPlayer(LoggedIn)" or something like that?

mastaraymond
02-03-2008, 10:56 AM
It used to be a procedure, but i made it a boolean. Just forget to put in the result :p.

Shouldn't be a big problem though, the real problem is that LoggedIn is returning false while it should return true.

MasterKill
02-03-2008, 11:01 AM
Shouldn't be a big problem though, the real problem is that LoggedIn is returning false while it should return true.

YES HOW TO FIX THAT! it's so frustrating!

changing the function to this DOENST work to:

function LoggedIn: Boolean;
begin
if (GetColor(439, 491) = 16777215) then
Result := True else Result := False;
end;

i guess i need to make my own loggedin?

mastaraymond
02-03-2008, 11:04 AM
YES HOW TO FIX THAT! it's so frustrating!

changing the function to this DOENST work to:

function LoggedIn: Boolean;
begin
if (GetColor(439, 491) = 16777215) then
Result := True else Result := False;
end;

i guess i need to make my own loggedin?

I've no clue...

MasterKill
02-03-2008, 11:06 AM
I've no clue...

scar is attacking our brains!

maybe freddy knows why?

Rikje
02-03-2008, 11:16 AM
masterkill, Why not use the gametab detection to look if you're loggedin


function LoggedIn: Boolean;
begin
Result := TabExists(8); //Friend list. theres no random that disables you're friend list.
end;


tough, if you change this in srl it wont compline.

MasterKill
02-03-2008, 11:56 AM
wizzup found me an solution allready

Filepath: >>> Includes\srl\srl\core\player.scar

{************************************************* ******************************
function LoggedIn: Boolean;
By: WT-Fakawi
Description: Returns True if Logged In.
************************************************** *****************************}

function LoggedIn: Boolean;
begin
//Result := (GetColor(439, 491) = 16777215)
Result := (countColor(16777215, 404, 479, 513, 501) > 0);
end;

Swift
02-03-2008, 01:29 PM
wizzup found me an solution allready

Filepath: >>> Includes\srl\srl\core\login.scar

{************************************************* ******************************
function LoggedIn: Boolean;
By: WT-Fakawi
Description: Returns True if Logged In.
************************************************** *****************************}

function LoggedIn: Boolean;
begin
//Result := (GetColor(439, 491) = 16777215)
Result := (countColor(16777215, 404, 479, 513, 501) > 0);
end;

That's in Players.scar, not Login.scar

MasterKill
02-03-2008, 01:36 PM
That's in Players.scar, not Login.scar

sorry!

MylesMadness
02-03-2008, 02:27 PM
Logged in works great for me.

footballjds
02-03-2008, 07:28 PM
Lol, don't worry about it, when was the last time you saw someone use

"If Not LoginPlayer Then NextPlayer(LoggedIn)" or something like that?
ME

It used to be a procedure, but i made it a boolean. Just forget to put in the result :p. :duh:


Logged in works great for me.
same ^^^^^^^^

radragon16
02-04-2008, 05:07 AM
LOL seems like I was ignored :( btw mine is working :)

footballjds
02-04-2008, 02:35 PM
LOL seems like I was ignored :( btw mine is working :)

yours was ignored b/c people arnt idiots :D and know how to copy/paste :D.

MasterRay you should also limit the amount of times it attempts to log in.... its almost an endless loop.. (its not but it will go for like 1 hr...)

mastaraymond
02-04-2008, 02:57 PM
yours was ignored b/c people arnt idiots :D and know how to copy/paste :D.

MasterRay you should also limit the amount of times it attempts to log in.... its almost an endless loop.. (its not but it will go for like 1 hr...)
It's Raymond. The attempts? It should be around 15 min..

footballjds
02-04-2008, 04:49 PM
It's Raymond. The attempts? It should be around 15 min..

it shouldn't keep trying when it says "error conecting" and it should only try like 5 times or so. not for 15 mins !!! :eek:

mastaraymond
02-04-2008, 06:47 PM
it shouldn't keep trying when it says "error conecting" and it should only try like 5 times or so. not for 15 mins !!! :eek:
Why not? If there is an error with the connection, it should try as long as it can..

Nothing to lose, is there?