trigger matching one word only

Posted by Leeterat on Sun 27 Feb 2005 12:45 AM — 8 posts, 32,190 views.

#0
I need a trigger that will take first word from the 3rd line and send it to the mud. The 3rd line is not always the same and i can't use whole phrases that change. Only first words.

You say 'i'm hungry'.
Red Goddess speaks 'zzyuklaawy'.
Turkey suddenly materializes here.
>Fresh meat suddenly materializes here.
>Tasty friend chicken suddenly materializes here.

Then it sends to the mud

get Turkey
eat Turkey

(turkey or other, first word from 3rd line).

I'm thinking about it for three hours now and can't get it to work, please help
Russia #1
A regular expression such as:

^([A-Z][a-z]+)[a-z ]*? suddenly materializes here\.$

should work. %1 will be the word you need to send.
#2
the problem is also i need to get it triggered only when all three lines occur, not only last ;/
Russia #3
Then you'll need to do the usual:

1. an "hunger" alias enables the "You say 'i'm hungry'." trigger and a "*" trigger.
2. "You say 'i'm hungry'." trigger enables the "Red Goddess speaks ' zzyuklaawy'." trigger and disables itself.
3. The "Read Goddess speaks..." trigger enables the trigger for the third line and disables itself.
4. The third line trigger does what you need to do and disables itself.
5. A "*" trigger (sequenced to match after all other triggers above, for example all those triggers have a sequence of 99 and this one - 100), disables itself and all other triggers, which can be placed in a group for convenience.
#4
after reading it my eyes grew twice as normal.
One question only.
What ?
I think i'm a newbie after all
Greece #5
Make a multiline trigger that roughly matches on:

You say 'i'm hungry'.
Red Goddess speaks 'zzyuklaawy'.
* suddenly materializes here.

And make it send the wildcard. Would that work?
Amended on Mon 28 Feb 2005 11:00 AM by Poromenos
#6
won't.
1. Need to get only first word as wildcard.
2. Don't know why, but it doesn't want to trigger the second line
Russia #7
This _should_ work:

<triggers>
<trigger
enabled="y"
group="Multi Line"
lines_to_match="3"
keep_evaluating="y"
match="^You say 'i'm hungry'.\nRed Goddess speaks 'zzyuklaawy'.\n([A-Z][a-z]+)[a-z ]*? suddenly materializes here\.\Z"
multi_line="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%1</send>
</trigger>
</triggers>