Thief
2013-05-22 06:38:07
I'm trying to setup a fail safe for a script, in case the character ends up in a location where they can see an iron rock, but can't reach it.
This is what I've got, but I can't seem to get it to work.
Here are the two procedures.
This is what I've got, but I can't seem to get it to work.
Here are the two procedures.
Procedure WrongSideOfWall;
begin
if FindChatBoxText('You can''t reach that.',8,ClBlack) then
begin
WriteLn('Wrong side of wall, attempting to get to right spot');
end;
end;
Procedure MineOres;
var
x, y, PlusOne, OreCounter: Integer;
begin
MarkTime(TooLong);
PlusOne:= InvCount+1;
If FindObjCustom(x, y, ['ron'], [3491704, 3557754, 3755136, 3294324], 5) Then
begin
FindNormalRandoms;
StatsGuise('Found Iron.');
MMouse (x, y, 5, 5);
ClickMouse2(Mouse_left)
end;
Flag;
MarkTime(OreCounter);
[COLOR="#FF0000"]WrongSideOfWall;[/COLOR]
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Failed to find Iron.');
repeat
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Failed to find Iron.');
Antiban;
Wait(100);
If InvCount=PlusOne Then
begin
StatsGuise('Mined a precious Iron.');
Proggy;
end;
until (InvCount=PlusOne) or (TimeFromMark(OreCounter) > 3000+random(1500));
end;