I used this code, which is almost exactly the same as yours, except the 'else' at the end has an open and close bracket (I wanted to make it look neater):
on ^*:TEXT:*:?:{
if ((%flood.protection) && (%flood.protection.query) && ($query(0) > %flood.protection.query.max)) {
close -m $nick
halt
}
if (!$query($nick)) {
query $nick
if ($comchan($nick,0)) {
var %nick.comchan, %i = 1
while ($comchan($nick,%i)) {
%nick.comchan = %nick.comchan $ifmatch
inc %i
}
echo -i2 $nick « Common channels with $nick $+ : %nick.comchan »
echo -i2 $nick < $+ $nick $+ > $1-
}
else {
echo -i2 $nick « Common channels with $nick $+ : none »
echo -i2 $nick < $+ $nick $+ > $1-
}
}
else {
echo -i2 $nick < $+ $nick $+ > $1-
haltdef
}
}
It does exactly the same as the other one.
I am an oper on another server and I used RootServ to make ChanServ PM me. It never said "< common channels with ChanServ: none >", it just showed ChanServ's message.
Dave.