|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Sun May 25, 2003 9:56 pm
how to fire a trigger more than once per line |
Hi,
I wonder, if it's possible to let a trigger fire more than once per line.
I need to count all words in a line which begin with a capital.
eg. "This Is a Testline" would give 3 capitalized words.
But my trigger just fires once per line and I always get "1".
#TRIGGER {([A-Z][a-z])} {#ADD count 1} "" {case} |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun May 25, 2003 10:05 pm |
No, you can't do it except for some very specific triggers, involving some very specific comamnds. You are going to have to match the entire line and then parse the line to count how many words begin with a capital letter.
Kjata |
|
|
|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Sun May 25, 2003 10:28 pm |
Thank you for your answer, Kjata
I understand .. how do I parse the line then?
I tried the "reparse" option but it fires also once a line only.
#TRIGGER {([A-Z][a-z])} {}
#COND {([A-Z][a-z])} {#ADD count 1} {reparse}
Any Idias? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon May 26, 2003 3:30 am |
quote:
Thank you for your answer, Kjata
I understand .. how do I parse the line then?
I tried the "reparse" option but it fires also once a line only.
#TRIGGER {([A-Z][a-z])} {}
#COND {([A-Z][a-z])} {#ADD count 1} {reparse}
Any Idias?
You don't need a multiple-state trigger for this. Just match the entire line and surround the entire thing in (). Then do something like this for the code:
#Forall %replace(%1," ","|") {#if (%i=%proper(%i)) {#add UpperCase 1} {#noop this is not a capitalized word}}
li'l shmoe of Dragon's Gate MUD |
|
|
|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Mon May 26, 2003 11:11 am |
that sounds like a possible solution, gonna try it that way
thank you, MattLofton!! |
|
|
|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Mon May 26, 2003 6:58 pm |
Another Question: this trigger works perfectly if, but it parses only the first line?
Zmud seems to throw lines away if they are coming to fast? right?
#TRIGGER {(*[A-Z][a-z]*)} {#FORALL %replace( %1, " ", "|") {#if (%i=%proper( %i)) { #ADDI SubList %i} {}}} "" {case|notrig} |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue May 27, 2003 12:18 pm |
This is already answered in the other thread you made about this just 30 minutes after posting this reply here, but use the #PRIORITY command.
Kjata |
|
|
|
|
|