|
Triggering with "maybe" variables
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Codenoob
(1 post) bio
|
| Date |
Thu 02 Feb 2012 12:33 AM (UTC) [ quote
] |
| Message |
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"
end
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. | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #1 on Thu 02 Feb 2012 02:32 AM (UTC) [ quote
] |
| Message |
Have a look at this for a start:
|
- 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.
566 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )