Log in

View Full Version : Repeat procedure?



Footy
07-19-2012, 10:59 PM
Im working on a failsafe for my banking procedure in a script, and I want the script to try banking again if it cant find the uptext DTM, How do I do that? This is what I have so far.

Procedure Bank;
var
BankDTM:integer;
begin
BankDTM := DTMFromString('mbQAAAHicY2VgYPABYksgjgLiRCBWBmJHIH YBYmcobQ/EktePM0jdOA6mQVj4ynEGbIARCwYDAMlQC0U=');
Writeln('Time To Bank');
wait(randomrange(200, 300));
MMouse(259, 170, 4, 4);
wait(randomrange(200, 400));
if FindDTM(BankDTM, x, y, 1, 1, 1000, 1000) then
begin
Clickmouse2(1);
wait(randomrange(1500, 2000));
Mouse(583, 277, 2, 2, Mouse_right);
Chooseoption('ll')
wait(randomrange(400, 500));
Mouse(102, 159, 2, 2, Mouse_right);
wait(randomrange(300, 400));
Chooseoption('ll');
wait(randomrange(200, 400));
Mouse(490, 84, 2, 2, 1);
wait(randomrange(400, 600));
Fletched := Fletched + 28
end else
begin
Fails := Fails + 1
Retry Banking procedure???
end;

end;

Sin
07-19-2012, 11:07 PM
begin
Fails := Fails + 1
//Retry Banking procedure???
if Fails > X then
begin
Bank;
Fails := 0;
exit;
end;
end;

Footy
07-19-2012, 11:09 PM
Thanks! Ill try it now.

P1ng
07-20-2012, 12:40 AM
Currently using this with a FindChest function for finding a TPA of the rim of the SW bank chest
procedure POpenBank;
var
Counter: integer;
begin
Status('POpenBank');
SetAngle(SRL_ANGLE_HIGH);
repeat
Inc(Counter);
FFlag(0);
if FindChest or (not(LoggedIn)) or FindNormalRandoms or PinScreen or BankScreen then
Break;
until(Counter > 5);
end;

Then I have my WaitFuncs for InPin and BankScreen at the beginning of my next procedure. Not working as well as my banking pre-jagex-screwing-us-all-around, but working none the less.