ZephyrsFury
07-14-2008, 04:51 PM
Anyone that gets this problem try replacing LoginPlayer with this:
procedure LoginPlayer;
var
Tx, Ty, Mark, Attempts: Integer;
Actions: TVariantArray;
RetryLogin: Boolean;
label
ProcStart;
begin
ActivateClient;
Wait(100);
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 else
if (not(GetColor(520, 135) = 4038981)) and (not(LoggedIn)) then //Wait for RS to load
begin
while (not(GetColor(520, 135) = 4038981)) do
Wait(100);
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));
while (not(FindColor(Tx, Ty, 12509695, 288, 181, 475, 221))) do //Click 'Log In' on main menu
begin
MouseBox(354, 163, 408, 179, 1);
Wait(100 + Random(100));
end;
MouseBox(315, 255, 447, 264, 1); //Type Username
while (CountColor(7750, 311, 252, 452, 267) > 13) 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));
MouseBox(315, 323, 447, 333, 1); //Type Password
while (CountColor(7750, 311, 320, 452, 335) > 13) 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, 181, 475, 221, '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, 181, 475, 221)) 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 := ['You need a members account for this world.', 0, 0, 'NextPlayer', 'Non-member'];
408: Actions := ['World is full.', 5000, -1, 'Terminate', ''];
623: Actions := ['Your account is already logged in', 60000, 2, 'NextPlayer', ''];
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'];
//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);
'Terminate': TerminateScript;
end;
Exit;
end;
Wait(100);
until(GetColor(212, 327) = 238301);
if (RetryLogin) then
begin
RetryLogin := False;
Inc(Attempts);
goto ProcStart;
end;
if (GetColor(212, 327) = 238301) then
begin
Wait(1000 + Random(2000));
MouseBox(227, 337, 555, 364, 1);
end;
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;
if (LoggedIn) then
begin
Wait(500);
if (FindColor(Tx, Ty, 0, 7, 457, 137, 475)) then
if (not(FindTextTpa(0, 0, 7, 457, 137, 475, Capitalize(Players[CurrentPlayer].Name), SmallChars, Nothing))) then //Double check if logged in player is what we think it is
begin
WriteLn('Logged In Player is not in Players array.');
LogOut;
Wait(1000 + Random(1000));
LoginPlayer;
Exit;
end;
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;
Tell me if it works/if it doesn't work.
Thanks.
ZephyrsFury
07-14-2008, 05:02 PM
Zephy the error comes because if you have previously edited you include it saves your work and puts some thing with lots of >>>>> and ====== in it so you need to delete your includes. and checkout SVN
No in that case it wouldn't compile. This problem is caused by LoginPlayer not detecting your players' name correctly and logging out.
Maybe check the co-ords maybe try replacing the x1, y1, x2, y2 values. Wait a second I'll see if I can help you..
EDIT : Replace Line 453 with this:
if (not(FindTextTpa(0, 0, 7, 457, 96, 473, Capitalize(Players[CurrentPlayer].Name), SmallChars, Nothing))) then
I think that the main reason was becuase the box was too big.
ZephyrsFury
07-14-2008, 05:29 PM
Maybe check the co-ords maybe try replacing the x1, y1, x2, y2 values. Wait a second I'll see if I can help you..
The coords are correct. I think the problem is that it checks for your name before RS has fully loaded yet. I've added a little Wait to the proc above. Try to see if it still happens.
R3TR3C
07-14-2008, 09:03 PM
i am having the same problem, can someone upload a fix, or their srl folder? ive tried the one that was posted with the announcement but i get errors with the itemcounter and such.
Bubbinator
07-14-2008, 11:01 PM
I'm having issues along the same vein as these. I have deleted all of the includes and replaced them from the rar, and tried the suggested login procedure by Zephyr. So far here are the issues at hand:
If I leave the graphics checking in the login procedure it just opens up the graphics prompt on the main menu and moves the mouse around over the text at the top of the menu.
If I leave that out, it attempts to log in, but it doesn't actually activate the window, so it cannot type in the Username+Pass.
Finally, if I make sure the window is activated manually before it tries to log in, it will log in, then give the message that the logged in player is not in the player array. It then logs out, gets the window deactivated again, and keeps trying to login.
I don't know if its something I did, if I need to wait for scripts to get updated, or if I updated incorrectly. Confusion.
Note: I'm not posting this to bitch about peoples work, I truly appreciate the work you guys do, and its way over my head. I have found that detailed explanations of a bug usually make it easier to find, if this is in fact a bug, or my retardedness, both of which I cannot discern.
EDIT:
Rev 19 fixed almost everything, the only problem I'm having now is that the client window isn't activating correctly. Not sure if its a problem with my PC or what, but it hasn't happened before the updates. It will bring the window to the front, but the color at the top of the window stays the same, rather than turning to an activated state (blue). Also, it can click on the menu buttons and the log-in button, but it just can't type. Weirdest thing I have ever seen. I can activate the window manually though, and it works fine, perhaps I should just change the activate window function?
ZephyrsFury
07-15-2008, 03:31 AM
No no I believe the problem is with LoginPlayer but I never seem to get it. Basically what LoginPlayer does now is verifies the name of the player logged in is the same as the one in the array and logs and if its not. However this seems to be failing thus you keep logging in and out.
I'm trying to fix it now but seeing as it works fine for me I dunno...
For the time being just remove this bit (starts at line 454):
Wait(500);
if (FindColor(Tx, Ty, 0, 7, 457, 137, 475)) then
if (not(FindTextTpa(0, 0, 7, 457, 137, 475, Capitalize(Players[CurrentPlayer].Name), SmallChars, Nothing))) then //Double check if logged in player is what we think it is
begin
WriteLn('Logged In Player is not in Players array.');
LogOut;
Wait(1000 + Random(1000));
LoginPlayer;
Exit;
end;
from your LoginPlayer procedure in Login.scar.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.