[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]  Triggering with "maybe" variables
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

Triggering with "maybe" variables

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Posted by Codenoob   (1 post)  [Biography] bio
Date Thu 02 Feb 2012 12:33 AM (UTC)  quote  ]
I'm a complete noob when it comes to these sort of things, but I checked the forum and some other sites and I can't quite find the answer to my problem.

I have the following trigger thing set up:

* reports: */* hp.
if %2 < %3 then
world.Send "operate %1"

that's basically it in a nutshell. The problem begins at %1. If a player is named 'Bob' and the match is "Bob reports: 10/10 hp", then everything works fine. However, if it's "Bob, king of the jungle reports: 10/10 hp", the trigger doesn't work because it tries to operate on "Bob, king of the jungle", even though the only keyword that works is, and the only one needed is "Bob". Similarly, his name could be "King Bob of the jungle" in which case there is both a pretitle and a posttitle to work with.

I tried:
*, * reports: (but this doesn't work if it's just "Bob" without a comma)

I also tried:
** * reports: (but this doesn't work because mushclient doesn't allow adjacent wildcards like that)

So my question is... is there any way to write "(there might be something here) Bob (there might be something here) reports: 10/10 hp"?

It's so complicated to explain; sorry if it doesn't make much sense.
[Go to top] top

Posted by Nick Gammon   Australia  (19,667 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 02 Feb 2012 02:32 AM (UTC)  quote  ]
Have a look at this for a start:

Template:post=11510 Please see the forum thread: http://gammon.com.au/forum/?id=11510.

- 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.


It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.


Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]