All pastes #81005 Raw Edit

Mine

public text v1 · immutable
·published 2006-07-07 01:03 UTC
rendered paste body
bind pub - !affils affillist

set affil(chans) "#empty-crew #empty-space"
set affil(conf) "/glftpd/etc/glftpd.conf"
set affil(header) "\[\002      -Affils\002\]"
set sitesections(DVDR)    "DVDR"
set sitesections(DVDR-SWE)       "DVDR-SWE"
set sitesections(XBOX360)      "XBOX360"

proc affillist {nick uhost handle chan arg} {
        global affil sitesections
        set affilchan 0
        foreach achan [lindex $affil(chans)] {
                if {$achan==$chan} {
                        set affilchan 1
                        break
                }
        }
        if {$affilchan==0} { return }
        if {[file exists $affil(conf)]} {
                set affildata [exec /glftpd/bin/grep privpath $affil(conf) | gre
p STAFFPRE | grep -v "#" ]
                putlog "ad: $affildata"
                foreach line [split $affildata \n] {
                        set adata [split $line "/"]
                        set section [lindex $adata 2]
                        set group [lindex [split [lindex $adata 4]] 0]
                        if {$group!="guestpre"} {
                                if {[info exists sections($section)]} {
                                        set sections($section) "$sections($secti
on) $group"
                                } else {
                                        set sections($section) $group
                                }
                        }
                }
                set head $affil(header)
                regsub -all -- "      " $head "\002affils\002" head
#                putquick "privmsg $chan :$head Affils:"
                foreach section [lsort -dictionary [array names sections]] {
                        set head $affil(header)
                        regsub -all -- "      " $head $sitesections($section) he
ad
                        putquick "privmsg $chan :$head [lsort -dictionary $secti
ons($section)]"
                }
        }

}