#--------------------------------------------------------------------- # autovoiceforall.tcl # TCL script for IRC bot eggdrop # # Serve a voice mode (+v) to a nick joining one of the bots # channels with channelsetting -autovoice and channel mode +m. # # For this script to serve +v, the +autovoice/-autovoice setting of # the channel record in the bot for that channel must be set # to -autovoice. Eggdrop has its own actions in case of +autovoice. # And the channel mode of the channel must include +m. # # When flooders join a channel, to avoid serving them +v: # 1. add their host to the handle "novoice" (and kick them). # Nicks associated with this handle are not served a voice. # 2. or, on the fly switch the channel to +autovoice. With +autovoice # only handles with the +v flag on the bot are served a voice. # # v0: 14-Mar-2002 # v1: 29-Mar-2002 # - fix check of chanmode #--------------------------------------------------------------------- bind join - * autovoiceforall proc autovoiceforall { nick uhost hand chan } { # If channelsetting is +autovoice, omit this script... set chaninfo [channel info $chan] if {[lsearch -exact $chaninfo +autovoice] != -1} { return } # Channel mode must be +m # channel mode is in the form: +mode key limit # if no mode exists, channelmode is only "+" scan [getchanmode $chan] "%s %s %s" chanmode key limit if {![regexp "m" $chanmode]} { return } # checks on handle if {[validuser $hand]} { # If handle is "novoice": no voice. if {[string compare $hand "novoice"] == 0} { return } # user with +g flag should get +v served by the bot if {[matchattr $hand g]} { return } if {[matchchanattr $hand g $chan]} { return } } # no voicing if the bot doesn't have op if {![botisop $chan]} { return } # serve voice... puthelp "MODE $chan +v $nick" } putlog "Autovoice version 0 loaded."