RlagkRud
2014-07-18 13:00:24
Hey guys this is an excerpt from my SawMill script.
Sometimes, the script clicks on the sawmill but exits false. I have no idea why.
Here's the cod:
Any help would be great! Thanks!
Thinking of releasing this as soon as this and some other bugs get fixed.
Sometimes, the script clicks on the sawmill but exits false. I have no idea why.
Here's the cod:
Function FindSawMill: boolean;
var
x, y, i : integer;
ZeroCoor : TPoint;
TPA : TPointArray;
ATPA: T2DPointArray;
T : TTimeMarker;
begin
If Not IsLoggedIn Then
Exit;
smartimage.clear;
T.reset;
T.start;
Repeat
wait(randomrange(250,500));
if findColorsSpiralTolerance(x, y, TPA, 3173016, mainscreen.getbounds, 6, colorSetting(2, 0.30, 0.11)) then
break;
If (Not IsLoggedIn) Then
Exit;
if SawmillTime.GetTime > 5 * 60 * 1000 then
begin
Writeln('Couldnt find a mill for 5 minutes! Terminating!');
TerminateScript;
end;
Until (False);
ATPA := TPA.toATPA(50,30);
ATPA.filterBetween(0, 300);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
if length(ATPA) = 0 then
FindSawMill;
for i := 0 to high(ATPA) do
begin
writeln(length(ATPA[i]));
Obx := middleTPA(ATPA[i]).x ;
Oby := middleTPA(ATPA[i]).y ;
mouse(Obx-7, Oby-7, 14, 14, mouse_move);
If (IsMouseOverText(['Make p','planks'])) Then
Begin
fastclick(mouse_left);
Timeout.reset;
Timeout.start;
Result := True;
Exit;
end else
begin
FindSawMill;
end;
end;
end;
Any help would be great! Thanks!
Thinking of releasing this as soon as this and some other bugs get fixed.