'who' command help!

Posted by 99fender on Thu 03 Apr 2003 10:42 PM — 2 posts, 14,427 views.

#0
I need some help!

I would like someone to tell me how to do the following:

A client sends a message to one of my worlds, by typing:

wh Eneema Tell everyone Hey

This creates a trigger that runs a sub, which stores what they wrote after everyone in a variable. Then, the 'who' command is sent to the MUSH Window. Then the below statement is an example of what may return.

(* Current players: Evanu, Rice, MarcoMan, Tessera, The|Eneema, Eneema, Onua, Crayln, Xanphur, Rhowan, Mogrym, Blade|The|Hedgehog, Link182, Odyseey'Hyro.

I've specified the trigger expression for this to be:

^\(\* Current players: (.+)\.

Then it runs a sub.. Now, I want this sub to take everyone's name individually and send:

wh Evanu Hey
wh Rice Hey
wh MarcoMan Hey

etc.

The amount of players and names of players always differ!
I use PerlScript so only tell me awnsers in that! :P I'm sure its hardly difficult. Thankyou!

Australia Forum Administrator #1
I am not a great Perlscript expert, but you have the makings there. Just take the wildcard from the trigger (from the who list), and use the appropriate Perl function to split that on the commas (creating an array), and then loop through the array sending the message you want.