SRL Archive - SRL Archives

FixGraphics fix


Cazax

2010-01-06 11:27:18

while (not FindTextTPA(2070753, 0, MSX1, MSY1, MSX2, MSY2, 'Graphics Settings', UpChars, Nothing)) and (LoggedIn) do
to:
while (not FindTextTPA(2071039, 0, MSX1, MSY1, MSX2, MSY2, 'Graphics Settings', UpChars, Nothing)) and (LoggedIn) do
or else it will click all the time Graphics Settings.

Gu3st...

2010-01-06 11:31:29

Great! :D
I edited it to make it Exit at start because I was autoing signed, but now I don't need to do that :)
Good job :)

Cazax

2010-01-06 13:05:48

That wasn't the only problem:
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;
GameTab(tab_Options);
MouseBox(605, 258, 623, 277, 1);
while (not FindTextTPA(2071039, 0, MSX1, MSY1, MSX2, MSY2, 'Graphics Settings', UpChars, Nothing)) and (LoggedIn) do
begin
Wait(700 + Random(200));
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, 81) = 3721541) then
begin
//Checks for the green arrow, clicks middle of box
Mouse(219, 85, 5, 5, True);
if not WaitColor(220, 81, 3721541, 0, 2000) then
FixGraphics;
end;

if not (GetColor(157, 159) = 8388607) 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, 159, 8388607, 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(234, 199) = 15802143) then
begin
//checks for blue ball, clicks Max Brightness
Mouse(234, 199, 3, 3, True);
if not WaitColor(234, 199, 15802143, 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;
The first 3 color checks were outdated.

Wanted

2010-01-06 13:29:27

Temp fix: put GraphicsSet := True; after SetUpSRL;

Gu3st...

2010-01-06 14:38:22

From: IceFire908
Temp fix: put GraphicsSet := True; after SetUpSRL;
Would be easier to edit FixGraphics to Cazax version or to
procedure FixGraphics;
begin
end;
and start the script logged out

EDIT: Maybe not easier, but it would fix the graphics if they weren't correct

Wanted

2010-01-06 17:01:48

Temp fix

TRiLeZ

2010-01-06 21:21:53

Fix:


{*******************************************************************************
Procedure FixGraphics;
By: Rasta Magician
Rev: 224
Date: 02 Sep 09
Description: Fixes the Graphic Options if LoggedIn
*******************************************************************************}
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;

The colours weren't outdated, just the coordinates.