; ----- your channel -----
alias -l teenchan { RETURN #TeenZone }
; ----- blacklisted channel names, separated by space, WITHOUT the chantype prefix -----
alias -l bannedchans { RETURN oldboys mature whathaveyou }
; ----- allowed nicknames, separated by space -----
alias -l allowednicks { RETURN statsbot silentangel }
; someone (not you) joins the channel and you're @
on @!*:join:$($teenchan): {
; nick is not allowed anyway
if (!$istok($allowednicks,$nick,32)) {
; basic flood-prevention (no more than 5 whois in 20 seconds):
; hash-table has less than 5 items atm
if ($hget(teencheck,0).item < 5) {
; add a random item for 20s to the flood-prevention hash-table
hadd -mu20 teencheck $rand(1,999999)
; whois the nick
!whois $nick
}
}
}
raw *:*: {
; raw reply is in the range 301-402 (this won't halt the display of ALL raw replies but of raws in the whois-reply-range)
; (you still won't see e.g. the default reply for a manual /whois or /names)
if ($numeric isnum 301-402) {
if ($numeric == 319) && ($2 ison $teenchan) && ($me isop $v2) && ($2 != $me) {
var %regex = $+(/,(?<=^|\40),$chr(40),[,$prefix,]?,[,$chantypes,],$chr(41),(?=\S+),/g)
var %cleaned = $regsubex($3-,%regex,$null), %n = 1
while ($gettok(%cleaned,%n,32)) {
if ($istok($bannedchans,$v1,32)) {
; ----- ban the user -----
mode $teenchan +bb $2 $address($2,2)
; ----- kick the user -----
kick $teenchan $2 This channel is for teens only
return
}
inc %n
}
}
haltdef
}
}