Results 1 to 9 of 9

Thread: Cant Figure Out How To Stop a Procedure

  1. #1
    Join Date
    Apr 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Cant Figure Out How To Stop a Procedure

    Ok.. When i run the script, and it gets to the "ExitAndLogOut" part... it runs the "ExitAndLogOut" Procedure, and then it resumes running This Procedure.

    How can i get it so that when it runs the "ExitAndLogOut" Procedure it also stops the "BuyRunes" procedure so that it does not resume it as soon as the "ExitAndLogOut" procedure ends?

    SCAR Code:
    Procedure ExitAndLogOut;Forward;

        Procedure BuyRunes;
          Begin
            Wait(1000+random(20))
          Repeat
            MoveMouseSmoothEx(585,230,30,40,500,45,10)
            Wait(200+random(20))
            ClickMouse(585,230,true)
            Wait(500+random(50))
            If ((GetColor(436,565)) = 0) Then
            Begin
            ExitAndLogOut;
            end else
            MoveMouseSmoothEx(585,230,30,40,500,45,10)
            Wait(100+random(20))
            ClickMouse(585,230,false)
            Wait(100+random(20))
            ChooseOption(x,y,'uy 10')
            RuneCounter := RuneCounter + 10;
            WriteLn('Bought ' + IntToStr(RuneCounter) + 'Runes')
            If (BodyCounter = (PlayerABTB)) Then
            Begin
            ExitAndLogOut;
            Terminatescript;
            end else
            Wait(50+random(5))
            Until ((GetColor(436,565)) = 0);
          End;

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Exit; stops the script...if thats what u mean
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by dan cardin View Post
    Exit; stops the script...if thats what u mean
    Actually, Exit; exits out of the procedure/function. Break; exits out of a loop, Exit; exits out of a procedure or function.

  4. #4
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Exit; does not stop the script. TerminateScript; stops the script. Exit; breaks out of a procedure (just like break; breaks out of a loop)
    Interested in C# and Electrical Engineering? This might interest you.

  5. #5
    Join Date
    Apr 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright Thanks A Lot

  6. #6
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    oooooooooooooooooooooooooooooooooooooooops........ ...
    im newby!!!!i completely got screwed up...i feel so stupid....meh...im over it
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  7. #7
    Join Date
    Mar 2007
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    We all have those day


    Someone: 'Who the hell is TooManySitUps?'

    Boreas: 'Switch the first and last letter of my name, what do you get?'

    Someone: 'Um, SoreAb?'

    Boreas: 'And how do you get that?'

    Someone: 'From Too Many Sit Ups!! Haha, Boreas you are so clever!'

    Boreas: 'Ya he's like my evil twin that takes over when I'm being really sarcastic, or playing devil's advocate.'

  8. #8
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    yes...but i still answered the question..how to exit out of a procedure
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  9. #9
    Join Date
    Oct 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    exit; ends procedure, but maybe take exit and logout out of the repeat loop.this procedure should be before or after your repeat,cause you are not repeating it.probably don't make much difference, but looks a lot cleaner. i dont't even see this procedure,but should not be in the repeat loop[.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can YOU figure it out??
    By Metagen in forum OSR Help
    Replies: 3
    Last Post: 10-07-2008, 06:44 PM
  2. Cant figure out a way to...
    By r3dr4g0n in forum OSR Help
    Replies: 8
    Last Post: 10-02-2007, 06:14 PM
  3. Should I (Yanix) Stop Make threads And Stop Post?
    By yanix in forum News and General
    Replies: 11
    Last Post: 08-31-2007, 09:10 PM

Posting Permissions

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