|
Fuego Ledrey Wanderer
Joined: 09 May 2007 Posts: 64 Location: Dustin Acres, California
|
Posted: Thu May 17, 2007 6:27 pm
Random Illusions |
Ok, what I need is some code that will randomly select one of two statements (Maybe more) and send it to the MUD.
<Examples>
conjure @tar illusion You bleed 9999 health.
conjure @tar illusion You are dead and can not do that.
I need one of those two lines sent to the MUD in an alias. Thanks for your help! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 17, 2007 6:41 pm |
Easiest way is with a string list.
#additem IllusionList "whatever I want my illusion to be"
then to get them back out, you use %item(@IllusionList,%random(%numitems(@IllusionList))). So your code above would become
conjure @tar illusion %item(@IllusionList,%random(%numitems(@IllusionList))) |
|
|
|
Fuego Ledrey Wanderer
Joined: 09 May 2007 Posts: 64 Location: Dustin Acres, California
|
Posted: Thu May 17, 2007 6:44 pm |
Much appreciated!
Is there maybe a cleaner way? Less code, no variable? |
|
_________________ EDIT: Image moved to Avatar FINALLY. |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Thu May 17, 2007 8:36 pm |
This is the cleanest way to do it, unless you prefer to have many strings hard-coded into the aliases for conjuring the random illusions. I'd do it this way, though.
|
|
|
|
|
|