westkevin12
2014-05-11 16:28:36
I'm having trouble finding what is making my script wait about 2 seconds before mining the next iron. here are my procedures and functions for mining. can anyone see what could be causing the delay?
function findtheiron(x, y: Integer): Boolean;
var
MyTPA: TPointArray;
MMTPA: TPoint;
MyATPA: T2DPointarray;
TPAL, CTS, i: Integer;
PBox: TBox;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 0.75);
FindColorsSpiralTolerance(MSCx, MSCy, MyTPA, 1450296, MSx1, MSy1, MSx2, MSy2, 9);
ColorToleranceSpeed(CTS);
if Length(MyTPA) = 0 then
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.08, 0.30);
FindColorsSpiralTolerance(MSCx, MSCy, MyTPA, 2108489, MSx1, MSy1, MSx2, MSy2, 7);
ColorToleranceSpeed(CTS);
end;
SMART_DrawDots(MyTPA);
MyATPA := tpatoatpaex(mytpa, 40, 40);
TPAL := High(MyATPA);
for i := TPAL downto 0 do
MMTPA := MiddleTPA(MyATPA[i]);
MMouse(MMTPA.x, MMTPA.y, 6, 6);
if (IsUpTextMultiCustom(['ine', 'roc'])) then
begin
result := true;
ClickMouse2(Mouse_Left);
end;
Exit;
end;
procedure mineloop;
var
PBox: TBox;
x, y: integer;
begin
makecompass('E');
R_FindNormalRandoms;
PBox := IntToBox(206, 137, 309, 230);
repeat
findtheiron(x, y);
while (isMoving) do
wait(50);
while (AveragePixelShift(PBox, 250, 500) > 300) do
wait(70);
until invfull;
Incex(IronOre2, 27);
end;
procedure mainloop;
begin
MaxTimeMS := ((MaxTime) * 60000);
repeat
walktopit;
proggy;
mineloop;
proggy;
WalkToBankDDTM;
wait(100);
OpenMyBank;
while (ismoving) do
wait(200);
Wait(2000 + random(300));
DepositOre;
Inc(LoadsDone) if (MaxTimeMS < GetTimeRunning) then
Exit;
until False
end;