Code:
bind pub vfg|- !helper helper:set
bind pub m|- !admin admin:set
bind pub -|- !admini pub:admini
bind join - * admin:check
setudef flag admins
proc helper:set {nick uhost hand channel txt} {
if {![channel get $channel admins]} return
switch [set mode [string tolower [lindex [split $txt] 0]]] {
"on" {
chattr $hand +h;
putserv "NOTICE $nick :Ti-ai setat statusul online."
}
"off" {
chattr $hand -h;
putserv "NOTICE $nick :Ti-ai setat statusul offline."
}
default {
putserv "NOTICE $nick :Sorry, nu cunosc modul \002$mode\002, doar 'on' sau 'off'"
}
}
}
proc admin:set {nick uhost hand channel txt} {
if {![channel get $channel admins]} return
switch [set mode [string tolower [lindex [split $txt] 0]]] {
"on" {
chattr $hand +O;
putserv "NOTICE $nick :Ti-ai setat statusul online."
}
"off" {
chattr $hand -O;
putserv "NOTICE $nick :Ti-ai setat statusul offline."
}
default {
putserv "NOTICE $nick :Sorry, nu cunosc modul \002$mode\002, doar 'on' sau 'off'"
}
}
}
proc admin:check {nick uhost hand chan} {
if {![channel get $chan admins] || [isbotnick $nick]} return
if {![llength [set online [chanlist $chan vl-b|vl]]]} {
puthelp "NOTICE $nick :Momentan nici un \002HELPER\002 online / Currently no \002HELPER\002 online.";
} else {
puthelp "NOTICE $nick :\002HELPERI\002 online / Online \002HELPERS\002: [join $online ","]";
}
}
proc pub:admini {nick uhost hand chan txt} {
if {![channel get $chan admins] || [isbotnick $nick]} return
if {![llength [set online [chanlist $chan O|-]]]} {
puthelp "NOTICE $nick :Momentan nici un \002ADMIN\002 online / Currently no \002ADMINS\002 online.";
} else {
puthelp "NOTICE $nick :\002ADMINS\002 online / Online \002ADMINS\002: [join $online ","]";
}
}
Nu are haz sa folosesti 'userlist' si sa verifici printr-o bucla daca e pe canal sau nu cand ai direct 'chanlist' si iti face toate astea fara prea multe batai de cap.