|
Kaset Newbie
Joined: 08 Feb 2003 Posts: 8 Location: USA
|
Posted: Sat Feb 08, 2003 3:35 pm
Help with Random script |
Ok, in the Mud I play, I have the ability to go incorpreal, evade away from opponents so they can't see me move, and conjure illusions.
I want a script that will randomly conjure an illusion in a direction found in a line that looks like this....
You see exits leading north (open door), east, south (open door), southwest
(open door), west (closed door), and northwest (open door).
HOWEVER. I need it so that it captures the look text of which exits are valid and then randoms those. Thats where I'm getting tripped up.
I think I'll need something akin to the following
#Var ql
#TRIGGER {You see exits leading %1, %2, and %3.} {#case %random {conjure
illusion A ghostly apparition disappears to the %1.}
But how to get the exits Into the variable or make sure that it uses valid exits is beyond me.
Any help would be most appreciated |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sat Feb 08, 2003 4:04 pm |
if you use the automapper, then a trigger using %roomexits() would be appropriate. Assuming no:
#tr {You see exits leading (*).} {
#var exitstring %replace( "%1", ",", "|")
i = 1
#forall @exitstring {
#if (%pos( "(closed door)", %i)) {#delnitem exitstring @i}
#add i 1
}
exitstring = %replace( @exitstring, "(open door)", "")
exitstring = %replace( @exitstring, "and", "")
exitstring = %replace( @exitstring, " ", "")
}
#alias runil {conjure illusion A ghostly apparition disappears to the %item( @exitstring, %random( 1, %numitems( @exitstring))).}
should work.
--note: Just leave the trigger on all the time, or disable it when you know you won't need it. When its on, the alias runil will create the correct string. When its off, the behaviour of the alias is undefined.
--------
moon.icebound.net:9000 |
|
|
|
|
|
|
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
|
|