
Originally Posted by
13om13e12
Code:
Procedure MinetheCoal;
var
x,y:integer;
begin
Tries:=0;
Mouse(262,185 ,1 ,1 ,true);
repeat
if not FindColortolerance(x, y, Coal_Color1, MSX1, MSY1, MSX2, MSY2, 10) then
begin
wait(100+random(400));
Tries:= Tries + 1;
end else break;
until (Tries = 20)
if Tries = 20 then
begin
Writeln('cant find ore')
terminatescript;
end;
repeat
if FindColorTolerance(x, y, Coal_Color1, MSX1, MSY1, MSX2, MSY2, 7) then
begin
wait(500+random(1000));
Mouse(x, y, 4, 4,true);
wait(8000+random(7000));
end;
until (InvFull);
end;
It's end else break;
If it finds the color, it breaks which causes it to terminatescript;
Oh and you need to set your Tries in your var section along with x and y.
Try this:
Code:
Procedure MinetheCoal;
var x, y, Tries : integer;
begin
Tries:=0;
Mouse(262,185 ,1 ,1 ,true);
repeat
if FindColorTolerance(x, y, Coal_Color1, MSX1, MSY1, MSX2, MSY2, 7) then
begin
Tries := 0;
wait(500+random(1000));
Mouse(x, y, 4, 4,true);
wait(8000+random(7000));
end
else if not FindColortolerance(x, y, Coal_Color1, MSX1, MSY1, MSX2, MSY2, 10) then
begin
repeat
wait(100+random(400));
Tries:= Tries + 1;
until((Tries = 20) or (FindColortolerance(x, y, Coal_Color1, MSX1, MSY1, MSX2, MSY2, 10)));
end;
if(Tries = 20)then
begin
Writeln('cant find ore');
terminatescript;
end;
until (InvFull);
end;