Hi, I want my eggdrop bot to send a Notice message to ALL ops in a channel when anyone shouts !admin. I'm sure this must be doable, but it's beyond me.
The reason is I'm setting up our server reports to feed into IRC, so this will allow someone on the server to call for an admin by typing "/irc !admin" ingame . Neat eh .
# this is the channel where you want the script to work on
set ::admin(chan) "#channel"
bind pub -|- !admin pub:admin
proc pub:admin {nickname hostname handle channel text} {
if {[string match -nocase "$::admin(chan)" $channel]} {
foreach user [chanlist $channel] {
if {[isop $user $channel]} {
putserv "NOTICE $user :Admin request by $nickname in $channel."
}
}
}
}
Hi guys, im looking for a script that is very similar to this, but instead of NOTICE 'ing 1 user, could the script above be modified to output the ':Admin request by $nickname in $channel' into another IRC channel?
# this is the channel where you want the script to work on
set adminchan "#channel"
bind pub -|- !admin pub:admin
proc pub:admin {nickname hostname handle channel text} {
global adminchan; set list ""
if {[string equal -nocase $adminchan $channel]} {
foreach user [chanlist $channel] {
if {[isop $user $channel]} {
lappend list $user
}
}
if {[llength $list]} {
putserv "NOTICE [join $list ,] :Admin request by $nickname in $channel."
}
}
}
# this is the channel where you want the script to work on
set userchan #channel
# this is the channel the messages gets sent too.
set adminchan #channel2
bind pub -|- !admin pub:admin
proc pub:admin {nickname hostname handle channel text} {
global userchan adminchan; set list ""
if {[string equal -nocase $userchan $channel]} {
putserv "PRIVMSG $adminchan :Admin request by $nickname in $channel."
}
}
MeTroiD wrote:Improved since tosser's script will only use lots of messages for no good reason.
The only reason would be compatibility with all networks, since a few might have set max targets to 1. Its a pity eggdrop doesnt parse/save the init strings for purposes like max target lookup etc. ^-^. Theoretically you could dynamically limit the target number... but probably it is 1 or 20 and there will never be 20 admins only .