SRL Archive - OSR Help

Loop problem.


dzpliu

2013-04-02 10:08:26

Procedure Catch;
begin
Bc:=false;
CurrentXP := GetXPBarTotal;
MarkTime(ObsTimer2);
//fromhere
if (findObjEx2(x,y,BText,BColor,BTol,340,MSX1, MSY1, MSX2, MSY2,DeadPixels ,deb2)) then
begin
MarkTime(ObsTimer);
if WaitUpTextMulti(['uby' ,'arv'],100 + random(200)) then
begin
WriteLn('Uptext Found,clicking..');
ClickMouse2(False);
if WaitOptionEx('atch', 'catch', ClickLeft, 250)then
Begin
WriteLn('Catching...');
Repeat
Wait(200 + Random(50));
until (CurrentXP <> GetXPBarTotal) or (TimeFromMark(ObsTimer) > 11000);
Writeln('caught and catching another...');[/B]
Bc:=true;
end;
//tohere
If (TimeFromMark(ObsTimer) > 11000) then//or (TimeFromMark(ObsTimer2)> 13000) then
begin
Writeln('took too long');
end;
end;
end else
if (TimeFromMark(ObsTimer2) > 7000) then ChangePos;
ClearTPA(DeadPixels);
If Debugcolor then Smart_ClearMS;
end;

how do i loop the part highlighted?
lets say,

findobjex2 succeeds in finding the object,
clicks the object,

how to make it repeat itself again? or any of you guys have better solution to the Repeat…Until (CurrentXP <> GetXPBarTotal) or (TimeFromMark(ObsTimer) > 11000); part for success detection?(caught)