SCAR Code:
{.include SRL\SRL.Scar}
var
x, y: integer;
function Attack(var x, y: integer; Color: TIntegerArray; name: string): Boolean;
var
TPA: TPointArray;
aTPA, Split: T2DPointArray;
i, Ix, H, mX, mY: Integer;
TP: TPoint;
begin
ColorToleranceSpeed(1);
for i := 0 to 2 do
begin
{ mX := MSCX;
mY := MSCY; }
FindColorsSpiralTolerance(MSCX,MSCY, TPA, Color[i], MSX1, MSY1, MSX2, MSY2, 35);
SortTPAFrom(TPA, Point(MSCX, MSCY));
Split := SplitTPA(TPA, 40);
H := High(Split);
for i := 0 to Ix do
begin
TP := MiddleTPA(Split[i]);
MMouse(TP.x, TP.y, 3, 3);
Wait(500 + Random(600));
Case Random(3) of
0: if IsUpText(name)then
begin
Disguise('Attacking');
Mouse(TP.x, TP.y, 2, 2, true);
//antiban;
end;
1: if IsUpText(name)then
begin
Disguise('Attacking');
Mouse(TP.x, TP.y, 2, 2, false);
Wait(Random(500) + Random(750));
ChooseOption('ttack');
//antiban;
end;
2: if IsUpText(name) then
begin
Disguise('Attacking');
HoldMouse(TP.x, TP.y, true);
Wait(100 + RandomRange(50, 150));
ReleaseMouse(TP.x, TP.y, true);
//antiban;
end;
end;
Result := True;
end;
end;
end;
begin
SetupSRL;
Attack(x, y, [7036937, 7036937], '88');
end.
When i press 'PLAY', i get
[Runtime Error] : Out Of Range in line 22 in script
Now line 22 is TP := MiddleTPA(Split[i]);
I don't know wats wrong.
Note: The mainloop is just an example.