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


Joined: 14 Nov 2001
Posts: 27
Location: USA

PostPosted: Sat Aug 03, 2002 1:05 am   

Rotation in an Alias
 


I have a small understanding of variables and how they work in an alias.

I was curious if there was a way to make an alias that fires random items in a cycle

Example,

If I set an alias to F1 and I press F1 I'd like it to do the following

Fire Flame

then if I press F1 again

Fire Ice and so on ..

basically shooting preset variables in a certain order and when it reaches the end starts over from the first item.

Is this possible?

Thanks in advance

Sinema
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Aug 03, 2002 3:05 am   
 
#VAR Cycle {Fire Fire|Fire Ice|Fire Aire|Fire Earth|
#VAR CurrentCycle 1

#KEY F1 {%item(@Cycle,@CurrentCycle);#ADD CurrentCycle 1;#IF (@CurrentCycle > %numitems(@Cycle)) {#VAR CurrentCycle 1)}

Ton Diening
Reply with quote
Sinema
Beginner


Joined: 14 Nov 2001
Posts: 27
Location: USA

PostPosted: Sat Aug 03, 2002 10:08 pm   
 
Hi!

I appreciate the reply but was unable to get the below script to work correctly.

I closed

#VAR Cycle {Fire Fire|Fire Ice|Fire Aire|Fire Earth|

With a } because I thought it was missing one.

And when I did that.. It worked .. sorta.. if I were using Numbers 1-4

1 woudl fire.. skip 2.. 3 would fire.. and then it wouldn't repeat..

Did i copy it in wrong?


#VAR Cycle {Fire Fire|Fire Ice|Fire Aire|Fire Earth|
#VAR CurrentCycle 1

#KEY F1 {%item(@Cycle,@CurrentCycle);#ADD CurrentCycle 1;#IF (@CurrentCycle > %numitems(@Cycle)) {#VAR CurrentCycle 1)}


~
Regards,

Sinema
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 03, 2002 11:21 pm   
 
#KEY F1 {%item(@Cycle,@CurrentCycle);#ADD CurrentCycle 1;#IF (@CurrentCycle > %numitems(@Cycle)) {#VAR CurrentCycle 1}}
Reply with quote
Sinema
Beginner


Joined: 14 Nov 2001
Posts: 27
Location: USA

PostPosted: Sat Aug 03, 2002 11:55 pm   
 
Thanks for the reply !

I put the line in ..
~
Regards,

Sinema
Reply with quote
TheLemonHunter
Newbie


Joined: 07 Jul 2002
Posts: 5
Location: USA

PostPosted: Sun Aug 04, 2002 12:03 am   
 
i know this is probable frowned upon, and i am quite sorry, but if someone is reading this topic will they read my topic, it's called HELP, thankyou
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Aug 04, 2002 12:07 am   
 
You should take out the last | in the variable.
#VAR Cycle {Fire Fire|Fire Ice|Fire Aire|Fire Earth}


LightBulb
Senior Member
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Aug 04, 2002 5:24 am   
 
Wow I must have been baked. Sorry for the syntax mistakes causing confusion earlier!

Ton Diening
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