Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
ixy
Novice


Joined: 18 Mar 2007
Posts: 39

PostPosted: 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)\:(.+)}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
ixy
Novice


Joined: 18 Mar 2007
Posts: 39

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net