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
➜ tricky trigger help
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Mon 27 Sep 2004 12:34 AM (UTC) Amended on Mon 27 Sep 2004 12:44 AM (UTC) by Jakevanderpuy
|
Message
| I'm trying to match on the following:
(A|An) @target (male|female) <wildcard2> in from the <wildcard3>.
My problem is that I don't know how to only partially match my target in this trigger. For example, let's say that the variable @target is currently set to "snow". I'd like to have the trigger match on "snow-pelted" as well.
Furthermore, I'd like this trigger to send "follow snow" to the world, and "o all bash snow" to the command line, and also highlight the text of the line on which the match was found.
Thus, if the world gives me:
A snow-pelted male centaur walks in from the east.
Then the client does the following:
Highlight line on which trigger matches. Send "follow @target" to world. Send "o all bash @target" to the command line.
Here's what I have so far:
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="(A|An) @target (male|female) (.*) in from the (.*). "
regexp="y"
send_to="2"
sequence="100"
>
<send>
send "follow @target"
wildcard 4 = %4
wildcard 5 = %5
</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Mon 27 Sep 2004 04:48 AM (UTC) |
Message
| ^(a|an) @target(.*) (male|female) (.*) in from the (.*)\.$
should work.
make sure you ignore case (itll be a lot less problematic in the long run). Also make sure expand variables are checked. (and change your color to whatever)
then you send to script:
send "follow @target"
setcommand "o all bash @target"
And that should do you.
Hardest part is tweaking the trigger to deal with all the little quirks of regexp. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #2 on Mon 27 Sep 2004 12:13 PM (UTC) |
Message
| That works really good, but is it possible to send a command to the world as well as to the command line? | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Mon 27 Sep 2004 03:20 PM (UTC) |
Message
| Send box:
send "follow @target"
setcommand "o all bash @target"
First line sends to world, second line sends to command.
Make sure you have "sendto:script" set. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #4 on Wed 29 Sep 2004 11:57 PM (UTC) Amended on Wed 29 Sep 2004 11:58 PM (UTC) by Jakevanderpuy
|
Message
| I find that I might have spoke too soon...my testing wasn't live and I still can't make it match on that reg exp, actually.
Been looking over the basic regular expression syntax and I can't find anything that'll do it, either. I think that it's going to require parsing the third wildcard (the adjective) for the @target variable, but I'm not entirely sure if that's what needs to be done, or even where to begin. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #5 on Thu 30 Sep 2004 01:06 AM (UTC) |
Message
| Post some examples of the match text.
Obviously your trigger is the problem, or one of them. So, lets see some examples.
Also, check for whitespace before or after the lines, as that can throw off your triggers. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #6 on Thu 30 Sep 2004 01:40 AM (UTC) Amended on Thu 30 Sep 2004 01:50 AM (UTC) by Jakevanderpuy
|
Message
|
[HP: 74%] [ME:100%] [PE:100%] [zero]
>>
A snow-pelted male centaur flies west.
[HP: 74%] [ME:100%] [PE:100%] [zero]
>>
A snow-pelted male centaur flies in from the west.
[HP: 74%] [ME:100%] [PE:100%] [zero]
>>
Suddenly a snow-pelted male centaur stabs you in the back!
That really did HURT!
You dodge a snow-pelted male centaur's attack.
[HP: 53%] [ME:100%] [PE:100%] [zero]
It looks like my prompt display is refreshed as things occur. The >> is the input line where I input commands. Perhaps this means that the trigger will have to be a multiline? I'm trying to match on the "A snow-pelted male centaur flies in from the west." line.
| Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #7 on Thu 30 Sep 2004 06:22 AM (UTC) Amended on Thu 30 Sep 2004 06:25 AM (UTC) by Flannel
|
Message
| Can you copy/paste the trigger you're currently using?
But no, you shouldnt have to do a multiline thing.
How about a few examples of whatever coming in? The thing you pasted was only one, so we could make a trigger that works for that one, but it might not work for anything else. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #8 on Thu 30 Sep 2004 08:35 PM (UTC) Amended on Fri 01 Oct 2004 04:23 AM (UTC) by Jakevanderpuy
|
Message
|
>>sta
You stop resting, and stand up.
[HP:100%] [ME: 21%] [PE:100%] zero
>>
A thin male deep-elf walks west.
A white-haired female deep-elf walks west.
You hear foot steps nearby.
[HP:100%] [ME: 21%] [PE:100%] zero
>>l thi
You do not see that here.
[HP:100%] [ME: 21%] [PE:100%] zero
>>
A thin male deep-elf walks in from the west.
A white-haired female deep-elf walks in from the west.
[HP:100%] [ME: 21%] [PE:100%] zero
>>nw
nw
------2nd Example-------
(HP: 75) (ME: 100) (PE: 9 (5 gold, 3 silver, 6 copper) (The Upper Landing)
>
A burly male centaur soars in from below.
A prude female elf soars in from below.
Gervais soars in from below.
The giant dragonfly soars in from below.
Baltus soars in from below.
(HP: 75) (ME: 100) (PE: 9 (5 gold, 3 silver, 6 copper) (The Upper Landing)
>
Xinyz soars in from the east.
A farmer soars in from the east.
A soft-spoken shaman soars in from the east.
A boulder bear soars in from the east.
(HP: 75) (ME: 100) (PE: 9 (5 gold, 3 silver, 6 copper) (The Upper Landing)
>
I'm just using the regular expression trigger that you posted. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #9 on Tue 05 Oct 2004 02:11 AM (UTC) |
Message
| You haven't done what Flannel requested. In the trigger list, select the relevant trigger, click the Copy button, and paste the resulting trigger here. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #10 on Tue 05 Oct 2004 04:41 AM (UTC) |
Message
| What would you set to match on, on each of those? (what would you target?)
Theres a few types of displays, even in your first example:
A thin male deep-elf walks west.
A white-haired female deep-elf walks west.
See how male is before, and female is after? Thats why the trigger I originally gave didnt work (but it would indeed work for the one example you gave)
So, youll need more than one trigger, or one trigger with multiple versions of match text.
And You dont need to show us anything except the messages about them coming in, for future reference.
But we can do that (the multiple versions) we're just going to need to know what you WANT to match with (whats in your target variable). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #11 on Tue 05 Oct 2004 05:46 PM (UTC) Amended on Tue 05 Oct 2004 05:57 PM (UTC) by Jakevanderpuy
|
Message
| <triggers>
<trigger
enabled="y"
ignore_case="y"
keep_evaluating="y"
match=" ^(A|An) @target(.*) (male|female) (.*) in from the (.*)\.$ "
regexp="y"
sequence="100"
>
<send>send "follow @target"
setcommand "o all bash @target"</send>
</trigger>
</triggers>
My target in this example is 'poor' without quotes.
>>
Target: poor
c 'magic missile' s poor
You start to concentrate.
[HP: 97%] [ME: 95%] [PE:100%] zero
>>
You utter the words, 'waouq wuggurz'.
You watch with pride as a flurry of magic missiles hits a poorly-dressed male human!
[HP: 97%] [ME: 95%] [PE:100%] zero
>>
A poorly-dressed male human walks in from the south.
A poorly-dressed male human misses an Uxmaln pack mule.
[HP: 97%] [ME: 95%] [PE:100%] zero
>>
A poorly-dressed male human's punch at an Uxmaln pack mule's left arm is deflected by fur hide.
[HP: 97%] [ME: 95%] [PE:100%] zero
>>
Still won't match on that.
| Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #12 on Tue 05 Oct 2004 07:20 PM (UTC) |
Message
| Somehow, I doubt very highly if poorly-dressed is a valid server side keyword for that mob. Regardless of what you attempt to do thru scripting, you are still bound by whatever keywords are assigned to a mob for targeting. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Jakevanderpuy
(22 posts) Bio
|
Date
| Reply #13 on Tue 05 Oct 2004 09:33 PM (UTC) |
Message
| Actually, poorly-dressed is a valid server-side keyword, but that's besides the point. I just can't match or partially match on the message the mud sends me when someone walks into the room I'm in. | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #14 on Tue 05 Oct 2004 11:05 PM (UTC) |
Message
| You might have to try and avoid the prompt's like i did in my mud.
My mud has *> and wouldnt fire unless i changed my
trigger to (?:\*\>)?trigger....
| 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.
50,005 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top