#--------------------------------------------------------------------- # cycle.tcl # Tcl script for IRC bot eggdrop # # .cycle on the partyline by the bot owner will cycle the channel. # # v0: 08-Oct-2003 #--------------------------------------------------------------------- package require eggdrop 1.6 package require Tcl 8.0 bind DCC n|- cycle dcc:cycle proc dcc:cycle { hand idx text} { set chan [lindex [console $idx] 0] putdcc $idx [cyclechan $chan] } proc cyclechan { chan } { # channel must be valid, active, and botison if { ![validchan $chan] } { return "Cycle error: $chan is not a valid channel." } set chaninfo [channel info $chan] if { [lsearch -exact $chaninfo +inactive] != -1 } { return "Cycle error: $chan is inactive!" } if { ![botonchan $chan] } { return "Cycle error: I'm not on $chan!" } # send a PART & JOIN to the server puthelp "PART $chan" puthelp "JOIN $chan" return "Cycling $chan." } putlog "Loaded (version 0): .cycle"