mIRC Home    About    Download    Register    News    Help

Print Thread
#156451 16/08/06 03:07 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello

I want to do an action when a text appears in a prv query

how can I identify this:

Code:
 <space>what? 


thanks

#156452 16/08/06 03:47 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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:
Code:
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.
Code:
on $*:text:/^ what\?$/i:?:[color:green]{ do stuff here }[/color]


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#156453 16/08/06 07:41 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks

whats the regex for a single space, a questionmark, any digit, any letter etc?


Link Copied to Clipboard