All pastes #257 Raw Edit

tek

public text v1 · immutable
#257 ·published 2004-07-06 03:48 UTC
rendered paste body
bind join - * fa_add
bind part - * fa_del
bind sign - * fa_del

proc fa_add {unick uhost hand chan {msg ""}} {
        global nick

        if {$nick == $unick} {
                putcmdlog "flushing hosts."
                set sockfd [open /home/tek/eggdrop/tmp/socket "WRONLY NONBLOCK"]
                puts $sockfd "f"
                close $sockfd

                foreach nickname [chanlist $chan] {
                        set host [getchanhost $nickname $chan]

                        utimer "10" {

                                putcmdlog "allowing $host."
                                set sockfd [open /home/tek/eggdrop/tmp/socket "WRONLY NONBLOCK"]
                                puts $sockfd "a$host"
                                close $sockfd
                        }
                }
        } else {
                putcmdlog "allowing $uhost."
                set sockfd [open /home/tek/eggdrop/tmp/socket "WRONLY NONBLOCK"]
                puts $sockfd "a$uhost"
                close $sockfd
        }
}

proc fa_del {unick uhost hand chan {msg ""}} {
        putcmdlog "disallowing $uhost."
        set sockfd [open /home/tek/eggdrop/tmp/socket "WRONLY NONBLOCK"]
        puts $sockfd "d$uhost"
        close $sockfd
}