Code: Select all
proc pub:adduser {nick uhost hand chan text} {
set anick [lindex $text 0]
set nlist [countusers]
if {![matchattr $nick n|n $chan]} {
putserv "PRIVMSG $chan :ERROR: this is a botowner command."
return 0
}
if {![onchan $anick $chan]} {
putserv "PRIVMSG $chan :ERROR: $anick is not on $chan. aborting command."
return 0
}
if {$anick == ""} {
putserv "PRIVMSG $chan :ERROR: usage is !auser <handle/nick>."
return 0
}
if {[validuser $anick]} {
putserv "PRIVMSG $chan :ERROR: $anick is already in my userlist."
return 0
}
if {![validuser $anick]} {
adduser $anick
putserv "PRIVMSG $chan :$anick has been added to my userlist. i now have ($nlist) on my database."
return 0
}
putcmdlog "#$nick# added $nick on userlist"
}
by the way my purpose for this is for me to be able to add nicks on my botlist without having to dcc all the time. i just identity to the bot and i can add and del users on public command. some eggdrop begginers like me may find the code a bit usefull for their bots too i hope.