Code:
program AutoHunter;
var //set the variables' types
COLOR1, COLOR2, X, Y, XS1, XE1, YS1, YE1, XS2, YS2, XE2, YE2, XS3, XE3, YS3, YE3, XS4, YS4, XE4, YE4, FOUND : integer;
procedure DefineVariables; //set the variables' values.
begin
FOUND := 0;
COLOR1 := 9688060;
COLOR2 := 800847;
X := 0;
Y := 0;
XS1 := 462;
XE1 := 562;
YS1 := 334;
YE1 := 434;
XS2 := 412;
XE2 := 612;
YS2 := 284;
YE2 := 484;
XS3 := 312;
XE3 := 712;
YS3 := 184;
YE3 := 584;
XS4 := 212;
XE4 := 812;
YS4 := 84;
YE4 := 684;
writeln('variables successfully defined'); //*DEBUGGING ELEMENT*//
end;
procedure FindColor; //Finding the color and recording the coordinates
begin
if(FOUND = 0)then //Find COLOR1 in coords XS1 YS1 XE1 YE1
begin
FindColorSpiral(X, Y, COLOR1, XS1, YS1, XE1, YE1);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR2, XS1, YS1, XE1, YE1);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR1, XS2, YS2, XE2, YE2);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR2, XS2, YS2, XE2, YE2);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR1, XS3, YS3, XE3, YE3);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR2, XS3, YS3, XE3, YE3);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR1, XS4, YS4, XE4, YE4);
FOUND := 0;
end else
begin
FindColorSpiral(X, Y, COLOR2, XS4, YS4, XE4, YE4);
FOUND := 0;
end else
writeln('no colors found'); //*DEBUGGING ELEMENT*//
end;
procedure ClickColor;
begin
MoveMouseSmooth(X, Y);
end;
BEGIN
DefineVariables;
FindColor;
ClickColor;
END.