Results 1 to 10 of 10

Thread: Continuous Loop?

  1. #1
    Join Date
    Mar 2013
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    127 Post(s)

    Default Continuous Loop?

    Is there to make a procedure run on the side of things constantly?

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Read Coh3n's beginner tutorial guide: check the loop section.

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Mar 2013
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    127 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Read Coh3n's beginner tutorial guide: check the loop section.
    I've read it, but the thing i'm asking isn't on there.


    Is it possible to have something looping continuously while the main loop is going?

    IE. Have 2 loops going at once.

  4. #4
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Simba Code:
    while IsChopping; do
    Antiban;

    Something like this?

    EDIT: if u explain what it needs to do, I'm sure someone here on this forum knows the answer.

    Creds to DannyRS for this wonderful sig!

  5. #5
    Join Date
    Mar 2013
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    127 Post(s)

    Default

    Well I mean something like this:

    program Example;


    procedure update;
    begin;
    writeln('See what I'm doing here?');
    end;
    procedure otherThing;
    begin
    //do stuff
    end;

    procedure otherThing2;
    begin
    //do stuff
    end;


    begin
    do
    update;
    while
    doThings;
    doThings2;
    end.



    If you understand that.

    Like have the Update method constantly running, while the other things can loop through like normal.

  6. #6
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brid Mayhem View Post
    Well I mean something like this:

    program Example;


    procedure update;
    begin;
    writeln('See what I'm doing here?');
    end;
    procedure otherThing;
    begin
    //do stuff
    end;

    procedure otherThing2;
    begin
    //do stuff
    end;


    begin
    do
    update;
    while
    doThings;
    doThings2;
    end.



    If you understand that.

    Like have the Update method constantly running, while the other things can loop through like normal.
    Don't know if this will work since I don't use while..do loops often.

    There's probably a better way, but what about making doThings; and doThings2; in one function
    (example: DoThingsAll; ) and use:

    Simba Code:
    While (DoThingsAll = True) do
    Update;

    Should work I guess

    Creds to DannyRS for this wonderful sig!

  7. #7
    Join Date
    Mar 2013
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    127 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Don't know if this will work since I don't use while..do loops often.

    There's probably a better way, but what about making doThings; and doThings2; in one function
    (example: DoThingsAll and use:

    Simba Code:
    While (DoThingsAll = True) do
    Update;

    Should work I guess
    I think that's just a selective loop though, like how you can set DoAllThings to check if the inventory is true, so the 'update;' would only happen when the inventory is full and not constantly

    Well, thanks for helping anyways

  8. #8
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Search for multithreading on the forums, there are quite a few topics on this.
    http://villavu.com/forum/showthread....ghlight=thread

    In most cases it is not required to deploy multithreading for RS scripts since you can just check several conditions linearly (procedural).
    Last edited by riwu; 03-09-2013 at 11:40 AM.

  9. #9
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    i dont know if this will help but in my fletcher i have aloop that constantly checks for level up and if the bot is in the area it is done like this
    Simba Code:
    repeat
    wait(100)
    checkuplevel;
    if containslevel then
    begin
      mainloop;
      exit;
    end;

  10. #10
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by Brid Mayhem View Post
    Well I mean something like this:

    program Example;


    procedure update;
    begin;
    writeln('See what I'm doing here?');
    end;
    procedure otherThing;
    begin
    //do stuff
    end;

    procedure otherThing2;
    begin
    //do stuff
    end;


    begin
    do
    update;
    while
    doThings;
    doThings2;
    end.



    If you understand that.

    Like have the Update method constantly running, while the other things can loop through like normal.
    No, there is no multithreading in Simba. But as others have said, you can do things procedurally for a similar effect.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

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
  •