First, I'm affraid you can't get a .exe....grinch157 wrote:Code: Select all
bind -|- helpme proc_helpme proc_helpme { nick uhost hand chan text } { [open c:\test\test\test\test\tmp\filename.exe r] } putserv "PRIVMSG %nick
Code: Select all
bind pub - "helpme" proc_helpme
proc proc_helpme { nick uhost hand chan text } {
set fo [open "c:\test\test\test\test\tmp\filename.txt r]
while { ![eof $fo] } {
gets $fo line
putserv "PRIVMSG $nick :$line"
}
close $fo
}
thats the idea i want a pub bind so the user just types the trigger and not in a phrase, so i took out the quotes there.First, I'm affraid you can't get a .exe....
Second: if your procedure ends before you send the PRIVMSG, it can't work
Third: You don't bind anything... I wonder you want to bind a pub
So try with a .txt and make this:
Code:
bind pub - "helpme" proc_helpme
proc proc_helpme { nick uhost hand chan text } {
while { ![eof $fo] } {
gets $fo line
putserv "PRIVMSG $nick :$line"
}
close $fo
}
Code: Select all
set fo [open "c:\test\test\test\test\tmp\filename.txt r]
Code: Select all
bind pub - !helpme proc_help
proc proc_help {nick uhost handle channel arg} {
set file file-name.txt
if {![file exists $file]} {close [open $file w]}
set io [open $file r]
set list ""
while {![eof $io]} {
gets $io line
if {[string trim $line] == ""} {continue}
lappend list $line
}
close $io
set length [llength $list]
set message "$length match[expr {($length == "1")?"":"es"}] found:"
putserv "PRIVMSG $channel :$message"
foreach line $list {
putquick "PRIVMSG $channel :$line"
}
}
yes, \ is a special character, don't you know?grinch157 wrote:Code: Select all
set fo [open "c:\test\test\test\test\tmp\filename.txt r]
Code: Select all
set fo [open "c:\test\test\test\test\tmp\filename.txt r]
Code: Select all
set fo [open "c:\\test\\test\\test\\test\\tmp\\filename.txt" r]