mIRC Home    About    Download    Register    News    Help

Print Thread
Need help with an event trigger #257924 24/05/16 01:14 AM
Joined: May 2016
Posts: 50
T
TillableToast Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
I want it to only run the code when a users types "!<commandname>" which works but there seems to be a problem when somebody types a message containing a "!" it triggers

ex: "Hi there!" would trigger the text event.

Code:
on $*:TEXT:m/\!.*/iS:#:{

code to run...

}


Any help would be appreciated!

Kind Regards
TillableToast


Life is potato.
Re: Need help with an event trigger [Re: TillableToast] #257925 24/05/16 01:24 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Add a ^ after the first /

^ indicates the beginning of the string

Re: Need help with an event trigger [Re: Sakana] #257927 24/05/16 02:17 AM
Joined: May 2016
Posts: 50
T
TillableToast Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
Thank you! It works perfectly now.
Do you know any good sites to learn about this?


Life is potato.
Re: Need help with an event trigger [Re: TillableToast] #257928 24/05/16 02:26 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
This site is pretty good for trying out expressions or looking things up!

http://regexr.com/

Re: Need help with an event trigger [Re: TillableToast] #257930 24/05/16 12:10 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
To learn, http://www.regular-expressions.info/ is best, to try some pattern http://www.regex101.com is best


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net