i have a simple lil script and i want it to restart the script back from the top whenever it encounters a problem. how can i do this?
I think you can't.
Problems are usually dealth with like: if Problem then DoThis or if Problem then Exit
Exit; will exit out of a procedure/function (so skip everything what follows on the procedure function) if I'm correct.
can you give me an example of
if Problem then DoThis?
Recursive
05-10-2012, 06:31 AM
IF you use smart manager, it will restart your scripts for you whenever it stops running
Download here http://villavu.com/forum/showthread.php?t=76404
EDIT: It seems you are trying to add a failsafe. Example of one will be :If you want a way to make the script return back to the end of it's path whenever it doesn't find something at it's destination, then you can just reverse the path and the bot will walk back. Basically the idea of failsafes is to make the script as flawless as possible; so since you say it is a simple script, simply call another function to check for something or do something then return to the original process.
Example of a good failsafe is this:
if not LoggedIn then Exit;
Another is:
DTM := DTMFromString('mWAAAAHicY2FgYNjGxMCwhQlCbwZiRkYGhj 9AcQ4g/R9IW1tbMRjqnmS4eMiT4fXrVwz8QDFkzISGQQAAddcLnQ==');
If FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(pX, pY, 5, 5);
ClickMouse2(True);
Repeat
Wait(17+Random(18));
Until(FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2));
If Not DTMInInvent then
FindNormalRandoms;
WithDTM;
end;
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.