Foundry
2013-07-29 22:57:53
So I found a tutorial on a more accurate way to target mobs and I decided to use TPAs to make a cow killing script. The script worked a few hours ago on a different computer, but now it is not working on the one I am using now, with the computers having the same specs and everything (Windows 7 64 bit etc.) The problem I am having with it is its not finding the cow to click on it. I tried picking new colors and tolerances for about 15 minutes to see if it would work but that was to no avail. Could someone take a look at it and tell me if there are any obvious errors?
Function KillCows: Boolean;
Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, x, y, I, Retry: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
case Random(3) of // this is for the different color cows
0:
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3822686, MSX1, MSY1, MSX2, MSY2, 15); // I tried changing all of the MSs here to 0, 0, 750, 450
1:
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5726322, MSX1, MSY1, MSX2, MSY2, 15);
2:
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 8229540, MSX1, MSY1, MSX2, MSY2, 15);
end;
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 3, 3); // I also messed with the width and height
SortATPASize(TPAA, True);
For I := 0 To High(TPAA) do
if GetArraylength(TPAA[i]) > 4 then // changed this several times
begin
repeat
inc(Retry);
MiddleTPAEx(TPAA[i], x, y);
MMouse(x, y, 3, 3);
if (IsMouseOverText('tta')) then
begin
Result := true;
GetMousePos(X, Y);
mouse(x,y,2,3, true);
wait(3500 + Random(1000));
Break;
end;
until (Retry = 2);
Break;
end;
end;
