Thread: Looping
View Single Post
  #20  
Old 12-21-2001, 11:44 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by cell424
Very True. while isnt the best thing to use when using a script. You would have to set a flag and then use while (flagname) {script here; } and when you dont want it to loop any more unset the flagname.
not really....
flag just means an event to call it.
NPC Code:

i=0;
while (i<10){
commands;
i++;
}



is same as
[code]
while (i=0;i<10;i++{
commands;
}
[/codes]

its just a lengthier version
same as

NPC Code:

if (i<10){
this.var=this.var+1;
}else this.var=0+1;


same as
NPC Code:

this.var=this.var%10+1;

Reply With Quote