Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
zeiuszeppo
Novice


Joined: 22 Nov 2001
Posts: 48
Location: Italy

PostPosted: Thu Jan 24, 2002 1:16 am   

infinite loop
 
Hi friends , I meed to create an infinite
loop, exiting from it only if a certain
condition matches like che content of
a var (not a counter!!!)
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Thu Jan 24, 2002 1:57 am   
 
Well, do you want this loop to run immediately or do you want it to wait for certain text to loop again or what? Give us some more info, some output would be nice, maybe the variable you want to stop the loop on, etc.

Iljhar
Reply with quote
zeiuszeppo
Novice


Joined: 22 Nov 2001
Posts: 48
Location: Italy

PostPosted: Thu Jan 24, 2002 2:03 am   
 
well, the loop shoul start as aan alias,
and runs infinitely, until the var @STOP
is "TRUE" (suppose that it is "FALSE")
as the alias is typed
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Thu Jan 24, 2002 2:13 am   
 
Alias: Start =
#IF (@Stop = TRUE) {#NOOP} {#LOOP 1 *command to execute for varible being false*;start}

Try that.. tell me if it works

For tomarrow is another day, and other days come but 6 times a week.
Reply with quote
zeiuszeppo
Novice


Joined: 22 Nov 2001
Posts: 48
Location: Italy

PostPosted: Thu Jan 24, 2002 2:18 am   
 
Not this way, I made something similar, but after some time zmud crashes (overflow i suppose). I nedd a single loop
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 24, 2002 3:59 am   
 
#UNTIL (@stop) {do stuff}

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 24, 2002 6:35 pm   
 
To avoid overflow from a recursive loop, use a second alias. Each alias is able to complete its script, so it doesn't need to be stacked.

#AL loop1 {#IF (@stop) {} {do stuff;loop2}}
#AL loop2 loop1


LightBulb
All scripts untested unless otherwise noted
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 25, 2002 12:53 am   
 
Use either Kjata's suggestion or
#AL INFINITE {STOP=0;#WHILE (@STOP=0) {#NOOP}}

Lightbulb's will ultimately eat all your system memory and crash Zmud.
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Fri Jan 25, 2002 4:04 am   
 
Its fun when yer system's memory gets eaten and programs crash

For tomarrow is another day, and other days come but 6 times a week.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net