Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ VBscript
➜ trigger matching one word only
trigger matching one word only
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Leeterat
(4 posts) Bio
|
Date
| Sun 27 Feb 2005 12:45 AM (UTC) |
Message
| 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
| Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #1 on Sun 27 Feb 2005 03:53 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| Leeterat
(4 posts) Bio
|
Date
| Reply #2 on Sun 27 Feb 2005 11:03 PM (UTC) |
Message
| the problem is also i need to get it triggered only when all three lines occur, not only last ;/ | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #3 on Mon 28 Feb 2005 04:06 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| Leeterat
(4 posts) Bio
|
Date
| Reply #4 on Mon 28 Feb 2005 10:06 AM (UTC) |
Message
| after reading it my eyes grew twice as normal.
One question only.
What ?
I think i'm a newbie after all | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #5 on Mon 28 Feb 2005 10:31 AM (UTC) Amended on Mon 28 Feb 2005 11:00 AM (UTC) by Poromenos
|
Message
| 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? |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Leeterat
(4 posts) Bio
|
Date
| Reply #6 on Mon 28 Feb 2005 10:45 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #7 on Mon 28 Feb 2005 02:05 PM (UTC) |
Message
| 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>
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
23,028 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top