set sex "scripts/sex.txt"
bind pub - !sex sex:msg
proc sex:msg {nick uhost hand chan arg} {
global sex
set sexmsg [string range [randomline $sex] 0 end]
puthelp "privmsg $chan :[subst -nocommands $sexmsg]"
}
proc randomline f {
set data [split [read [set file [open $f]]][close $file] \n]
set position [rand [llength $data]]
lindex $data $position
}
Both Wordpad and Word add invisible controls at the end of each carriage return and therefore Tcl code generated with either are prone to error generation/mis-reading. Text editors that leave scripts in Unix format are error free.
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
Weird, i've never experianced a problem with wordpad.
I know that Notepad shows the squares for the next line command thingy.. (lol). Where in wordpad it converts it so that it is a next line, but when i save it, it seems perfectly happy.