[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  'who' command help!
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

'who' command help!

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


Posted by 99fender   (13 posts)  [Biography] 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!

[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] 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.


3,631 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]