|
Alpha-Omega Newbie
Joined: 23 Jun 2008 Posts: 4
|
Posted: Mon Jun 23, 2008 6:30 am
Capture until next prompt. |
Greetings! I hail from achaea and i am having some problems with a trigger to capture names from a channel. The trigger may have more than 10-20 names, but the problem is that they may be on different lines.
The raw output from the mud is:
(Party): Someone says, "Enemies: Person1, Person2, Person3, Person4."
It may also be:
(Party): Someone says, "Enemies: Person1, Person2, Person3, Person4,
Person5, Person6, Person7."
(and maybe up to a third line).
So i figure out i would work a trigger to capture the names before the next prompt. How would i go about doing this?
I have (for one line):
~(Party~)~: Someone says, ~"Enemies~: (*)~, (*)~, (*)~, (*)~, (*)~, (*)~, (*)~, (*)~, (*)~, (*)~.~"
But as you can see it needs to have all spots filled for the trigger to match. I don't know how would i make it so it can match with a x number of people or lines.
Thanks in advance. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 23, 2008 9:44 am |
Firstly, don't use * when you mean %w. That trigger is going to take a long time to match. And are you always sure they're going to have that many enemies?
Secondly, see if there's an option to let you turn off server-side word wrapping. Some of the IRE MUDs let you do it and some don't - you normally need to set the line length preference to 0. |
|
|
|
Alpha-Omega Newbie
Joined: 23 Jun 2008 Posts: 4
|
Posted: Mon Jun 23, 2008 5:05 pm |
In this case, setting the length to 0 is not an option, so i have to rely on a few lines.
It's not a huge amount of words, it would be around 10 to 30 enemies. At the most the trigger would have three lines.
I assume i could use a #T- class on prompt, but i still don't know how to capture every single enemy and add them to a string list.
Help is appreciated, thank you. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Mon Jun 23, 2008 5:16 pm |
Code: |
#CLASS EnemyTriggers
#TRIGGER {^~(Party~)~: %w, ~"Enemies~: (*)$} {
#ADDITEM Enemies %replace(%replace(%replace(%replace(%1, ",", "|"), ".", ""), """, ""), " ", "")
#T+ EnemyTrigCaps}
#CLASS EnemyTrigCaps
#TRIGGER {^(*)$} {
#IF %1 {#ADDITEM Enemies %replace(%replace(%replace(%replace(%1, ",", "|"), ".", ""), """, ""), " ", "")} {#T- EnemyTrigCaps}}
|
This should work, but is completely untested.
Also it requires there be a blank line after the list of enemies. |
|
|
|
|
|
|
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
|
|