SCAR Code:
program New;
{.include srl/srl.scar}
function ObjPoints(Var P : TPointArray; color, tol: Integer): Boolean;
var
x, y, a, c, i, x1, y1, x2, y2: Integer;
begin
If (Not(FindColorTolerance(x, y, color, 5, 5, 510, 330, tol))) then exit;
Result := True;
SetArrayLength(P, 0);
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
Break;
a := a + 1;
if (a = 1) or (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tol)) then
begin
SetArrayLength(P, GetArrayLength(P)+1);
P[GetArrayLength(p)-1].x := x;
P[GetArrayLength(p)-1].y := y;
end;
end;
if (a = 4) then a := 0;
until (x2 > 515);
end;
Function FindFire(Var x, y : Integer) : Boolean;
Var
P : TPointArray;
DTM : TDTM;
NewDTM, i : Integer;
Angle : Extended;
begin
ColorToleranceSpeed(2);
If (Not(ObjPoints(P, 4505332, 20))) then
begin
ColorToleranceSpeed(1);
Exit;
end;
DTM.MainPoint.Color := 4505332;
DTM.MainPoint.Tolerance := 20;
DTM.MainPoint.x := 225;
DTM.MainPoint.y := 166;
SetArrayLength(DTM.SubPoints, 3);
DTM.SubPoints[0].Color := 12348;
DTM.SubPoints[0].Tolerance := 20;
DTM.SubPoints[0].x := 223;
DTM.SubPoints[0].y := 174;
DTM.SubPoints[1].Color := 12348;
DTM.SubPoints[1].Tolerance := 20;
DTM.SubPoints[1].x := 234;
DTM.SubPoints[1].y := 162;
DTM.SubPoints[2].Color := 12348;
DTM.SubPoints[2].Tolerance := 20;
DTM.SubPoints[2].x := 217;
DTM.SubPoints[2].y := 160;
NewDTM := AddDTM(DTM);
For i := 0 To GetArrayLength(P)-1 do
begin
Result := (FindDTMRotated(NewDTM, x, y, P[i].x -30, P[i].y -30, P[i].x +30, P[i].y +30, 0.0, Radians(360), 0.1, Angle));
If (Result) then Break;
end;
ColorToleranceSpeed(1);
FreeDTM(NewDTM);
end;
begin
SetupSRL;
FindRS;
ActivateClient;
Wait(500);
if (FindFire(x, y)) then
MMouse(x, y, 0, 0);
end.