#### # AUTHOR: # AltBlue http://altblue.n0i.net ### # DESCRIPTION: # outputs to channel the latest linux kernel versions #### # CHANGELOG: # * 2002.01.09: # - initial version #### # CREDITS: # - thanks to Rav for the idea :P~ #### # # CONFIGURATION: # location of the kernel versions file set abk(kernel_file) "/home/www/var/kernel.org" ### bindings bind pub f|f !kernel abk_pub_kernel bind msg -|- kernel abk_msg_kernel ########################################### #### BE SMART! Don't modify anything below. ################################################################## set abk(version) "ABKernel-v1.1" global abk_dict abk_attr proc abk_pub_kernel {nick uhost hand chan arg} { global abk putcmdlog "($chan) $nick: KERNEL $arg" foreach line [abk_load_file $abk(kernel_file)] { putserv "PRIVMSG $chan :\001ACTION says to $nick: $line \001" } } proc abk_msg_kernel {nick uhost hand arg} { global abk putcmdlog "$nick: KERNEL $arg" foreach line [abk_load_file $abk(kernel_file)] { putserv "NOTICE $nick :$line" } } ############################################################################### ############################################################################### ######################## INTERNAL ROUTINES #################################### ############################################################################### ############################################################################### ########## LOAD file proc abk_load_file {file} { global abk if {![file exists $file]} { putlog "$abk(version): File '$file' not found!" return [list {Data file not available.} ] } set fd [open $file r] set lines {} while {[gets $fd line] >= 0} { lappend lines $line } close $fd if {[llength $lines] < 1} { return [list {No data available.}] } { return $lines } } putlog "$abk(version) loaded."