Gu3st...
2009-12-23 04:46:46
They both were broke for me, so I fixed them
Login_SetGraphics, Login.scar:
Problem: One color was wrong (the one that now is 15802143).
FixGraphics, GameTab.scar:
Problem: Almost all the coords were wrong.
vvv Read my edit vvv
NOTE: Please reply if you have no problem with the one inside the repository. Please test :)
Note: The one in OpenDev works, but it is slow and inaccurate. This fixed one is fast and accurate.
EDIT: Hmm.. Something is wrong.. FixGraphics; still doesn't work…
Login_SetGraphics, Login.scar:
Problem: One color was wrong (the one that now is 15802143).
procedure Login_SetGraphics(Brightness: Integer);
var
T, x, y, tx, ty, GraphicsMask: Integer;
P: TPoint;
begin
if (LoggedIn) then Exit;
GraphicsMask := BitmapFromString(20, 8, 'beNpjYPiPBBiQwH9UgFUcmYumA' +
'JOLJoipGNMNuMwkQy8eR+LRi1U7JhuPdvx2YXUYZvgQExdYtTAAAF' +
'Km3SM=');
TypeByte(vk_Escape); //347, 273, 393, 292
T := GetSystemTime;
while (not(FindBitmapMaskTolerance(GraphicsMask, X, Y, 279, 272, 483, 352, 0, 0))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindBitmapMaskTolerance(GraphicsMask, X, Y, 279, 272, 483, 352, 0, 0)) then
Mouse(X - 20, Y + 3, 50, 5, True)
else
begin
FreeBitmap(GraphicsMask);
Exit;
end;
Wait(100);
if (Brightness > 4) then
srl_Warn('Login_SetGraphics', 'Brightness must be between 0 and 4', warn_AllVersions)
else
if (Brightness <> 0) then
begin
x := 0;
repeat
P := Point(263 + ((Brightness - 1) * 32), 309);
if (GetColor(P.x, P.y) <> 15802143) then
begin
Mouse(P.x - 3, P.y, 3, 3, True);
if WaitColor(P.x, P.Y, 15802143, 1, 1000) then
break;
Inc(x);
end else
break;
until(x >= 5)
end;
repeat
if FindColor(x, y, 16777215, 143, 287, 621, 429) then
begin
Mouse(x + 10, y + 3, 10, 7, True);
getmousepos(tx, ty);
mouse(tx, ty + 10, 4, 4, true);
wait(300);
end;
until(not(FindColor(x, y, 16777215, 143, 287, 621, 429)));
Wait(100);
TypeByte(vk_Escape);
FreeBitmap(GraphicsMask);
end;FixGraphics, GameTab.scar:
Problem: Almost all the coords were wrong.
vvv Read my edit vvv
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(2070753, 0, MSX1, MSY1, MSX2, MSY2, 'Graphics Options', UpChars, Nothing)) and (LoggedIn) do
begin
GameTab(tab_Options);
MouseBox(605, 258, 623, 277, 1);
Wait(500 + 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) = SD_Color) then
begin
//Checks for the green arrow, clicks middle of box
Mouse(219, 85, 5, 5, True);
if not WaitColor(220, 81, 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, 156, 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(230, 198) = Bright_Color) then
begin
//checks for blue ball, clicks Max Brightness
Mouse(231, 199, 3, 3, True);
if not WaitColor(230, 198, 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, 172, 208+16*i, 248, 224+16*i) then
begin
Mouse(200, 215+15*i+7, 40, 3, True); //click middle of box
if WaitColor(172, 208+(16*i), MenuYellow_Color, 0, 1000) then
begin
FindColors(TPA, MenuYellow_Color, 172, 208+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(172, 208+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, 418, 192+16*i, 494, 208+16*i) then
begin
Mouse(437, 208+16*i+7, 40, 3, True); //click middle of box
if WaitColor(418, 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;
MMouse(491, 22, 2, 2);
Wait(100+random(100));
Mouse(491, 22, 2, 2, True);
end;NOTE: Please reply if you have no problem with the one inside the repository. Please test :)
Note: The one in OpenDev works, but it is slow and inaccurate. This fixed one is fast and accurate.
EDIT: Hmm.. Something is wrong.. FixGraphics; still doesn't work…