Results 1 to 4 of 4

Thread: restarting script

  1. #1
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default restarting script

    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?

  2. #2
    Join Date
    Dec 2011
    Posts
    195
    Mentioned
    2 Post(s)
    Quoted
    17 Post(s)

    Default

    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.
    --- NexzAuto ---
    --- Simplicity is the ultimate sophistication. - Leonardo Da Vinci ---

  3. #3
    Join Date
    Dec 2011
    Posts
    183
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can you give me an example of
    if Problem then DoThis?

  4. #4
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    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:
    Simba Code:
    if not LoggedIn then Exit;

    Another is:
    Simba Code:
    DTM := DTMFromString('mWAAAAHicY2FgYNjGxMCwhQlCbwZiRkYGhj9AcQ4g/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;
    Last edited by Recursive; 05-10-2012 at 06:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •