[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  trigger matching one word only
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

trigger matching one word only

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Leeterat   (4 posts)  [Biography] 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
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] top

Posted by Leeterat   (4 posts)  [Biography] 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 ;/
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] top

Posted by Leeterat   (4 posts)  [Biography] 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
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Leeterat   (4 posts)  [Biography] 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
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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>
[Go to top] 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.


6,182 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]