Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stopping the output of a text file.

8 views
Skip to first unread message

Tempest Kitty

unread,
Apr 23, 2012, 1:58:46 AM4/23/12
to
Currently i have a tcl script that reads the content of a text file.
it gets the name of the text file from a PUB or MSG bound command. It
has not problems outputting that text file into the chan or via pm,
however i cant figure out how to incorporate a !stop command, to stop
the file from being outputted once its going... here is the code i
currently have.

bind PUB - !play Hypno_Reader

# Set this to your full eggdrop DIR
# You can make your own folder to put the files into ie
# "/home/eggdrop/HypnoScripts"

set trance_file "/home/user/eggdrop/hypnofiles"


proc Hypno_Reader {nick uhost hand chan text} {
set number [lindex [split $text] 0]
set filename ${::trance_file}/${number}.txt
if {![file exists $filename]} {
putquick "NOTICE $chan :Trance file not found."
return
}

set trfile [open $filename]
set data [split [read -nonewline $trfile] \n]
close $trfile
putquick "PRIVMSG #TheGridTestingArea : Loading your file ..."
putquick "PRIVMSG ##TheGridTestingArea : We hope you enjoy..."
foreach trance_line $data {
putquick "PRIVMSG #TheGridTestingArea :\00315$trance_line"
}
}

im sure its simple but i just cant fig out how to do it...

thanks

tempest.
0 new messages