loragnor
2013-06-18 12:44:45
Hello.
I am trying to implement a bit of code to ensure the user has the optimal graphics settings for autoing. To do this, I have put in the following bit of code:
The difficulty occurs when the client is set to High resolution graphics. In that mode, there is a failure in the RSReady function of SRL/core/login.simba. It is not able to find the correct color to tell it that the client is done loading:
The problem seems to be in this block of RSReady:
RSReady is called from this block in LoginPlayerToLob:
The color found with GetColor in RSReady is 197379 instead of 16645629. Eventually, LoginPlayerToLob hits the 3 minute mark and it terminates.
Any help here would be appreciated. If I have to have it set to low graphics so that I can determine if the client is loaded, then my efforts here are already partially negated.
On another note, can someone please tell me how this repeat..until block in LoginPlayerToLob is evaluated? How is 'False' validated?
Thanks in advance.
I am trying to implement a bit of code to ensure the user has the optimal graphics settings for autoing. To do this, I have put in the following bit of code:
procedure SetupScript;
begin
// Set up the script and begin writing to the debug window
DefineVars;
SetupSRL;
// Set up and declare the player
DeclarePlayers;
// Login to the lobby screen and ensure the graphics are set as we want them
LoginPlayerToLob;
if (not LobbyScreen) then
begin
Writeln('Failed to login to the lobby screen. Please try again.');
Exit;
end
else
begin
Writeln('Setting your graphics properties to autoing optimal');
SetAutoingDefaults;
end;
end;
The difficulty occurs when the client is set to High resolution graphics. In that mode, there is a failure in the RSReady function of SRL/core/login.simba. It is not able to find the correct color to tell it that the client is done loading:
function RSReady: Boolean;
var
x, y: Integer;
begin
Result := (LoggedIn) or (LobbyScreen);
if (not Result) then
begin
ImageResetClientArea;
Result := (GetColor(745, 17) = 16645629) or FoundBar; // X button in top right && Navigation Bar.
SRL_ResetNavBar;
end;
if (GetColor(755, 43) = 16645629) then // X button on resizeable client
begin
WriteLn('You are using the "Resizeable" screen option in RS.');
WriteLn('Changing to "Fixed" screen option.');
Mouse(735, 44, 2, 2, mouse_Left);
Wait(600 + Random(800));
if FindBitMapToleranceIn(SRL_OPTIONS_BITMAP, x, y, 130, 40, 640, 265, 5) then
begin
Mouse(200, 270, 5, 5, mouse_Left); //Fixed button
Wait(1200 + Random(1200)); //Wait while the screen changes
Mouse(621, 71, 3, 3, mouse_Left); //Close the Options interface
Wait(600 + Random(240));
end
else
begin
WriteLn('Unable to find Options Screen.');
WriteLn('Please manually change to "Fixed" screeb size');
TerminateScript;
end;
end;
if (FindBitMapToleranceIn(SRL_OPTIONS_BITMAP, x, y, 130, 40, 640, 265, 5)) then
begin
Writeln('Failed to close Options Interface. Please report on Villavu Forum');
TerminateScript; //Failsafe if we fail to close the Interface for some reason
end;
end;
The problem seems to be in this block of RSReady:
if (not Result) then
begin
ImageResetClientArea;
Result := (GetColor(745, 17) = 16645629) or FoundBar; // X button in top right && Navigation Bar.
SRL_ResetNavBar;
end;
RSReady is called from this block in LoginPlayerToLob:
{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.');
The color found with GetColor in RSReady is 197379 instead of 16645629. Eventually, LoginPlayerToLob hits the 3 minute mark and it terminates.
Any help here would be appreciated. If I have to have it set to low graphics so that I can determine if the client is loaded, then my efforts here are already partially negated.
On another note, can someone please tell me how this repeat..until block in LoginPlayerToLob is evaluated? How is 'False' validated?
Thanks in advance.