#--------------------------------------------------------------------- # dalnetneedop.tcl # TCL script for IRC bot eggdrop # # This scripts attempts to keep the bot opped on the dalnet channels # the bot monitors. # The bot must be able to get operator status on each channel # through chanserv. # # v0: 15-May-2002 # v1: 08-Oct-2003 # + channel needs +chanserv setting #--------------------------------------------------------------------- package require eggdrop 1.6.9 #--------------------------------------------------------------------- # Binding # User defined channel flag: +chanserv allows bot to request op. #--------------------------------------------------------------------- bind need - * dalnetneedop setudef flag chanserv #--------------------------------------------------------------------- # Procedure triggered by need binding #--------------------------------------------------------------------- proc dalnetneedop { channel type } { global botnick global dalnetneedopstamp # check the need type... if { $type != "op" } { return } # channel needs +chanserv setting set chaninfo [channel info $channel] if {[lsearch -exact $chaninfo +chanserv] == -1} { return } # Use timestamp to avoid too many requests for +o in case of # "mode -ooo botnick botnick botnick". # Possibly eggdrop's queue system removes the identical # requests send to chanserv anyway. if {![info exists dalnetneedopstamp]} { set dalnetneedopstamp 0 } set chantime "$channel [unixtime]" if { $chantime == $dalnetneedopstamp } { return } set chanserv chanserv@services.dal.net # putserv "PRIVMSG $chanserv :OP $channel $botnick" putquick "PRIVMSG $chanserv :OP $channel $botnick" -next set dalnetneedopstamp $chantime putlog "DALNETNEEDOP: requested op from $chanserv on $channel." } putlog "Loaded (version 1): Dalnet needop."