Another way that would work would be to use regex.

Code:
ON $*:TEXT:/^!hi(\s\w+)?$/iS:#: {
  msg $chan hi $nick
}

The above says to trigger the script on either JUST "!hi" OR "!hi" followed by a SPACE \s followed by any number of word characters, numbers or underscores together \w+. The $ at the start simply means to use regex. The two /'s simply means that is what is to be evaluated. The ^ means that that is where the line has to begin (in this case, has to be begin with !hi). The ? in (\s\w+)? means that \s\w+ is optional. The \s means that it has to be a whitespace character (a space). The \w+ means that it has to be one or more word characters, numbers or underscores. The $ means that is where the line has to end. The i in iS means that it is case insensitive, and the S means to strip any mIRC codes from the message.

works: !hi
works: !hi there
works: !hi there_person13
doesn't work: !hithere
doesn't work: !hi $#@*
doesn't work: !hi there buddy

Last edited by Blas; 22/01/17 02:40 AM.