hello the script works like a charm , but i want it to read - without me typing !readfile more like auto read file with timer between each sentence and another , coloring maybeSpiKe^^ wrote:See if you can get the file read to your channel with this script -> http://forum.egghelp.org/viewtopic.php?t=19179
Use one of the last 2 examples in that string, depending on your tcl version.
The script at or near the end of that forum string does that.but i want it to read - without me typing !readfile more like auto read file with timer between each sentence
Code: Select all
# EditTextFile+TimedReadLine Version 1.0 #
# author: SpiKe^^ #
# e-mail: spike<at>mytclscripts<dot>com #
# webpage: http://mytclscripts.com/ #
...and from the settings in that script.......
########### Timed Public Read Setting ###########
# Set the channel(s) for the timed public read line #
set eTxFile(tchan) {#yourchannel #anotherchannel #someotherchan}
# Set number of minutes between each timed public read line #
# Set this to "0" to disable all timed public read lines
# Note: file errors will be sent to the first channel in eTxFile(tchan)
set eTxFile(timed) "5"
You really need a functioning script before you worry about its darn colors, coloring maybe
like coloring the title - and the url each one with a different color
...and...Votex wrote:also i want the this tcl to mark each txt or url the bot post to be like posted
and never posted it again .
We can still modify the script to be more like what you were looking for.Votex wrote:coloring maybe
like coloring the title - and the url each one with a different color
Code: Select all
# TimedReadLinkFile Version 1.0 (11May2015) #
# author: SpiKe^^ #
# e-mail: spike<at>mytclscripts<dot>com #
# webpage: http://mytclscripts.com/ #
# This file is Copyrighted under the GNU Public License. #
# http://www.gnu.org/copyleft/gpl.html #
########### Begin Script Settings ###########
# Set the full route & file name of the file to read from #
set trlf(file) {/usr/home/spike/eggdrop/scripts/filename.txt}
# Set the channel(s) for the timed public read link #
set trlf(chan) {#yourchannel #anotherchannel #someotherchan}
# Set number of minutes between each timed public read link #
set trlf(time) "5"
############ End Script Settings ############
set trlf(chan) [split [string tolower $trlf(chan)]]
if {![info exists trlf(runnin)]} {
if {$trlf(time)>"3"} { timer 3 [list trlfReadFile]
} else { timer $trlf(time) [list trlfReadFile] }
set trlf(runnin) 1
}
proc trlfReadFile {} { global trlf
timer $trlf(time) [list trlfReadFile]
set fl $trlf(file)
if {![file exists $fl]} { return }
set ofl [open $fl "r"]
set lines [read -nonewline $ofl]
close $ofl
set lines [split $lines "\n"]
if {![llength $lines]} { file delete -- $fl ; return }
set lines [lassign $lines next]
if {[set idx [string last " - " $next]] < 1} {
set next "\00305$next"
} else {
set title "\00305[string range $next 0 [incr idx -1]]\003 - "
incr idx 4
if {[string length $next] > $idx} {
set url "\00313[string range $next $idx end]\003"
} else { set url "" }
set next ${title}${url}
}
foreach ch $trlf(chan) { puthelp "PRIVMSG $ch :$next" }
if {![llength $lines]} { file delete -- $fl ; return }
set ofl [open $fl "w"]
puts $ofl [join $lines "\n"]
close $ofl
return
}
putlog "TimedReadLinkFile Ver. 1.0 by SpiKe^^ loaded."