mIRC Home    About    Download    Register    News    Help

Print Thread
T
TillableToast
TillableToast
T
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

S
Sakana
Sakana
S
Add a ^ after the first /

^ indicates the beginning of the string

T
TillableToast
TillableToast
T
Thank you! It works perfectly now.
Do you know any good sites to learn about this?

S
Sakana
Sakana
S
This site is pretty good for trying out expressions or looking things up!

http://regexr.com/

Joined: Jul 2006
Posts: 4,022
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,022
To learn, http://www.regular-expressions.info/ is best, to try some pattern http://www.regex101.com is best


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard