Code: Select all
proc readfifo {file} {
if {[gets $file text] < 0} {
if {[eof $file]} {
close $file
putlog "FIFO closed due to eof-condition!"
return
}
} {
puthelp "PRIVMSG #yourchannel :$text"
}
}
set fid [open "/path/to/fifo" "RDWR"]
fconfigure $fid -blocking 0
fileevent $fid readable [list readfifo $fid]
Code: Select all
Code: Select all
if {[string match {*RECOVERY*} $line]} {
putquick "PRIVMSG $channel :\0033$line" # GREEN
} elseif {[string match {*PROBLEM*} $line]} {
putquick "PRIVMSG $channel :\0034$line" # RED
} else {
putquick "PRIVMSG $channel :$line"
}
Code: Select all
putquick "PRIVMSG $channel :\0033$line\003" ;# GREEN