last.tcl - cкрипт вывода сообщений из логов |
last.tcl - cкрипт вывода сообщений из логов |
upper |
Apr 10 2008, 10:42 AM
Post
#1
|
Посетитель Group: Members Posts: 3 Joined: 10-April 08 Member No.: 209 |
Есть очень хороший скрипт вывода последних сообщений в канал
как бы переделать его чтоб показывал сообщения на дату и с заданного времени? например на команду с канала #nnm !чтобылото 01.04.2008 14:05 выводил из файла вида #nnm.log.01Apr2008 строчки вида [14:05] #nnm: mode change '+v noid51622' by Botter!~Botter@[IrcCity]-1AF3F673.bsys-net.ru [14:05] <noid51622> ntcn. ntcn. njkmrj yt rbrfqnt [14:05] noid51622 kicked from #nnm by Botter: Пипипип, пипипип - мой сигналит жип, мой сигналит жип [14:05] noid51622 (~piespy@[IrcCity]-1AF3F673.bsys-net.ru) joined #nnm. [14:05] <_Master-> 6.31 [14:05] #nnm: mode change '+v noid51622' by Botter!~Botter@[IrcCity]-1AF3F673.bsys-net.ru [14:08] <Klut> ку [14:08] #nnm: mode change '+o Klut' by Botter!~Botter@[IrcCity]-1AF3F673.bsys-net.ru [14:08] #nnm: mode change '-v Klut' by Klut!~Klut05@3A9FFEB0.A1F1F78D.192C52B2.IP [14:08] #nnm: mode change '-o Klut' by Klut!~Klut05@3A9FFEB0.A1F1F78D.192C52B2.IP [14:08] <Klut> re [14:09] <Klut> pltcm tcnm rnj ;bdjq вот код скрипта который по идее можно переделать, я не знаю с какого конца подойти только CODE bind pub - !чтобылото last:pub bind pub - !wtf last:pub #set utime "[ctime [unixtime]]" # set time [lindex $utime 3] set last(n) 30 proc putfast {text} { append text "\n" putdccraw 0 [string length $text] $text } set last(timer) [timer 1 last:createlogs] proc last:createlogs {} { global last foreach chan [channels] { set last_logfile [logfile jkp $chan /eggdrop/logs/$chan.log] putlog "Loging $chan in file $last_logfile" } catch { killtimer $last(timer) } } proc last:pub { nick mask hand chan text } { putlog "ищу на $chan файл $chan.log.[clock format [unixtime] -format %d%b%Y]" if {[file exists /eggdrop/logs/$chan.log.[clock format [unixtime] -format %d%b%Y]]} { putlog "вывожу на $chan из $chan.log.[clock format [unixtime] -format %d%b%Y]" set file [open "/eggdrop/logs/$chan.log.[clock format [unixtime] -format %d%b%Y]" "r"] set last_num 0 while {![eof $file]} { set str [gets $file line ] if {$str != ""} { incr last_num +1 set last_log($last_num) $line } } close $file putlog "$nick called last on $chan" global last set i $last_num incr i "-$last(n)" if {($i<1)} { set i 1 } while {($last_num>$i)} { putfast "PRIVMSG $nick : $last_log($i)" incr i; } } } putlog "!last by Humanoid loaded"; |
Lo-Fi Version | Time is now: 21st May 2024 - 09:25 PM |