Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ 'who' command help!

'who' command help!

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by 99fender   (13 posts)  Bio
Date Thu 03 Apr 2003 10:42 PM (UTC)
Message
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!

Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 03 Apr 2003 11:24 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,860 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.