
bind pub -|+v !helping helper:set   
bind join - * admin:check   
set schan "#kkll"  


proc helper:set {nick uhost hand channel txt} {
  global schan
  if {![botonchan $schan]} return
  switch [set mode [string tolower [lindex [split $txt] 0]]] {
    "on" {
      chattr $hand -|+v $schan;
      putserv "NOTICE $nick :Ti-ai setat statusul online."
    }
    "off" {
      chattr $hand -|-v $schan;
      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} {
global schan
  if {![botonchan $schan] || [isbotnick $nick] || ![string equal -nocase $chan $schan]} {return}
  if {![llength [set online [chanlist $chan -|+v]]] && [botonchan $schan]} {
    puthelp "NOTICE $nick :Currently no \002HELPER\002 online.";
    } else {
    puthelp "NOTICE $nick :\002TEAM\002 online: [join $online ","]";
  }
}