All pastes #158957 Raw Edit

Something

public text v1 · immutable
·published 2006-09-02 14:35 UTC
rendered paste body
a:command -add addchan  pub:addchan   1090 536 v

proc pub:addchan {hand chan args x mix} {
    global chans
 
	set league  [lindex $args 0]
	set newchan [lindex $args 1]

      if { $league == "elite" } {
        file delete -force ~/eggdrop/ascript/elite.tcl
        set logstr "set chans(elite) {$chans(elite) $newchan}"
        set addlog [open ~/eggdrop/ascript/elite.tcl a]
        puts $addlog "$logstr"
        close $addlog
        rehash
        puthelp "PRIVMSG $chan : Added chan: \002\0032$newchan\002\0031 to league \002\0032$league\002\0032"}
      if { $league == "1st" } {
        file delete -force ~/eggdrop/ascript/1st.tcl
        set logstr "set chans(1st) {$chans(1st) $newchan}"
        set addlog [open ~/eggdrop/ascript/1st.tcl a]
        puts $addlog "$logstr"
        close $addlog
        rehash
        puthelp "PRIVMSG $chan : Added chan: \002\0032$newchan\002\0031 to league \002\0032$league\002\0032"}
      if { $league == "2nd" } {
        exec [rm -f 2nd.tcl]
        set logstr "set chans(2nd) $chans(2nd) $newchan"
        set addlog [open ~/eggdrop/ascript/2nd.tcl a]
        puts $addlog "$logstr"
        close $addlog
        rehash
        puthelp "PRIVMSG $chan : Added chan: \002\0032$newchan\002\0031 to league \002\0032$league\002\0032"}
        return "Added $newchan to $league"
   }

proc pub:chans {hand chan args x mix} { global chans; puthelp "PRIVMSG $chan : Elite League: $chans(elite) 1st League: $chans(1st) 2nd League: $chans(2nd) 3rd League: $chans(3rd) 4th League: $chans(4th) Checking: ${chans(checking)}. " }