menu channel {
$iif($dialog(ident),$style(7)) Ident: { dialog -dmo ident ident }
}
dialog ident {
title "Idents"
size -1 -1 100 121
option dbu
list 1, 1 1 98 83, size sort
button "Add", 2, 18 91 30 9
button "Del", 3, 51 91 30 9
button "Close", 4, 3 109 95 9
}
alias ident {
return $remove($gettok($gettok($address($1,5),2,33),1,64),~)
}
On @*:Join:#:{
if ($ident($nick) == $read(ident.txt,w,$+(*,$nick,*))) { ban -ku120 $chan $nick 3 Ident $+($chr(2),$v1,$chr(2)) matched nickname $+($chr(2),$nick,$chr(2)) $+ . }
}
on 1:dialog:ident:init:*: {
if ($exists(ident.txt)) {
var %x = $lines(ident.txt)
while (%x) {
did -a ident 1 $read(ident.txt,%x)
dec %x
}
}
}
on 1:dialog:ident:sclick:1: {
set %ident.sel $did(1,$did(1).sel)
did -e ident 3
}
on 1:dialog:ident:sclick:2: {
dialog -n ident ident
set %ident.add $input(Enter nickname to add:,e,Add nickname)
did -a ident 1 %ident.add
write ident.txt %ident.add
dialog -o ident ident
}
on 1:dialog:ident:sclick:3: {
did -d ident 1 $did(ident,1).sel
write -dw $+("*,%ident.sel,*") ident.txt
did -b ident 3
}
on 1:dialog:ident:sclick:4: {
dialog -x ident ident
}
on 1:dialog:ident:close:*: {
unset %ident.*
}