|
Evangelist Adept
Joined: 10 Oct 2000 Posts: 224 Location: USA
|
Posted: 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. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Aug 05, 2003 8:41 am |
%item( @actions, %random( 1, %numitems( @actions))) %item( @targets, %random( 1, %numitems( @targets)))
|
|
|
|
|
|
|
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
|
|