I need help with the loop please respond
I need help with the loop please respond
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})
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
Well like im doing a spell and i want to loop for 250 times please show me
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.
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.
RimmReaper! | Account maker! | HP Above Heads! | Full Karamja Fisher! | Reflection AutoUpdater!
Feel free to contact me on MSN @
franher007@hotmail.com
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.
thank yoou very much guys!
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
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.
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
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.
strange can you put the downloads up somewhere so i can download please i really need all of the scripts thanks
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.




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.
There are currently 1 users browsing this thread. (0 members and 1 guests)