dialog nicklist {
title "Nick list"
size -1 -1 144 94
option dbu
list 1, 7 9 50 76, size
radio "On", 2, 90 23 20 10, group
radio "Off", 3, 90 34 22 10
text "Status", 4, 92 14 20 8
edit "", 5, 68 63 65 10
button "Add", 6, 68 75 29 12
button "Delete", 7, 103 75 30 12
text "Enter Nick", 8, 87 54 26 8
}
on *:start:{
if !$hget(nicklist) { .hmake nicklist 100 }
if $exists(nicklist.hsh) { .hload nicklist nicklist.hsh }
}
on *:exit:{
.hsave -o nicklist nicklist.hsh
}
on *:disconnect:{
.hsave -o nicklist nicklist.hsh
}
on *:dialog:nicklist:*:*:{
if $devent == init {
var %a = 1, %b = $hget(nicklist,0).item
while %a <= %b {
did -a $dname 1 $hget(nicklist,%a).item
.auser nick $nicklist($hget(nicklist,%a).item)
inc %a
}
did -b $dname 6,7
}
elseif $devent == edit && $did == 5 { did -e $dname 6,7 }
elseif $devent == sclick {
if $did == 1 { did -e $dname 7 }
elseif $did == 6 {
did -b $dname 6,7
if !$didwm($dname,1,$did(5)) { did -a $dname 1 $did(5) }
did -r $dname 5
.hadd -m nicklist $did(5) $nicklist($did(5))
.auser nick $nicklist($hget(nicklist,%a).item)
}
elseif $did == 7 {
if $did(1).sel {
.hdel nicklist $did(1).seltext
did -d $dname 1 $did(1).sel
.ruser nick $nicklist($did(1).seltext)
}
else {
.hdel nicklist $did(5)
did -r $dname 5
did -d $dname 1 $didwm($dname,1,$did(5))
.ruser nick $nicklist($did(5))
}
}
elseif $devent == dclick && $did == 1 {
.hdel nicklist $did(1).seltext
did -d $dname 1 $did(1).sel
.ruser nick $nicklist($did(1).seltext)
}
}
}
menu * {
Learn3r's nicklist : dialog $iif(!$dialog(nicklist),-md,-ev) nicklist nicklist
}
alias -l nicklist {
.enable #nicklist_who
.who $1
}
#nicklist_who off
raw 315:*:{
.disable #nicklist_who
haltdef
}
raw 352:{
return $4
haltdef
}
#nicklist_who end