SRL Archive - OSR Help

Reattempt after failures


Wire

2014-06-20 22:47:14

http://hastebin.com/nobaninohe.vhdl Do i need to add a repeat in order for this to reattempt until true? Do i need to add a repeat in order for this to reattempt until true? When i did add a repeat it wouldn't close the function to continue the main loop right.
function MillTalk: boolean;
begin
//repeat
Wait(1000+random(1000));
FindColorSpiralTolerance( x, y, 7510987, MSX1, MSY1, MSX2, MSY2, 2);
Wait(500+random(250));
MMouse(x, y, 2, 2);
Wait(500);
If IsUpText('wmil') then
begin
WriteLn('Found MillOperator');
Mouse(x, y, 2, 2, false)
WaitOption('pla',500);
Wait(500);
If FindColorSpiralTolerance(x, y, 5602200, MSX1, MSY1, MSX2, MSY2, 2) then
begin
Mouse(x, y, 2, 2, false);
WaitOption('All',500);
WriteLn('Converting Logs');

end else
Exit;

end else
Exit;

Result:= True;
//until true
end;

Frement

2014-06-20 23:01:10

MarkTime(MillTalkTimer);
repeat
Sleep(250);
until(MillTalk or TimeFromMark(MillTalkTimer) > 30000);

Will repeat MillTalk timer until it returns true, or when it has tried for 30 seconds.

Wire

2014-06-20 23:22:34

So all i was missing was
until result :=true?

Frement

2014-06-20 23:31:04

Well no, you have that code what I gave as an example, where you would call your MillTalk function.