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
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Thu Jun 09, 2005 1:44 pm   

Alarms in a loop
 
Hi,

Firstly, Thanks to Deathdealer for this script, which is 99% on the way to what I need to do.

The script gets the Unique ID's of a list of bombs, puts them into an array and lets me use one alias to set a timer on them all.

I would like to add an alarm into the loop to pause slightly in bewteen each timer set.

For example

set timer on bomb one
wait 1/2 second
set timer on bomb two
wait 1/2 second
set timer on bomb three
etc

DD pointed me in the direction of a post he had used before about this, but I still cant get it to work. Any help would be appreciated,

Script is:

#CLASS {BOMBS}
#ALIAS bang {
#LOOP 1,%numitems( @bombs) {timer bomb%item( @bombs, %i) %1}
#VARIABLE bombs {}
}
#VARIABLE bombs {}
#TRIGGER {^~"bomb(%d)~"} {#ADDITEM bombs {%1}}
#CLASS 0

I have tried putting both an #wa 500 and #alarm 500 in the loop line invarious places but no luck.

any ideas?


Cheers,

AS
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jun 09, 2005 4:47 pm   
 
Code:

#CLASS {BOMBS}
    #ALIAS bang {
        #SEND {timer %item(@bombs,1) %1}
        #LOOP 2,%numitems( @bombs) {#ALARM +%i*0.5 {#SEND timer %item(@bombs,%i) %1}}
        #VARIABLE bombs {}
    }
    #VARIABLE bombs {}
    #TRIGGER {^~"bomb(%d)~"} {#ADDITEM bombs {%1}}
#CLASS 0
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Thu Jun 09, 2005 4:55 pm   
 
You could Change:
Quote:

#LOOP 1,%numitems( @bombs) {timer bomb%item( @bombs, %i) %1}

to
Code:

#FORALL @bombs {timer bomb%i %1;#WAIT 500}
Reply with quote
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Thu Jun 09, 2005 7:44 pm   
 
Thanks guys.
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