Hi I am kinda new to tcl and eggdrop scripting. I can do the basic bind and proc functions with little to no trouble.
I am working on a script now that writes certain text to a file.
Then allows that text to be searchable only allowing 10 results.
I have the gathering of the info just not sure how to do the searching part. I have tried to look at other searching script and got lost about half way through.
Here is what I have so far:
set pack_file_dir "scripts/custom/packs.txt"
set pack_list ""
set pack_list_chan "<gathering channel>"
set pack_chan "<searching channel>"
set text {
write some text here if like ..
that the command should write to the file
}
if {[catch {open file.txt 'w'} w]} {
#
# either puts $w $text
#
# or line by line
#
foreach {x} [split $text \n] {
puts $w $x
}
close $w
}
it all depends, .. a is append w is write and r is read i see you use a .. depends what you want to do remember that w destroys all data currently stored in file.txt