Code: Select all
if [file readable $file] {
set fc [open "|tail -f $file"]
fconfigure $fc -blocking 0
fileevent $fc readable {puthelp "privmsg $chan :[gets $fc]"}
}
Code: Select all
bind pub - #watch my_watch
proc my_watch {nick uhost handle channel arg} {
if [file readable /var/log/httpd/error_log] {
set fc [open "|tail -f /var/log/httpd/error_log"]
fconfigure $fc -blocking 0
fileevent $fc readable {putserv "privmsg $nick :[gets $fc]"}
}
return 1
}
Code: Select all
bind pub - watch my_watch
proc my_watch {nick uhost handle channnel arg} {
global nick fc
if [file readable /home/et/1] {
set fc [open "|tail -f /home/et/1"]
fconfigure $fc -blocking 0
fileevent $fc readable {putserv "privmsg $nick :[gets $fc]"}
}
return 1
}
you need to rename this "nick" to something else (like cnick) and everywhere THIS nick is meant and not the global nick.Porch wrote:proc my_watch {nick uhost handle channnel arg} {