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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger help
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger help

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Assassin   (73 posts)  [Biography] bio
Date Fri 19 Mar 2004 12:22 AM (UTC)  quote  ]

Amended on Fri 19 Mar 2004 12:49 AM (UTC) by Assassin

Message
* the * * has just left

*>Bob the builder has just arrived
*>Bob the builder has just left

Its capturing *> and storing that to my variable.

How can i avoid this?

Also when im attacked by a dog

Output says You are attacked by the dog!

Again its storing ! along with dog, how can i stop this
too

[Go to top] top

Posted by Meerclar   USA  (603 posts)  [Biography] bio
Date Reply #1 on Fri 19 Mar 2004 06:12 AM (UTC)  quote  ]
Message
The easiest and most effective way is to make your triggers more precise. If you know the punctualtion will always be at the beginning or end of a line, modify the trigger to include the punctuation.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Nick Gammon   Australia  (19,631 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 19 Mar 2004 09:04 PM (UTC)  quote  ]
Message
Click on "convert to regular expression". For your example that gives this:


^(.*?) the (.*?) (.*?) has just left$


Then you can make it more precise. For example an optional thing like *> could be added at the start:


^(?:\*\>)?(.*?) the (.*?) (.*?) has just left$



The extra bit I added (in bold) looks for 0 or 1 occurrence of *>. I "escaped" them with a backslash because the * (at least) has a special meaning in regular expressions. The ?: at the start says to not make it a wildcard (so wildcard %1 is still the same thing).

Read up here:


http://www.gammon.com.au/mushclient/regexp.htm



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


2,186 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]