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
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Tue Aug 05, 2003 2:56 am   

random from string as variable?
 
Say I have a stringlist called targets with the names jon, sam, abe, lionel, jim. Then I have a stringlist called actions with at @target ca 'spellname' @target, at @target ca 'greater heal' @target, bolt @target. What I need to do, is take a random action and deal it to a random target, but my question is, should i leave @target inside of the actions stringlist? Is there a way to pick a random action to do to the random target, or should I change the way the 2 stringlists are.

I guess what I'm really asking is how do I pick a random action and apply it to a random person. I am curious how to insert the same target in the actions stringlist. Do I make any sense, because I can barely understand myself :)

T.I.A.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Aug 05, 2003 8:41 am   
 
%item( @actions, %random( 1, %numitems( @actions))) %item( @targets, %random( 1, %numitems( @targets)))
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