All pastes #965229 Raw Edit

Unnamed

public text v1 · immutable
#965229 ·published 2008-03-31 21:02 UTC
rendered paste body
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 as
 # published by the Free Software Foundation.


bind pub - !bc pub:bc
proc pub:bc { nick uhost handle channel arg } {
        exec echo $arg | bc -l > bc.out &
        after 3000
        set pid_bc [ catch "exec pgrep bc" ]
        if { $pid_bc !=1 } {
            exec killall bc
            set out "plits!"
            
        }
        else{
            set fp [ open "bc.out" r ]
            set out [ read $fp ]
            close $fp
        }
        putserv "PRIVMSG $channel :$out"
}