timmyboy
2006-05-01 17:27:22
Yep, another function from me :p
Returns true if you mined a rock, false if not.
Remember to set time-out(Mtime). Must be the max time you think it will take for your
character to min the ore.
Any comments appreciated.
Returns true if you mined a rock, false if not.
Remember to set time-out(Mtime). Must be the max time you think it will take for your
character to min the ore.
{*******************************************************************************
function MineDone(Mtime: Integer): Boolean;
By: Timmyboy
Description: Returns true if you mined a ore, false if not.
Remember to set time-out(Mtime). Must be the max time you think it will take for your
character to min the ore.
*******************************************************************************}
function MineDone(Mtime:Integer): Boolean;
var
Mmark, a : Integer;
begin
MarkTime(Mmark);
repeat
A:=A+1
wait(100)
until(FindChatText('swing your pick')) or (A=25);
begin
repeat
wait(500+random(400));
until(FindChatText('to mine some')) or (TimeFromMark(Mmark)>Mtime);
if(FindChatText('to mine some'))then
begin
Result:=true;
end else
if (TimeFromMark(Mmark)>Mtime)then
begin
Result:=false;
end;
end;
end;
Any comments appreciated.