Results 1 to 8 of 8

Thread: Break;

  1. #1
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Break;

    hi i saw this in alot of scripts. what this procedure is supposed to do? i saw it in chrams cutter he uses:

    if(not(LogeedIn))then Break;

    what it does?

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    SCAR Code:
    procedure Foo;
    begin
      for x:= 1 to 1000 do
      begin
       if x > 100 then Break;
      end;
      writeln('this message is displayed');
    end;

    procedure Bar;
    begin
      for x:= 1 to 1000 do
      begin
        if x > 100 then Exit;
      end;
      writeln('this message is NOT displayed');
    end;
    Break; breaks from a loop.
    Exit; exits a procedure or function.
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  3. #3
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wat u mean by break from a loop?

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

    Default

    It will quit the loop and go on with the procedure
    Interested in C# and Electrical Engineering? This might interest you.

  5. #5
    Join Date
    Oct 2006
    Location
    Texas
    Posts
    1,450
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Like this


    SCAR Code:
    Repeat
                Mouse(325,545,5,5,True);
               Until(False)
              End;
    it will click at that coord for ever or until the script is stopped.
    But if you log out it will keep clicking even though you not being logged in.

    now :
    SCAR Code:
    Repeat
                Mouse(325,545,5,5,True);
                 If(Not(LoggedIn)) Then Break;
               Until(False)
              End;

    If you get logged out then it will stop clicking.

    Hope that helps.

  6. #6
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    breaking from a loop means that the loop stops and the script continues with whatever comes after that. The first example stops the 'for' loop if x is over 100 and does the writeln.

    Exit actually exits the entire procedure, so the second example will exit the entire procedure if x is over 100, so the writeln will never be displayed.

  7. #7
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Buckleyindahouse View Post
    Like this


    SCAR Code:
    Repeat
                Mouse(325,545,5,5,True);
               Until(False)
              End;
    it will click at that coord for ever or until the script is stopped.
    But if you log out it will keep clicking even though you not being logged in.

    now :
    SCAR Code:
    Repeat
                Mouse(325,545,5,5,True);
                 If(Not(LoggedIn)) Then Break;
               Until(False)
              End;

    If you get logged out then it will stop clicking.

    Hope that helps.
    How the heck is he supposed to learn anything with those standards?

    Yeah, like they said, break; gets out of a "repeat..until; or a "for" or a "while..do" statement.

  8. #8
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if i do

    if (not(LoggedIn))then Break;

    at the begining of my walking and chpoing procedures it will skip it ? because i did Exit; and it doesnt work.

    so if i do that break thing at the begining of my walking choping banking procedures and at the end of the loop i do

    if(not(LoggedIn))then NextPlayer(False);

    will it works?

    before i did

    if(not(LoggedIn))then NextPlayer(False);

    at the begining of my procedure but the nextplayer when it logged did not restart the main loop it did log in to the next player but it started at the procedure where the past player was doing. like player 1 was choping then balloon random then logged out then next player loged in and was searching for yew. it did not restart the loop at the begining....so thats the prob when it logs out in my script

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. break?
    By faster789 in forum OSR Help
    Replies: 2
    Last Post: 03-31-2008, 03:11 AM
  2. break
    By jhildy in forum OSR Help
    Replies: 3
    Last Post: 08-10-2007, 05:47 PM
  3. Break here
    By break in forum News and General
    Replies: 1
    Last Post: 10-09-2006, 12:31 AM

Posting Permissions

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