Unknown2007-01-22 20:24:33
I have what seems like a very simple task for ZMUD, but for some reason can't get it to work. I'm befuddled by this to no ends. Here's the code:
I also tried this (actually tried this one first) :
Either way, if I use the test pattren of :
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan 1 times.
The test comes back true, and it shows %1 as 1, as it should. However, if I recieve the text from the mud, it doesn't fire. I have my CONFIG WRAPWIDTH set to long enough that I get it all on one line, so it's not that there's a problem with multiline triggers or anything. I can't for the life of me think of why this isn't working.
Edit: oh and I just realized that the first soulless in my i_warning call was mispelled, but that wont have any effect on whether the pattern fires or not.
CODE
#trigger {^You sniff the card of the Soulless, and sense it has been imprinted upon %w (%d)} {#var rubs %1;#if @rubs=7 {i_warning SOULESS SOULLESS SOULLESS} {i_alert @rubs RUBS}}
I also tried this (actually tried this one first) :
CODE
#trigger {^You sniff the card of the Soulless, and sense it has been imprinted upon %w &%drubs} {#if @rubs=7 {i_warning SOULESS SOULLESS SOULLESS} {i_alert @rubs RUBS}}
Either way, if I use the test pattren of :
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan 1 times.
The test comes back true, and it shows %1 as 1, as it should. However, if I recieve the text from the mud, it doesn't fire. I have my CONFIG WRAPWIDTH set to long enough that I get it all on one line, so it's not that there's a problem with multiline triggers or anything. I can't for the life of me think of why this isn't working.
Edit: oh and I just realized that the first soulless in my i_warning call was mispelled, but that wont have any effect on whether the pattern fires or not.
Unknown2007-01-22 20:58:45
I see no real error in this script, especially if you say it works in an offline test.
As a side note, don't use a wrapwidth other than 80 with Palisade or you'll have some troubles with multi-line messages.
As a side note, don't use a wrapwidth other than 80 with Palisade or you'll have some troubles with multi-line messages.
Unknown2007-01-22 23:52:55
Hmm, ok, I'll have to put it back to 80. On that same note, how would I do a multiline trigger in ZMUD in the case of the above? Not that it's any more likely to work like that...
If Zarquan doesn't know what is up with this trigger I'm seriously baffled! Anyone else have an insight?
If Zarquan doesn't know what is up with this trigger I'm seriously baffled! Anyone else have an insight?
Daganev2007-01-23 00:23:51
I am assuming you have this in the gui. If so , check your "on prompt' or "newline" trigger boxes.
Unknown2007-01-23 04:57:42
Yeah Daganev, that worked.
Now since I had to change my wrapwidth back to 80 now it's a multiline trigger and won't fire because of that. Any help, anyone? And the spot the newline appears will depend on the length of the name, I think
Edit: Oh I found it on another post in the forum, multiline triggers need to be done with REGEX, which I hardly understand (if that), so I got it working now....well sorta. Another problem just popped up, the trigger fires now, but when the trigger fires with this:
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan 2 times.
I get this:
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
Sometimes there's less lines than that in there, but I've never seen more than that.
Now since I had to change my wrapwidth back to 80 now it's a multiline trigger and won't fire because of that. Any help, anyone? And the spot the newline appears will depend on the length of the name, I think
Edit: Oh I found it on another post in the forum, multiline triggers need to be done with REGEX, which I hardly understand (if that), so I got it working now....well sorta. Another problem just popped up, the trigger fires now, but when the trigger fires with this:
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan 2 times.
I get this:
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
: 2 RUBS
Sometimes there's less lines than that in there, but I've never seen more than that.
Unknown2007-01-23 12:05:02
Multi-line (multi-state) triggers don't have to use regex. Did you get the repeating echo because you made a multi-state version? Or is that because you're using the prompt/nocr options now? When the message wraps, what does it look like?
Unknown2007-01-23 16:00:23
here's the trigger as it appears in the GUI:
The wrap looks like this:
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan
2 times.
After reading your post I changed the options around and after unchecking trigger on trigger, if I do:
#say {You sniff the card of the Soulless, and sense it has been imprinted upon Talkan};#say {5 times.}
I get the desired results, but I have yet to test it on actual text from the mud, but it should work.
CODE
pattern:(regex checked)
You sniff the card of the Soulless, and sense it has been( | ?\\n)imprinted( | ?\\n)upon( | ?\\n)\\w*( | ?\\n)(?rubs:\\d+)( | ?\\n)times.
value:
#if (@rubs=7) {i_warning SOULLESS SOULLESS SOULLESS} {i_alert @rubs RUBS}
options:
newline and trigger on trigger are checked, param 0, Type=Pattern
You sniff the card of the Soulless, and sense it has been( | ?\\n)imprinted( | ?\\n)upon( | ?\\n)\\w*( | ?\\n)(?rubs:\\d+)( | ?\\n)times.
value:
#if (@rubs=7) {i_warning SOULLESS SOULLESS SOULLESS} {i_alert @rubs RUBS}
options:
newline and trigger on trigger are checked, param 0, Type=Pattern
The wrap looks like this:
You sniff the card of the Soulless, and sense it has been imprinted upon Talkan
2 times.
After reading your post I changed the options around and after unchecking trigger on trigger, if I do:
#say {You sniff the card of the Soulless, and sense it has been imprinted upon Talkan};#say {5 times.}
I get the desired results, but I have yet to test it on actual text from the mud, but it should work.
Unknown2007-01-24 12:06:56
I would recommend against using optional newline/space patterns in a trigger like this. You'll see odd side effects with it firing multiple times. It's better to chop parts of the trigger out and use partial matches only.
The downside to this approach is that the person's name may be too long and wrap around. You're better off making a second trigger with the name in the #COND then, rather than trying to finagle one trigger to match both cases.
CODE
#REGEX {^You sniff the card of the Soulless\\, and sense it has been imprinted upon (+)} {}
#COND {(\\d+) times\\.$} {soulless_name = %t1;rubs = %1;#IF (@rubs == 7) {i_warning SOULLESS SOULLESS SOULLESS ON @soulless_name} {i_alert @rubs RUBS ON @soulless_name}} {regex|within|param=1}
#COND {(\\d+) times\\.$} {soulless_name = %t1;rubs = %1;#IF (@rubs == 7) {i_warning SOULLESS SOULLESS SOULLESS ON @soulless_name} {i_alert @rubs RUBS ON @soulless_name}} {regex|within|param=1}
The downside to this approach is that the person's name may be too long and wrap around. You're better off making a second trigger with the name in the #COND then, rather than trying to finagle one trigger to match both cases.
Unknown2007-01-24 20:07:56
I'm not too familiar with using trigger states, so I'm probably wrong about this, since Zarquan is the Coder Genius, but doesn't %t1 refer to the first param captured by the #COND? If so, wouldn't (\\d+) be %t1 instead of (+), which would just be %1? Or is it that %t1 refers to something one "scope" higher, IE the original trigger pattern as opposed to the #COND?
Edit: This is unrelated, but it seemed as good a place as any to post it. With Palisade, I'm getting some weird MCCP errors ocassionally, usually when I arrive at or LOOK at the room where the Pool of Stars is.
Edit: This is unrelated, but it seemed as good a place as any to post it. With Palisade, I'm getting some weird MCCP errors ocassionally, usually when I arrive at or LOOK at the room where the Pool of Stars is.
Unknown2007-01-25 21:01:22
%t1..%t99 refers to captured results from previous states. %1..%99 refers to captured results for the current state only.
I'd recommend disabling MCCP. zMUD has problems with it sometimes, especially in terminating the connection and showing the last few lines of text (which many don't even notice are missing).
I'd recommend disabling MCCP. zMUD has problems with it sometimes, especially in terminating the connection and showing the last few lines of text (which many don't even notice are missing).
Unknown2007-01-25 21:15:21
QUOTE(Zarquan @ Jan 25 2007, 01:02 PM) 377329
%t1..%t99 refers to captured results from previous states. %1..%99 refers to captured results for the current state only.
I'd recommend disabling MCCP. zMUD has problems with it sometimes, especially in terminating the connection and showing the last few lines of text (which many don't even notice are missing).
I'd recommend disabling MCCP. zMUD has problems with it sometimes, especially in terminating the connection and showing the last few lines of text (which many don't even notice are missing).
Gotcha, the help file made it sound like it was the other way around.