Are you talking about people specifically saying "
what?" (without the quotes)? If so, $1- cannot be used as the source of the text because it strips leading/trailing spaces. You should use $rawmsg in something like this:
on *:text:[color:red]*[/color]:?:{
if ($1 == what?) {
var %w = & & & : what?
if (%w iswm $rawmsg) [color:green]{ do stuff here }[/color]
}
}
Depending on the rest of your script, you may want to change the red * to something that contains "what", e.g. "* what?" This won't change the results but may speed up the script a bit and make some difference on huge channels.
Another way of doing it is with the $ event prefix. It's simpler but requires knowledge of regular expressions.
on $*:text:/^ what\?$/i:?:[color:green]{ do stuff here }[/color]