J J
2012-02-26 16:48:15
== HAS BEEN ANSWERED ==
I'm working on a thieving script. Once you succesfully thieved a chest you have a chance that this message will pop up.

I have already scripted my way that the script understands that the chest has been succesfully looted if that message doesn't pop up. But it blocks chatbox and Simba can no longer read it to check if it has been succesful.
How can I repeat my script until it has found this message? I was thinking of using something with color or a DTM. But my attempts have resulted into failed compiling so I'm looking for some help. This is my starting so far.
Thanks in advance.
EDIT: here is the whole script so far
I'm working on a thieving script. Once you succesfully thieved a chest you have a chance that this message will pop up.

I have already scripted my way that the script understands that the chest has been succesfully looted if that message doesn't pop up. But it blocks chatbox and Simba can no longer read it to check if it has been succesful.
How can I repeat my script until it has found this message? I was thinking of using something with color or a DTM. But my attempts have resulted into failed compiling so I'm looking for some help. This is my starting so far.
begin
ActivateClient;
SetUpSRL;
repeat
OpenChest;
repeat
CheckFail;
until(FindChatBoxText('open', 7, clBlack)) or
(FindChatBoxText('open', 8, clBlack))
until(false)
end.Thanks in advance.
EDIT: here is the whole script so far
program ReadText;
{$i srl/srl.simba}
Function OpenChest:Boolean;
Var
X, Y: Integer;
begin
X:=MSCX;
Y:=MSCY;
if FindObjTPA(X, Y, 7442344, 5, 1, 4, 9, 20, ['ract']) then
begin;
Writeln('We found the chest');
GetMousePos(X, Y);
Case Random(4) of
0: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
1: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
2: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
3: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
end;
end;
end;
procedure GreenBox;
Var
X, Y:Integer;
begin
if FindColorSpiralTolerance(X, Y, 1137204, 220, 457, 298, 479, 20) then
begin
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, True);
Wait(1500+random(1000));
end;
end;
function CheckFail:Boolean;
Var
X, Y: Integer;
begin
if(FindChatBoxText('fail', 8, clBlack)) then
begin;
Writeln('We failed to open the chest, trying again');
FindObjTPA(X, Y, 7442344, 5, 1, 4, 9, 20, ['ract']);
GetMousePos(X, Y);
end;
if(FindChatBoxText('fail', 8, clBlack)) then
Case Random(2) of
0: begin;
Mouse(X, Y, 5, 5, True);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
1: begin;
Mouse(X, Y, 5, 5, False);
WaitOption('Open', 300);
Writeln('We clicked the chest');
Wait(8000+random(1000));
end;
end;
end;
begin
ActivateClient;
SetUpSRL;
repeat
OpenChest;
repeat
CheckFail;
until(FindChatBoxText('open', 7, clBlack)) or
(FindChatBoxText('open', 8, clBlack))
until(false)
end.If anyone has tips to make the script shorter it would be appreciated aswell.