loragnor
2013-06-22 04:20:10
I've been playing around trying to change graphics settings during login. I found that if your graphics are set to either mid or high and the screen is resizable, the RSReady function does not see that and so the script eventually terminates. Here is my suggestion for a revision:
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;
// Loragnor - 6-22-2013
// Check for resizable clients in mid or high graphics
if(GetColor(736,-9) = 16645629) then
begin
WriteLn('You are using the "Resizeable" screen option and either mid or high graphics.');
WriteLn('Changing to "Fixed" screen and min graphics options.');
Mouse(736, -9, 1,1,mouse_left); // Open the options screen
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(230,180,5,5,mouse_left); // Change to min graphics
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" screen 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;