Results 1 to 17 of 17

Thread: Loop

  1. #1
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Loop

    I need help with the loop please respond

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    you have to give wayyyy more information if you want any help.

  3. #3
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What loop. Just the generic loop? What do you want your loop to do? Have you even searched? There are a bunch of tutorials about repeat/until's.

    Basically

    SCAR Code:
    repeat
    {Code you want to repeat}
    until({Condition to stop at})

  4. #4
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Too open-ended... What type of loop?

    Theres Repeat or While, and to a lesser extent, For To Do

    Post Script/Explain what you need help with
    Project: Welcome To Rainbow

  5. #5
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well like im doing a spell and i want to loop for 250 times please show me

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    SCAR Code:
    repeat
      {Your code}
    until {a variable} = 250;

    That's the basic outline...

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    SCAR Code:
    program new;
    var
    i:integer;

    begin
      //for do loop
      For i := 1 to 250 do Writeln(IntToStr(i));
      //repeat until loop
      i := 1;
      repeat
        Writeln(IntToStr(i));
        Inc(i);
      until(I = 251);
    end.

  8. #8
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    to cast a spell you use CastSpell(Spell);

    so

    SCAR Code:
    program Spell250Times
    {.include srl/srl.scar} //this calls SRL to be loaded
    var
    x : Integer //This tells SCAR that x is an integer(1,2,3...)

    begin //This begins the code
    SetUpSRL; //Sets up SRL
    x:=0; //This is used as a counter
    repeat //This starts the loop
    x:= (x + 1) //This adds one to our counter
    CastSpell(Spell);
    until(x > 250); //When the counter gets to 250 it will stop
    end. //ends program

    So every time that the loop is repeated x gains one value from what it was before. The until statement checks if the counter/variable is at a certain value yet. If it is not then the script will return to repeat and go down. If it is at the value required then it will end the loop.

    Us a > or < because sometimes it messes up on the = and will just keep going.

  9. #9
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank yoou very much guys!

  10. #10
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what does 1 to 250 mean in the script cuz i put it in and it said not compiled so just give me an explanation of it and i will fix it up thanks

  11. #11
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Vytaliti View Post
    making it more complicated than it has to be..... but that's ok
    Could you please make a less complicated version for him...and me also. Because the one I made seems as simple as possible.?

    Ethan... If you would post the code you are trying to write it would help us help you.

    Make sure to use SCAR tags on code you post--> Go advanced and click the orange bulldozer and paste the script between the tags or between this "" without the quotes.

  12. #12
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nvm i got it and also when i got to thiis guide http://www.villavu.com/forum/showthr...hlight=chopper i click a link and it says dont have permission to acces this page please help

  13. #13
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That may be because you are only a registered user. You have to have your account be 7 days old before you become a Jr. Member. Then you should be able to access it. Although it is in the tutorial section and you should be able to view it.

  14. #14
    Join Date
    Dec 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    strange can you put the downloads up somewhere so i can download please i really need all of the scripts thanks

  15. #15
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you could use better grammar and punctuation we could help you better. Also if you would actually explain what you are talking about before we have to ask you to explain, it would be a big help.

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

    Default

    Quote Originally Posted by Aser View Post
    Us a > or < because sometimes it messes up on the = and will just keep going.
    Show me a case where it would mess up. It has never failed for me.

  17. #17
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Bullzeye, he's right, sorry I can't give you an example but it HAS messed up for me before and ended up in an infinite loop .

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. need for to do loop help
    By Raskolnikov in forum OSR Help
    Replies: 6
    Last Post: 07-02-2008, 03:21 AM
  2. Need help with Loop
    By Brenth in forum OSR Help
    Replies: 2
    Last Post: 12-31-2007, 05:35 PM
  3. Loop help?
    By Becks in forum OSR Help
    Replies: 3
    Last Post: 10-23-2007, 10:32 AM
  4. Help with loop
    By skullbr00d in forum OSR Help
    Replies: 0
    Last Post: 05-29-2007, 09:23 PM
  5. loop
    By macromacro123 in forum OSR Help
    Replies: 4
    Last Post: 03-18-2007, 07:50 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
  •