|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Tue Dec 22, 2009 1:00 am
Multiline capture failing |
Code: |
#TRIGGER {{you ask|you tell|asks you|tells you|secretly}*:} {:Tells: #SAYPROMPT {~[%time( yyyy/m/d - h:n:s~]) };#CAP Tells}
#COND {^(%s)%x} {#IF (%len( %1)>1) {#CAP Tells;#STATE 1}} {within|param=1} |
Now i made this in CMUD, and it works fine, but when i tried to recreate it in zMUD for a friend who has yet to upgrade, i find the same code doesnt work, And I am not sure why... can anyone see what I did wrong?
Code: |
You tell Friend: ignore this, i just need something long and wordy to test as to why this isn't capturing properly, perhaps i can get
it fixed if i figure out just how it is failing |
it seems to not recognize the whitespace as being longer than 1 char in length |
|
_________________ Discord: Shalimarwildcat |
|
|
|
ixy Novice
Joined: 18 Mar 2007 Posts: 39
|
Posted: Tue Dec 22, 2009 1:14 am |
try this, be sure to tick the perl regex box under the trigger box.
#regex {(you ask|you tell|asks you|tells you|secretly)\:(.+)} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Tue Dec 22, 2009 1:34 am |
Doesnt capture anything at all your way... mine at leas will capture the first line, if not any followup lines
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
ixy Novice
Joined: 18 Mar 2007 Posts: 39
|
Posted: Tue Dec 22, 2009 8:01 pm |
(you ask \w+|you tell \w+|\w+ asks you|\w+ tells you|secretly): (.+)
heh had to add another wild card to account for the player names but since im not sure on the actual out put lines from the mud ive had to guess ... not sure about secretly though.
The above trigger capped the examples i was able to echo to screen. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Dec 31, 2009 6:15 pm |
I have an example of the output in the second code block above showing a two line test tell i made for this purpose.
I have made a new trigger with your suggested pattern (you ask \w+|you tell \w+|\w+ asks you|\w+ tells you|secretly): (.+) with the regex box ticked and it still will not capture the second line. Capturing the first line was never the issue, I may not know regex but that part i had capturing just fine. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Dec 31, 2009 6:58 pm |
Heh, you're going to kick yourself for this one. Your script is still in the CMud style:
%len(%1) <--right for CMud, wrong for ZMud
%len("%1") <--wrong for CMud, right for ZMud
Your original code was running perfectly fine, but you didn't include a false condition with visible output and so you assumed it wasn't doing anything at all. One of the many tricks I learned as a ZMudder, where trigger/alias code can run right, wrong, or simply not at all. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|