can someone help me write a script that uses a txt file or mysql database. I will that the bot should write out the latest post from a database or a txt file into the channel. I hace search on the net but i did't found something.
## reading:
set filesocket [open "your filename" r]; # open the file
set data(0) [gets $filesocket]; # read line1
set data(1) [gets $filesocket]; # read line2
close $filesocket; # close the file
# writing or appending
if {![file exists "your filename"]} then { ; # check for file exist
set fs [open "your filename" w]
} else {
set fs [open "your filename" a]
}
puts $fs "your data"
close $fs