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;
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;