SRL Archive - SRL Bugs

Graphics While Logged In


Sex

2010-01-27 02:49:46

When I start a script logged in, it repeats checking the graphics in a never ending loop (click graphics, check, close, repeat).

This is really starting to annoy me as I have to log out and start a script every time I run it.

I would also like to point out that it works when starting not logged in.

Mr. Doctor

2010-01-27 06:33:27

From: Sex
When I start a script logged in, it repeats checking the graphics in a never ending loop (click graphics, check, close, repeat).

This is really starting to annoy me as I have to log out and start a script every time I run it.

I would also like to point out that it works when starting not logged in.


IceFire's simple fix was to put

GraphicsSet := True;
in the main loop so it stops the check and does not set the graphics.

Sex

2010-01-27 07:12:12

Although that would work, it is temporary and might mess up if the graphics are not set..
I would like to see a permanent fix made.

TRiLeZ

2010-01-27 12:21:13

I posted a fix but it never got committed…


Procedure FixGraphics;
var
TPA: TPointArray;
TB: TBox;
TP, TP2: TPoint;
i, x, y: integer;
begin
//This procedure is not versatile, just gets the needed job done
if (not LoggedIn) then exit;
CloseWindow;

if (not FindColor(x, y, 0, 7, 460, 69, 474)) then
if (not ClickContinue(True, True)) then
Mouse(MMCX, MMCY, 2, 2, True);

i := 0;
while (not FindTextTPA(2071039, 0, MSX1, MSY1, MSX2, MSY2, 'Graphics Settings', UpChars, Nothing)) and (LoggedIn) do
begin
GameTab(tab_Options);
MouseBox(605, 258, 623, 277, 1);
Wait(1000 + Random(500));
Inc(i);
if (i > 3) then
begin
srl_Warn('SetGraphics', 'Could not open Graphics Options screen', warn_Warning);
CloseWindow;
Exit;
end;
end;

if not (GetColor(220, 82) = SD_Color) then
begin
//Checks for the green arrow, clicks middle of box
Mouse(219, 85, 5, 5, True);
if not WaitColor(219, 85, SD_Color, 0, 2000) then
FixGraphics;
end;

if not (GetColor(157, 156) = Fixed_Color) then
begin
//checks for the yellow color in Fixed Screen sizing
//clicks middle of box
Mouse(168, 138, 5, 5, True);
if not WaitColor(157, 174, Fixed_Color, 0, 2000) then
FixGraphics;
end;

{FindColors(TPA, ScreenSize_Color, ScreenSize_Box_x1,
ScreenSize_Box_y1, ScreenSize_Box_x2,
ScreenSize_Box_y2);

if not (Length(TPA) = ScreenSize_Count) then
begin
//clicks middle of box
Mouse(433, 170, 7, 2, True);
//waits for menu
if WaitColor(475, 162, 8388607, 0, 500) then
Mouse(431, 185, 7, 2, True); //clicks 800x600
end;}

if not (GetColor(235, 199) = Bright_Color) then
begin
//checks for blue ball, clicks Max Brightness
Mouse(235, 199, 3, 3, True);
if not WaitColor(235, 199, Bright_Color, 0, 3000) then
FixGraphics;
end;

//now onto the advanced options
//each box is 15px vertically
//counting from the first layer of brown on top
//and first layer of brown on bottom

for i:= 0 to 5 do //6 options on left column
begin
if FindColor(x, y, WhiteText_Color, 188, 224+16*i, 219, 239+16*i) then
begin
Mouse(188, 224+15*i+7, 40, 3, True); //click middle of box
if WaitColor(188, 224+(16*i), MenuYellow_Color, 0, 1000) then
begin
FindColors(TPA, MenuYellow_Color, 172, 224+16*i, 248, 224+16*i+16*2);
//x - 172 = start of menu ; x - 248 = end of menu
//224+15*i+15*2 = start of menu + 2 options
TB := GetTPABounds(TPA); //--> scar fuck up
if not FindColors(TPA, YellowText_Color, TB.x1, TB.y1, TB.x2, TB.y2) then
writeln(inttostr(Length(TPA)));
TP := MiddleTPA(TPA);
Mouse(TP.x, TP.y, 3, 3, True);
if not WaitColor(188, 224+16*i, MenuBrown_Color, 0, 500+Integer(i=4)*3000) then
FixGraphics;
end else
FixGraphics;
end;
wait(random(500));
end;

for i := 0 to 5 do //6 options on right column
begin
if FindColor(x, y, WhiteText_Color, 437, 208+16*i, 460, 223+16*i) then
begin
Mouse(437, 208+16*i+7, 40, 3, True); //click middle of box
if WaitColor(437, 208+16*i, MenuYellow_Color, 0, 500) then
begin
FindColors(TPA, MenuYellow_Color, 418, 208+16*i, 494, 208+16*i+16*3)
//x - 418 = start of menu ; x - 494 = end of menu
//208+15*i+15*3 = start of menu + 3 options
TB := GetTPABounds(TPA); // --> Scar fuck up.
//TB := IntToBox(418, 208+15*i, 494, 208+15*i+15*2);
FindColors(TPA, YellowText_Color, TB.x1, TB.y1, TB.x2, TB.y2);
TP := Point(418, 208+16*i);
SortTPAFrom(TPA, TP); //all this TPA manipulation is needed because
TP := TPA[0]; //animations have 3 options, while the others have 2
TP2 := MiddleTPA(TPA);
Mouse(TP2.x, TP.y+3, 3, 3, True);
if not WaitColor(188, 224+15*i, MenuBrown_Color, 0, 5000) then
FixGraphics;
end else FixGraphics;
wait(random(500));
end;
end;
Mouse(491, 22, 2, 2, True); //CloseWindow;
end;
In GameTab.scar

YoHoJo

2010-01-27 18:16:33

From: Sex
Although that would work, it is temporary and might mess up if the graphics are not set..
I would like to see a permanent fix made.


Well, if you start logged out, and the script logs in, then technically your graphics are fine.
Also, if you play on a SIGNED client (which you should, why not?) then once you set your graphics once, they will always be set. So yeah :D

Sex

2010-01-27 18:23:04

From: YoHoJo
Well, if you start logged out, and the script logs in, then technically your graphics are fine.
Also, if you play on a SIGNED client (which you should, why not?) then once you set your graphics once, they will always be set. So yeah :D

Indeed, but still. It is something that should be fixed because it is a bug..regardless of how minor it is. We have the fix, why not apply it?