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
smokin711
Newbie


Joined: 09 Dec 2003
Posts: 2

PostPosted: Tue Dec 09, 2003 3:14 am   

Help me with an alias please...the loop won't work
 
so I'm new to scripting with zmud and i'm trying to do the following:

setbomb 5

the above alias should set the timer on 5 bombs like this:

set 5.bomb 30
set 4.bomb 30
set 3.bomb 30
set 2.bomb 30
set 1.bomb 30


this is what i got:

@test = %1

#LOOP %1 {
set <@test>.nuke 30
#MATH @test {@test - 1}
}

but this dosn't work. For some reason the math stament is incorrect and @test value always stays the same as it is intially.

can anyone help?
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Tue Dec 09, 2003 3:48 am   
 
Try this.

alias:
setbomb

Value:
#LOOP 1,%1 {set %{i}.bomb 30}

%1 represents the numeric after setbomb when you type the alias (ex: setbomb 5). %{i} represents the loop range (number of times to loop.

This is found in the help section for #LOOP
Type:
setbomb 5


set 1.bomb 30
set 2.bomb 30
set 3.bomb 30
set 4.bomb 30
set 5.bomb 30


tested offline with 6.66, using alias: setbomb
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