Code: Select all
proc pub:test {nick host hand chan arg} {
global botnick outputchan filename
set io [open "[info ./login] $filename" r+]
set invert [exec [info ./login] $filename << \]
puts "Test \n $invert"
putserv "PRIVMSG $outputchan :Mission Accomplished"
}
Code: Select all
set io [open "|./login $filename" r+]
Code: Select all
proc loginHandler {fileId} {
global outputchan
if {[gets $chan line] >= 0} {
putserv "PRIVMSG $outputchan :$line"
}
if {[eof $chan]} {
close $chan
}
}
...
set io [open "|./login $filename" r+]
fconfigure $io -blocking 0 -buffering line
fileevent $io read [list loginHandler $io]
Code: Select all
set invert [exec ./login $filename]
Code: Select all
<IRCop-Bot> [16:04:15] Tcl error [pub:test]: Pseudo-terminal will not be allocated because stdin is not a terminal.
Code: Select all
bind pub - ${trigger}test pub:test
proc pub:test {nick host hand chan arg} {
global botnick outputchan filename
set invert [exec $filename]
putserv "PRIVMSG $outputchan :Mission Accomplished"
}