channel - #channel (use * for every channel)
method - privmsg or notice
admins and helpers information is gathered from eggdrop userlist
Admin flag are Channel n|m|o
Helper flag are Channel h|v
Exempt flag are b (only one flag)
Please report bugs and errors here.
- Code: Select all
namespace eval staff {
namespace eval variable {
variable trigger ".staff"
variable channel "#channel"
variable method "privmsg"
variable help "h|v"
variable admin "n|m|o"
variable exempt "b"
}
bind PUBM - "$::staff::variable::channel $::staff::variable::trigger*" [namespace current]::public
proc public {nickname hostname handle channel arg} {
if {![info exists nospam(variable.$channel)]} {
set nospam(variable.$channel) 1; utimer 20 [list unset -nocomplain nospam(variable.$channel)]
set admins ""
set helpers ""
foreach user [chanlist $channel $::staff::variable::admin] {
if {[exclude $admins $user]} {
lappend admins $user
}
}
foreach user [chanlist $channel $::staff::variable::help] {
if {[exclude $admins $user] == 1 && [exclude $helpers $user] == 1} {
lappend helpers $user
}
}
switch $::staff::variable::method {
privmsg {
if {[iswhat $admins]} {
putmsg $nickname "Admins: $admins"
}
if {[iswhat $helpers]} {
putmsg $nickname "Helpers: $helpers"
}
}
notice {
if {[iswhat $admins]} {
putnotc $nickname "Admins: $admins"
}
if {[iswhat $helpers]} {
putnotc $nickname "Helpers: $helpers"
}
}
}
}
}
proc iswhat {arg} {
if {[llength $arg] > 0} {
return 1
}
return 0
}
proc exclude {arg1 arg2} {
if {[lsearch $arg1 $arg2] != -1} { return 0 }
if {[string length $arg2] == 1} { return 0 }
if {[lsearch [split [chattr [nick2hand $arg2]] ""] $::staff::variable::exempt] != -1} { return 0 }
return 1
}
}