on *:start: {
hmake qcount 10
if $exists(qcount.hsh) { .hload qcount qcount.hsh }
}
alias queryfilter {
if (!$1) || ($1 != $group(#queryfilter).status) {
$iif($group(#queryfilter) == off,.enable,.disable) #queryfilter
echo -a $iif($group(#queryfilter) == off,stopping query filter,starting query filter)
}
else echo -a Query filter is $group(#queryfilter).status}
}
menu * {
queryfilter
.on : queryfilter on
.off : queryfilter off
}
menu nicklist {
Query Approval .add : .approved add
.del : .approved del
}
alias approved {
if $1 == add {
var %a = 1
while %a <= $snick(#ftres,0) {
.hadd -m qcount $+(Approved.,$snick(#ftres,%a)) $snick(#ftres,%a)
inc %a
}
}
elseif $1 == del {
var %a = 1
while %a <= $snick(#ftres,0) {
hdel qcount $+(Approved.,$snick(#ftres,%a))
inc %a
}
}
}
#queryfilter off
on ^*:open:?:*: {
if ($nick !isreg #ftres) { msg $nick sup7 $nick }
elseif $hget(qcount,$+(Approved.,$nick)) == $nick {
.msg $nick $read(Approval.txt)
}
elseif ($me isop #ftres) && ($hget(qcount,$address($nick,3)) > 1 ) {
.hinc -m qcount $address($nick,3)
var %ban = $calc(60 * $hget(qcount,$address($nick,3)))
.ban -ku $+ %ban $nick 3 Couldn't read... could ya
}
else {
.hinc -m qcount $address($nick,3)
.msg $nick Don't msg ops/voices without permission. Repeat violators will be 4kicked/banned.
.timer 1 4 msg $nick Did you get that?
}
}
#queryfilter end
on *:EXIT: {
.hsave -o qcount qcount.hsh
}
on *:disconnect: {
.hsave -o qcount qcount.hsh
}