SRL Archive - SRL Bugs

RSReady to handle (invalid) resizeable client.


Harry

2011-03-05 21:10:05

function RSReady: Boolean;
var
t: Integer;
begin
t := GetSystemTime + 5000;
while (not (Result)) and (t > GetSystemTime) do
begin
Result := (CountColor(0, MSCx - 20, MSCy - 20, MSCx + 20, MSCy + 20) < 20);
Wait(3);
end;
if (not (Result)) then
Exit;
Result := (LoggedIn) or (LobbyScreen) or (GetColor(745, 17) = 12312554); //X button in top right
if (GetColor(748,66) = 12312554) then // X button on resizeable client
begin
WriteLn('You are using the "Resizeable" screen option in RS.');
WriteLn('Please set it to "Fixed" to have SRL function properly.');
TerminateScript;
end;
end;

That color is constant on the resizeable client with the default SMART setup (the button changes location based on screen size). It probably wouldn't work if the user's browser was set at resizeable, but it will detect it fine if they are using SMART. I tested numerous times and appears to remain the same.

I thought of having it call something like SetAutoingDefaults but that doesn't work, and it's best for the user to understand what they did wrong.

Without this fix, SRL will hang for 3 minutes and then say an obscure error message about being "not ready". This should fix the issue for 99% of resizeable users.

Harry

2011-03-09 05:48:27

Bump for this, it's really confusing to newbies who do it wrong and then SRL does nothing when RS begins because of the graphics settings.

Home

2011-03-09 05:50:25

Support!



~Home

YoHoJo

2011-03-09 05:50:46

I 100% agree, there are countless threads posted about this 'problem' and this will probably help a lot of them! Great idea!

Gu3st...

2011-03-09 15:49:27

Support :)

IPwnz

2011-03-09 21:34:02

I support this :)

Floor66

2011-03-10 07:42:29

Please someone commit this already :P I hate to have to manually set fixed for all my bots.

Gu3st...

2011-03-10 07:51:02

From: Floor66
Please someone commit this already :P I hate to have to manually set fixed for all my bots.
You still have to do that with this fix

Floor66

2011-03-10 07:58:09

Yeah but see, the script will terminate itself the way it is now because it won't detect RS as loaded. Now I can make a simple function to set it to fixed once RS has loaded.

LolL

2011-03-17 15:23:42

Wait, why not just check if the handle has the proper size?

http://msdn.microsoft.com/en-us/library/ms633519%28v=vs.85%29.aspx


RECT wind_rect;
int width;
int height;
GetWindowRect(hWnd, &wind_rect);
width = wind_rect.bottom - wind_rect.x;
height = wind_rect.top - wind_rect.y;
if (width != 765 || height != 503) {
//Invalid size; handle this here
//???
//PROFIT
}

Harry

2011-03-17 16:04:35

The size of the resizeable client is the same as the fixed. Problem is, it conforms differently if you choose fixed or resizeable. Using that code wouldn't work LolL. Thanks for the idea though.

Coh3n

2011-03-22 15:15:41

Committed.