sickle
06-17-2012, 06:47 PM
The procedure mines mithril. I want to make it mine mithril while mithril can be found in view, and then if not found move on to the next procedure. Usually it mines one mithril, and although there are more mithril it will just move on to the next procedure.
I think it's something to do with while-do or repeat-until or for-do, but changing things around didn't help.
Thank you in advance for your expert help!
:fiery:
procedure MithFinder;
var
x, y, z, T, d : Integer;
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
while (d<100) do
inc(d);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04,0.3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9200996, MSX1, MSY1, MSX2, MSY2, 12);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
if WaitUptext('ine',900) then
begin
ClickMouse2(1);
MarkTime(T);
Writeln('Minig Mithril')
wait(random(1200));
repeat
inc(Z);
writeln('waiting for mithril rock ('+(inttostr(z))+')');
wait(1000+random(250));
until(z>29) or (TimeFromMark(T)>14000+Random(450));
end;
end;
end;
I think it's something to do with while-do or repeat-until or for-do, but changing things around didn't help.
Thank you in advance for your expert help!
:fiery:
procedure MithFinder;
var
x, y, z, T, d : Integer;
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
while (d<100) do
inc(d);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04,0.3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9200996, MSX1, MSY1, MSX2, MSY2, 12);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
if WaitUptext('ine',900) then
begin
ClickMouse2(1);
MarkTime(T);
Writeln('Minig Mithril')
wait(random(1200));
repeat
inc(Z);
writeln('waiting for mithril rock ('+(inttostr(z))+')');
wait(1000+random(250));
until(z>29) or (TimeFromMark(T)>14000+Random(450));
end;
end;
end;