About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Delrayne
Beginner


Joined: 01 Feb 2008
Posts: 16

PostPosted: Tue Jun 10, 2008 11:06 pm   

Using %random in an alias
 
Ok, so I have an alias like so:

#alias {throwdarts}
#var rtoxin1 %item( @toxins1, %random( 7, 0))
#var rtoxin2 %item( @toxins2, %random( 7, 0))
dart select @rtoxin1
dart backup @rtoxin2
twinshot @target


Ok, so @toxins1 and @toxins2 both have a list of 7 different toxins I can throw darts with. I'm wanting it to choose randomly from those to lists and place it in the @rtoxin1 and @rtoxin2 variable so I can select said toxin then shoot. Thanks ahead for any help.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Jun 11, 2008 1:32 pm   
 
Change the 7, 0 to 1, 7 instead. If you only use the rtoxins within this alias you can skip setting a variable and go direct.

#alias {throwdarts} {
dart select %item(@toxins1, %random(1, 7))
dart backup %item(@toxins2, %random(1, 7))
twinshot @target}
_________________
Taz :)
Reply with quote
Delrayne
Beginner


Joined: 01 Feb 2008
Posts: 16

PostPosted: Thu Jun 12, 2008 2:53 am   
 
Thanks for help, works like a charm now. I originally had it working off the random alone without the extra variables, but I couldn't get it to work and went that route. I new something was up, when I had it coded right. Never thought to switch the numbers though.
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