Simba Code:
Program GraphicsChecker;
{$Define SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
//Setup Variables
Const
ScriptVersion = '1.0'; //Current ScriptVersion
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Pin := '';
Players[0].Nick :='';
Players[0].Active:=True;
End;
///////////////////////////////////////////////////////////////////////////////////////////
// //
// End of user setup //
// Don't touch below this line unless you know what you're doing!! //
// //
// Thanks To Ashaman For this message, yes i am that lazy! //
// //
///////////////////////////////////////////////////////////////////////////////////////////
Var
FixedSizeDTM,SafeModeDTM,IdleDTM,ParticleDTM: Integer;
{*******************************-CREDITS-**************************************
All of these mouse movements and typing are credited To benland100 and flight.
Ashaman88 For his edits To benland100's and flight's already great functions
Thanks also To Ashaman88 For his awesome scripts, i used one of
his as a template when i was learning To make my first script
*******************************************************************************}
//By Bandland100, modified by Ashaman88 To shift mouse speeds after every step
//
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: Extended);
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: Extended;
lastX,lastY,MSP,W: Integer;
sqrt2,sqrt3,sqrt5: Extended;
Begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
Begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
If dist >= targetArea Then
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
Begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
Begin
maxStep:= random(3) + 3.0;
End Else
Begin
maxStep:= maxStep / sqrt5;
End;
End;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
If hypot(veloX, veloY) > maxStep Then
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
case Random(50) of
1..25: W := (MSP + (Random((MSP/4))));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
End;
If (W < 1) Then
W := 1;
If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
//W := round((maxWait - minWait) * (step / maxStep) + minWait);
wait(W);
lastdist:= dist;
End;
If (Round(xe) <> Round(xs)) Or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));
MouseSpeed := MSP;
End;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Var
randSpeed: Extended;
X,Y,X2,Y2,j,Dist,MP: Integer;
Begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
If MP < 0 Then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
End;
Procedure HumanMouseBox(X1, Y1, X2, Y2: Integer);
Var
FX, FY: Integer;
Begin
GaussBox(FX,FY,X1,Y1,X2,Y2);
HumanMMouse(FX,FY,0,0)
End;
{*******************************************************************************
Procedure FastClick(button: Integer);
By: Flight
Description: Quickly click the mouse.
*******************************************************************************}
Procedure FastClick(button: variant);
Var
x, y: Integer;
ibutton: Integer;
Begin
If VariantIsBoolean(button) Then
Begin
If (button) Then
iButton := mouse_left
Else
iButton := mouse_right;
End Else
iButton := button;
If (iButton = mouse_move) Then Exit;
GetMousePos(x, y);
HoldMouse(x, y, iButton);
Wait(RandomRange(60, 150));
GetMousePos(x, y);
ReleaseMouse(x, y, iButton);
End;
Procedure OffMM(RedTu, LeWait, rWait: Integer);
Var
W,H,RX,RY,T,RT: Integer;
Begin
GetClientDimensions(W,H);
H:=H+50;
RX := RandomRange(0, W);
RY := RandomRange(0, H);
Case (RedTu) Of
0..1: HumanMMouse(W/2, RandomRange(-110,-60), RX, 0);
2: HumanMMouse(RandomRange(-50,-10), H/2, 0, RY);
3: HumanMMouse(W/2, h+RandomRange(10,50), RX, 0);
4: HumanMMouse(W+RandomRange(10,50), H/2, 0, RY);
End;
RT:=(Random(rWait));
MarkTime(T);
Repeat
Wait(Random(100));
Until TimeFromMark(T)>(LeWait+RT);
End;
//
{*******************************************************************************
//
// DannyRS's Part
//
*******************************************************************************}
//
Procedure LeftClickSpot(X1, Y1, X2, Y2: Integer);
Var Y1NOBanner, Y2NOBanner: Integer;
Begin
Y1NOBanner:=Y1 - 50; Y2NOBanner:=Y2 - 50;
HumanMMouse(RandomRange(X1,X2),RandomRange(Y1NOBanner,Y2NOBanner),0,0);
Wait(9+Random(37));
FastClick(true);
Wait(124+Random(193));
End;
Procedure ClickCurrent(ToDo: Boolean);
Begin
Wait(9+Random(37));
If ToDo = True Then
Begin FastClick(True); End
Else If ToDo = False Then
Begin FastClick(False); End;
Wait(124+Random(193));
End;
Procedure MinimizeEoCBar(ToDo: Boolean);
Var x, y: Integer;
Begin
If ToDo = True Then
Begin
If (FindColorTolerance(x, y, 13224393, 517, 263, 517, 263, 5)) Then
LeftClickSpot(505,318,510,324);
End Else
If ToDo = False Then
Begin
If (Not FindColorTolerance(x, y, 13224393, 517, 263, 517, 263, 5)) Then
LeftClickSpot(505,382,510,385);
End;
End;
Procedure MainLoop;
Var x, y: Integer;
Var Done, DoubleCheck: Boolean;
Begin
Writeln('Welcome To SimpleGraphicsChecker by DannyRS');
//Pause Before Start Script
Writeln('Starting in 3...');
Wait(1000);
Writeln('Starting in 2...');
Wait(1000);
Writeln('Starting in 1...');
Wait(1000);
ClearDebug;
Repeat
Done := False;
If (Not LoggedIn) Or LobbyScreen Then
TerminateScript;
MinimizeEoCBar(True);
If (FindColorSpiralTolerance(x, y, 16777215, 203, 28, 207, 32, 10)) Then
Begin
Writeln('Closing Options');
LeftClickSpot(491,75,501,84);
Continue;
End;
If (FindColorSpiralTolerance(x, y, 16777215, 177, 12, 181, 16, 10)) Then
Begin
Writeln('Closing Options');
LeftClickSpot(491,60,501,70);
Continue;
End;
Writeln('Opening GFX Setup Screen');
LeftClickSpot(646,521,655,546);
LeftClickSpot(572,302,598,328);
Repeat
Wait(50);
Until (FindColorSpiralTolerance(x, y, 16777215, 202, 23, 208, 27, 10))
If Not FindDTM(FixedSizeDTM, x, y, 55, 240, 115, 290) Then
Begin
Writeln('Not On Fixed Size');
HumanMMouse(RandomRange(x-4,x+4),RandomRange(y-4,y+4),0,0);
ClickCurrent(True);
Continue;
End;
LeftClickSpot(371,212,439,227);
Repeat
Wait(50);
Until (FindColorSpiralTolerance(x, y, 16777215, 177, 12, 181, 16, 10))
If Not FindDTM(SafeModeDTM, x, y, 20, 170, 135, 210) Then
Begin
Writeln('Not On Safe Mode');
HumanMMouse(RandomRange(x-4,x+4),RandomRange(y-4,y+4),0,0);
ClickCurrent(True);
Continue;
End;
LeftClickSpot(495,357,503,361);
Wait(285+Random(257));
LeftClickSpot(495,357,503,361);
Wait(885+Random(257));
If Not(FindColorTolerance(x, y, 3160898, 244, 94, 244, 94, 3)) And (FindColorTolerance(x, y, 10536657, 244, 94, 244, 94, 3)) Then
Begin
Writeln('Not On Max Brightness Please Drag To Right And Re-Run');
TerminateScript;
End;
If Not(FindColorTolerance(x, y, 3160898, 467, 94, 467, 94, 3)) And (FindColorTolerance(x, y, 10536657, 467, 94, 467, 94, 3)) Then
Begin
Writeln('Not On Max Zoom Please Drag To Right And Re-Run');
TerminateScript;
End;
If Not (FindColorSpiralTolerance(x, y, 14790912, 200, 114, 215, 116, 20)) Then
Begin
Writeln('Not On Max CPU');
LeftClickSpot(179,160,245,168);
LeftClickSpot(187,222,224,227);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 135, 215, 137, 20)) Then
Begin
Writeln('Ground Decoration Wrong');
LeftClickSpot(179,179,245,189);
LeftClickSpot(199,196,213,204);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 195, 215, 197, 20)) Then
Begin
Writeln('Water Detail Wrong');
LeftClickSpot(179,239,245,249);
LeftClickSpot(197,255,213,260);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 213, 215, 215, 20)) Then
Begin
Writeln('Fog Option Wrong');
LeftClickSpot(179,259,245,270);
LeftClickSpot(197,275,213,283);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 234, 215, 236, 20)) Then
Begin
Writeln('Cursor Option Wrong');
LeftClickSpot(179,278,245,290);
LeftClickSpot(197,294,213,303);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 253, 215, 255, 20)) Then
Begin
Writeln('Textures Option Wrong');
LeftClickSpot(179,299,245,308);
LeftClickSpot(197,314,213,323);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 200, 294, 215, 296, 20)) Then
Begin
Writeln('ClickThrough Option Wrong');
LeftClickSpot(179,339,245,348);
LeftClickSpot(197,354,213,363);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 430, 115, 440, 117, 20)) Then
Begin
Writeln('RemoveRoofs Option Wrong');
LeftClickSpot(407,159,459,169);
LeftClickSpot(418,174,449,182);
Wait(1585+Random(257));
End;
If FindDTM(IdleDTM, x, y, 405, 125, 460, 145) Or (FindColorSpiralTolerance(x, y, 14790912, 430, 133, 440, 138, 20)) Then
Begin
Writeln('Idle Animations Option Wrong');
LeftClickSpot(407,179,459,189);
LeftClickSpot(425,195,442,200);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 430, 150, 440, 156, 20)) Then
Begin
Writeln('Char Shadows Option Wrong');
LeftClickSpot(407,198,459,210);
LeftClickSpot(425,214,442,225);
Wait(1585+Random(257));
End;
If FindDTM(ParticleDTM, x, y, 405, 205, 460, 225) Or (FindColorSpiralTolerance(x, y, 14790912, 430, 264, 440, 270, 20)) Then
Begin
Writeln('Particles Option Wrong');
LeftClickSpot(407,259,459,269);
LeftClickSpot(425,275,442,280);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 430, 230, 440, 240, 20)) Then
Begin
Writeln('Ground Blending Option Wrong');
LeftClickSpot(407,279,459,290);
LeftClickSpot(425,295,442,305);
Wait(1585+Random(257));
End;
If (FindColorSpiralTolerance(x, y, 14790912, 430, 270, 440, 280, 20)) Then
Begin
Writeln('MouseOverText Option Wrong');
LeftClickSpot(407,319,459,329);
LeftClickSpot(425,335,442,345);
Wait(1585+Random(257));
End;
If Not DoubleCheck Then
Begin
DoubleCheck:=True;
Continue;
End;
Writeln('Graphics Seem Correct Now :)');
Done:=True;
Until Done;
End;
Procedure FreeGlobals;
Begin
FreeDTM(FixedSizeDTM);
FreeDTM(SafeModeDTM);
FreeDTM(IdleDTM);
FreeDTM(ParticleDTM);
End;
Procedure SetMyGlobals;
Begin
FixedSizeDTM := DTMFromString('mrAAAAHic42BgYGgD4jwgngvEZVD2PCgGya1nYmBYBMVrgfgAEB9kQogbB+YwnDp1CoxlTbwYnJ2dGaytrRkmT54MFuMAmoEPMxLAMAAAVi0V4g==');
SafeModeDTM := DTMFromString('mlwAAAHicY2dgYKgC4gAoXgHFTUCcB8RpTAwMKUBcAKXzgDgHiLOAeGF/HsPiSYUMkT5WYDozyoXh1f3dYMwB1IsLM+LBUAAAl3wSaQ==');
IdleDTM := DTMFromString('mAAEAAHic42FgYLjNyMBwDYpB7PtA/ASInwPxayB+C8SvoDRIjR4TBJtiwSZAbA7EhlBsBMSvH+whCXMA3UQKZiQRIwMAPdkr5g==');
ParticleDTM := DTMFromString('m1gAAAHic42JgYFjICMGHoHg/EG+C4vVAvAaIlwExCxBzQzEHELMDMTOUz4Uk9/rBHqIwB9BuYjAjkRgBAIlcIQA=');
End;
Procedure Setup;
Begin
{$IFDEF SIMBAMAJOR980}
SMART_SERVER := 10;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
{$ELSE}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
SetupSRL;
ClearDebug;
DeclarePlayers;
SetMyGlobals;
AddOnTerminate('FreeGlobals');
SmartSetRefresh(90);
End;
Begin
Setup;
ActivateClient;
ClearDebug;
MainLoop;
End.