Register forum user name Search FAQ

Gammon Forum

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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Excluding a name from a trigger.

Excluding a name from a trigger.

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


Posted by Scarn   (47 posts)  Bio
Date Fri 12 Mar 2010 01:57 PM (UTC)
Message
I know there is a VB function for this, but cannot find it.

Basicly I have a reply trigger set up so when someone sends me a tell it adds the name to a variable.

eg.

Scarn tells you: Hello.

I think type "r Heya."

The problem I am having is auctioneers also use the tell system and its pretty spammy, a lot of times in mid converstaion with someone an auctioneer will send me a tell and I will have to type the players name.

How can I exclude a name from the trigger?

For example if "Alexa tells you: Blah for sale!" I want Alexa NOT to be added to the variable.

Thanks,

Scarn.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 12 Mar 2010 07:25 PM (UTC)
Message
Since you are adding to a variable I presume you are already scripting? So just test in the script, eg.


if string.match ("%0", "^%a+ tells you, .* for sale!$") then
  return
end


Or even:


if string.match ("%0", "tells you, .* for sale!") then
  return
end


Sorry, that isn't VBscript. Well you could do something similar. Or switch to Lua. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Scarn   (47 posts)  Bio
Date Reply #2 on Wed 17 Mar 2010 02:13 PM (UTC)
Message
Gah, I refuse to learn Lua - took me long enough to get to grips with VB. :P

This is my trigger.

Upon seeing "Someone tells you: Something"

I return:

setvariable "Reply", "%1"

I remember there being a function that was something like

*(!Alexa|John) tells you: *

that would stop Alexa/John from being added to the variable?

Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 17 Mar 2010 07:58 PM (UTC)
Message
Template:post=5089 Please see the forum thread: http://gammon.com.au/forum/?id=5089.


Scroll down to "negative lookbehind assertions".

- Nick Gammon

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


18,293 views.

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

Go to topic:           Search the forum


[Go to top] top

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