|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Apr 22, 2012 2:47 am
Multiline capture too! |
For the life of me I cannot seem to properly capture multiline tells.
Code: |
Jimmy tells you: test test test test test test test
test test test test test test
Bob tells you: test test test test test test
test test test test
|
What is the proper way to capture a multiline tell where the 2nd+ lines have a different length of preceding whitespace such as my example above? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Apr 22, 2012 3:31 am |
I tend do find the minimum about it is going to be, then append %s to it, although technically, just %s will match it.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Apr 22, 2012 4:17 pm |
I have this:
Code: |
#TRIGGER {(*) tells you: (*)} {#CAPTURE ChatHistory}
#COND {(%s)(*)} {#CAPTURE ChatHistory}
|
But that isn't working for multiline. Also, how would I stop it from capturing once there is a character(or text) at the beginning without whitespace.
Also, trying to match this seems might it be tricky too:
Code: |
Angrybird tells you:
fyjopgrewfbnkogrsghkfeghumklgrcsgnkgdsghmkfsbjkforebjfsb
mkfsgnkogrsgnklgvdxgnkgrdsghkforsghmkfsgnkfsgnkfeghkfbjk
foresghmk
|
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Apr 22, 2012 4:34 pm |
First off, * is a pretty broad wildcard that matches any printable character, whitespace or not. If you can narrow the range of matchable characters with a different wildcard, it's much better to use that instead.
Second, you can use ^ and $ to anchor the pattern to the start of the line or the end of the line, respectively. ^(%s), for example, forces the pattern to only match on lines that start with whitespace. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Apr 22, 2012 4:52 pm |
so I changed it to
Code: |
#TRIGGER {(%w) tells you:(%s)(*)} {#CAPTURE ChatHistory}
#COND {^(%s)(*)} {#CAPTURE ChatHistory}
|
Code: |
Angrybird tells you:
fyjopgrewfbnkogrsghkfeghumklgrcsgnkgdsghmkfsbjkforebjfsb
mkfsgnkogrsgnklgvdxgnkgrdsghkforsghmkfsgnkfsgnkfeghkfbjk
foresghmk
Angrybird tells you: lol thats angry bird speak! or something :P
Newt tells you: This is a long tell to test something being told more than a
couple of lines. I am not sure why you have asked for this
but I am willing to comply. I hope it is sufficiently long
for your purposes.
|
and then ChatHistory shows this:
Code: |
Angrybird tells you: lol thats angry bird speak! or something :P
couple of lines. I am not sure why you have asked for this
|
Which isn't quite right as the 2nd line in teh ChatHistory is from the 3rd tell I received. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Apr 22, 2012 5:14 pm |
try setting the trigger type of the condition to within lines and the paramater to 1
also, add 'STATE 1' to the condition, so that when it does match, CMUD knows to check for another match |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Apr 22, 2012 5:56 pm |
where do I add those? I'm playing round in the Package Editor for the triggers and cant figure it out lol
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Apr 22, 2012 7:27 pm |
In the GUI, locate your trigger in the editor, you may need to click on a more at the bottom to see these options
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Gimli Beginner
Joined: 16 Oct 2005 Posts: 22 Location: Canada
|
Posted: Sun Apr 22, 2012 8:33 pm |
Found it thanks! works nicely now i think lol
|
|
|
|
|
|