jannemus
2012-07-14 03:40:40
Hello!
I'm tried to make a TPA for my character and then make it not to search in that area. Becourse if you have same color on your armor it should not klick on it. So the area is the one in middle while standing still.
The thing is, im getting errors when i try to run it :(
It should right click and attack Barbarians and ignore to search in the middle part of the screen.
Maybe there is an easier way to do this?
Thanks!
Dear // Jannemus!
I'm tried to make a TPA for my character and then make it not to search in that area. Becourse if you have same color on your armor it should not klick on it. So the area is the one in middle while standing still.
The thing is, im getting errors when i try to run it :(
Exception: Range check error at line 20
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap
Line 20: TPAYou := TPAFromBox(IntToBox(205, 263, 291, 250));
It should right click and attack Barbarians and ignore to search in the middle part of the screen.
Maybe there is an easier way to do this?
program new;
{$i SRL/srl.simba}
Function FindSomething : Boolean;
Var
CTS, x, y, I, h : Integer;
TPAYou, TPA: TPointArray;
ATPA: Array of TPointArray;
CPA: T2DPointArray;
mid: TPoint;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(3.49, 5.27);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3041353, MSX1, MSY1, MSX2, MSY2, 7);
ColorToleranceSpeed(CTS)
ATPA := TPAToATPAEx(TPA, 25, 25);
For I := 0 to High(ATPA) do
Begin
TPAYou := TPAFromBox(IntToBox(205, 263, 291, 250));
CPA := SplitTPA(TPA, 0);
h := High(CPA);
for i := 0 to h do
begin
if(GetArrayLength(CPA[i]) >= 2) then
begin
mid := MiddleTPA(CPA[i]);
if((mid.x > 5) AND (mid.y > 2)) then
begin
if((NOT PointInTPA(mid, TPAYou))) then
begin
MMouse(mid.x, mid.y, 0, 0);
begin
MiddleTPAEx(ATPA[i], x, y);
Mouse(x, y, 2, 2,False);
If (ChooseOption('ttack')) Then
Begin
Wait(1000);
Result := True;
Exit;
End;
End;
End;
End;
End;
End;
End;
Result := False;
End;
begin
SetupSRL;
FindSomething;
end.Thanks!
Dear // Jannemus!