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
➜ Trigger Help
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Thu 11 Apr 2002 12:56 AM (UTC) |
Message
| I need help setting up a trigger, but my problem is the wildcards. heres an example:
Players near you:
Victory Entrance to Mud School
*Baron Victory* Entrance to Mud School
i need it to display the entire "*Baron Victory* Entrance to Mud School" with the "*" in it. i only need this for a spell called farsight. any ideas?
Vic | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 11 Apr 2002 02:10 AM (UTC) |
Message
| Regular expressions will come to your rescue here. :)
There is a file supplied with MUSHclient that describes them, however it can be a bit daunting. The problem, of course, is that an asterisk is a wildcard. In a regular expression you can "escape" it. To match the line you gave, do this:
Match on: ^\*Baron Victory\* Entrance to Mud School$
Regular expression: checked
The "^" means "start of line", the "$" means "end of line", and the "\*" means "literally an asterisk". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #2 on Thu 11 Apr 2002 02:52 AM (UTC) |
Message
| how would i make it say it in group talk (Gtell) and say the entire thing. Also the baron Victory and the location would have to be able to be diffrent though.. Theres more rooms than that one.. any way to change it there too?
Vic | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #3 on Thu 11 Apr 2002 03:34 AM (UTC) |
Message
| Ah OK, I didn't know exactly what you were trying to do.
To capture the name, you put it in brackets, then you can send the wildcard back. Like this:
Match on: ^\*(.+)\* (.+)$
Send: gtell I am at location %1
Regular expression: checked
In this case "(.+)" means "one or more of anything" - put into a wildcard. As there are two of them the first is wildcard 1, and the second wildcard 2.
By sending %1 to the MUD you are sending back wildcard 1. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 11 Apr 2002 03:34 AM (UTC) |
Message
| If you literally want to gtell the entire thing, try this:
Send: gtell %0
%0 is the entire matching line. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #5 on Thu 11 Apr 2002 03:41 AM (UTC) |
Message
| thanks. now to warn my groups that it'll say that on decoys too :-p
Vic | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #6 on Thu 11 Apr 2002 09:09 PM (UTC) |
Message
| is there a way to make it not send anything where they yell, or are in the room?
example:
*Baron Victory* yells 'Hey, what level are you?'
gtell '*Baron Victory* yells 'Hey, what level are you?''
you tell the group ' *Baron Victory* yells 'Hey, what level are you?''
and
*Baron Victory* is here
gtell *Baron Victory* is here
you tell the group '*Baron Victory* is here'
is there a way to stop the gtells in those strings?
Vic | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #7 on Thu 11 Apr 2002 11:57 PM (UTC) |
Message
| I thought your trigger might be a bit pervasive. :)
The simple way is to make three triggers, and sequence them (use the sequence field).
eg. something like this:
Trigger 1
Match on: ^\*(.+)\* yells (.*)$
Send: (nothing)
Regular expression: checked
Sequence: 80
Trigger 2
Match on: ^\*(.+)\* is here$
Send: (nothing)
Regular expression: checked
Sequence: 90
Trigger 3
Match on: ^\*(.+)\* (.+)$
Send: gtell %0
Regular expression: checked
Sequence: 100
The first two triggers (done first because of the sequence) "filter out" the yells and "is here" (by sending nothing). Then if the trigger doesn't match those two it reaches the 3rd one, which does the gtell. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #8 on Fri 12 Apr 2002 01:13 AM (UTC) |
Message
| thanks once again. If i come across anything else, i'll leave you a note.
-Vic | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #9 on Fri 12 Apr 2002 01:27 AM (UTC) |
Message
| boy, didn't take me long huh?
those set ups didn't seem to work, the
Match on: ^\*(.+)\* (.+)$
Send: gtell %0
Regular expression: checked
Sequence: 100
is still the dominate, overtaking the others you gave me. In my trigger list i've got about 30 triggers, don't think that'd have anything to do with it, but its some information. Is there any way to make it trigger on the "Players near you:" or use some short cut to turn the trigger on and off without going to the menu all the time? if worse comes to worse, i'll have to try and make a script, but then i'll have to learn to code first....
vic | Top |
|
Posted by
| Victory
USA (16 posts) Bio
|
Date
| Reply #10 on Fri 12 Apr 2002 01:31 AM (UTC) |
Message
| nevermind, i found it. forgot to enable the trigger..
oops
Vic | 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.
21,958 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top