<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19179" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2012-12-17T15:54:18-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19179</id>

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-17T15:54:18-04:00</updated>

		<published>2012-12-17T15:54:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100444#p100444</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100444#p100444"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100444#p100444"><![CDATA[
Edited the above script, to have it make the text file, if it does not exist.<br>Corrected some of the script documentation.<br>Changed it's version number to ver. 1.0<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Dec 17, 2012 3:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-12-05T10:28:21-04:00</updated>

		<published>2012-12-05T10:28:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100363#p100363</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100363#p100363"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100363#p100363"><![CDATA[
YES! FANTASTIC! THIS IS IT!!<br><br>THANK YOU SPIKE^^!!!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Wed Dec 05, 2012 10:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-17T15:50:18-04:00</updated>

		<published>2012-12-04T20:39:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100359#p100359</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100359#p100359"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100359#p100359"><![CDATA[
Here is the script with the new requested options.<div class="codebox"><p>Code: </p><pre><code># EditTextFile+TimedReadLine Version 1.0 ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Text File Settings ############ Set the full route &amp; file name of the file to edit ## Note: The !addline command will attempt to make this file if needed.set eTxFile(file) {/usr/home/spike/eggdrop/scripts/filename.txt}########### Public 'Line' Command Settings ############# settings for: !addline !readline !delline &amp; !editline ### Set the listen channel(s) for all public Line commands #set eTxFile(lchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Line commands #set eTxFile(lflags) {o|o}# Set the public trigger for the add line command ## to add a line at the end of the file: #    example:  !addline end The text to add at file end.#    example:  !addline The text to add at file end.# to add a line at a specific line position in the file:#    example:  !addline 4 The text to add at file line 4.#    note: this will renumber the original line 4 &amp; all lines after it!set eTxFile(add) {!addline}# Set the public trigger for the read line command ## to read a specific line (by line number) from the text file#    example:  !readline 4#    note: use to check for correct line before doing !editline or !dellineset eTxFile(read) {!readline}# Set the public trigger for the delete line command ## to delete a specific line (by line number) from the text file#    example:  !delline 4#    note: this will renumber all lines after line 4!set eTxFile(del) {!delline}# Set the public trigger for the edit line command ## to edit a specific line (by line number) in the text file#    example:  !editline 4 New text to replace file line 4.set eTxFile(edit) {!editline}########### Public 'ReadFile' Command Settings ############# settings for the public !readfile command ### Set the listen channel(s) for the public !readfile command #set eTxFile(rchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public read file command #set eTxFile(rflags) {o|o}# Set the public trigger for the read file command ## to read all lines from the text file#    example:  !readfileset eTxFile(readf) {!readfile}########### 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"# show file line number before each timed public read line? (0=no | 1=yes) #set eTxFile(tnum) "1"################ End Settings ################bind pub $eTxFile(lflags) $eTxFile(add) etfProcAddbind pub $eTxFile(lflags) $eTxFile(del) etfProcDelbind pub $eTxFile(lflags) $eTxFile(read) etfProcReadbind pub $eTxFile(lflags) $eTxFile(edit) etfProcEditbind pub $eTxFile(rflags) $eTxFile(readf) etfProcReadFset eTxFile(lchan) [split [string tolower $eTxFile(lchan)]]set eTxFile(rchan) [split [string tolower $eTxFile(rchan)]]set eTxFile(tchan) [split [string tolower $eTxFile(tchan)]]if {$eTxFile(timed)&gt;"0" &amp;&amp; ![info exists eTxFile(tnxread)]} {  if {$eTxFile(timed)&gt;"3"} {  timer 3 [list etfProcTimed]  } else {  timer $eTxFile(timed) [list etfProcTimed]  }  set eTxFile(tnxread) 1}proc etfProcAdd {nk uh hn ch tx} {  set ch [string tolower $ch]  if {[lsearch -exact $::eTxFile(lchan) $ch]=="-1"} {  return  }  set tx [split [string trim $tx]]  if {[lindex $tx 0] eq "end" || [string is digit -strict [lindex $tx 0]]} {    set addat [lindex $tx 0] ; set tx [string trim [join [lrange $tx 1 end]]]  } else {  set addat end  ;  set tx [join $tx]  }  if {$tx eq ""} {  set add $::eTxFile(add)    puthelp "PRIVMSG $ch :Correct syntax is: $add \[position\] &lt;text to add&gt;"    puthelp "PRIVMSG $ch :Example: $add end Text to add at end of the file."    puthelp "PRIVMSG $ch :Example: $add 4 Text to add at file line 4."    puthelp "PRIVMSG $ch :Example: $add Text to add at end of the file."    return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {  set addat end  ;  set nofile 1  }  if {$addat ne "end"} {  set tx "$addat $tx"    etfProcEdit $nk $uh $hn $ch $tx add  ;  return  }  set id [open $tf a]  ;  puts $id $tx  ;  close $id  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Unable to find or make text file: $tf"  } elseif {[info exists nofile]} {    puthelp "PRIVMSG $ch :Added line to new text file: $tx"  } else {    puthelp "PRIVMSG $ch :Added line at end of text file: $tx"  }  return}proc etfProcReadF {nk uh hn ch tx} {  etfProcRead $nk $uh $hn $ch $tx file  ;  return}proc etfProcTimed {} {  if {$::eTxFile(timed)=="0"} {  unset ::eTxFile(tnxread)  ;  return  }  timer $::eTxFile(timed) [list etfProcTimed]  set chan [lindex $::eTxFile(tchan) 0]  etfProcRead $::botnick Timed Line $chan $::eTxFile(tnxread)  ;  return}proc etfProcRead {nk uh hn ch tx {do line} } {  set ch [string tolower $ch]  if {$do eq "file"} {    if {[lsearch -exact $::eTxFile(rchan) $ch]=="-1"} {  return  }  } elseif {$uh eq "Timed"} {    if {[lsearch -exact $::eTxFile(tchan) $ch]=="-1"} {  return  }  } else {    if {[lsearch -exact $::eTxFile(lchan) $ch]=="-1"} {  return  }  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [string trim $tx]  if {$do eq "line" &amp;&amp; ![string is digit -strict $tx]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(read) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(read) 4"  ;  return  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$uh eq "Timed" &amp;&amp; $lnum=="1"} {  set ln1 $line  }      if {$do eq "file"} {  puthelp "PRIVMSG $ch :\[$lnum\] $line"      } elseif {$lnum==$tx} {        if {$uh ne "Timed"} {  puthelp "PRIVMSG $ch :\[$lnum\] $line"  }        break      }    }  }  close $tid  if {$lnum=="0"} {    if {[info exists ::eTxFile(tnxread)]} {  set ::eTxFile(tnxread) 1  }    puthelp "PRIVMSG $ch :Text file is empty: $tf" ;  return  }  if {$uh eq "Timed"} {  set pre ""    if {$lnum==$tx} {  incr ::eTxFile(tnxread)    } else {  set line $ln1  ;  set lnum 1  ;  set ::eTxFile(tnxread) 2  }    if {$::eTxFile(tnum)!="0"} {  set pre "\[$lnum\] "  }    foreach ch $::eTxFile(tchan) {  puthelp "PRIVMSG $ch :$pre$line"  }  } elseif {$do eq "line" &amp;&amp; $tx&gt;$lnum} {  set tl line    if {$lnum&gt;"1"} {  set tl lines  }    puthelp "PRIVMSG $ch :File line $tx doesn't exist ($lnum $tl in the file)"  }  return}proc etfProcDel {nk uh hn ch tx} {  etfProcEdit $nk $uh $hn $ch $tx del  ;  return}proc etfProcEdit {nk uh hn ch tx {do edit} } {  set ch [string tolower $ch]  if {[lsearch -exact $::eTxFile(lchan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [split [string trim $tx]]  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      set edit $::eTxFile(edit)      puthelp "PRIVMSG $ch :Correct syntax is: $edit &lt;line#&gt; &lt;new edited text&gt;"      puthelp "PRIVMSG $ch :Example: $edit 4 New text to replace file line 4."      return    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(del) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(del) 4"  ;  return  }  set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]  set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$find} {        if {$do eq "edit"} {          puthelp "PRIVMSG $ch :Replaced line $lnum text: $line"          puthelp "PRIVMSG $ch :with the new text line: $tx"          puts $nid $tx        } elseif {$do eq "del"} {          puthelp "PRIVMSG $ch :Deleted line $lnum text: $line"        } elseif {$do eq "add"} {          puthelp "PRIVMSG $ch :Added new line $lnum text: $tx"          puts $nid $tx  ;  puts $nid $line        }      } else {  puts $nid $line  }    }  }  close $tid  if {$find&gt;$lnum} {    if {$do eq "add"} {  incr lnum      puthelp "PRIVMSG $ch :Added new line $lnum text: $tx"      puts $nid $tx  ;  close $nid  ;  file rename -force $new $tf    } else {      if {$lnum&gt;"0"} {  set tl line        if {$lnum&gt;"1"} {  set tl lines  }        puthelp "PRIVMSG $ch :File line $find doesn't exist ($lnum $tl in the file)"      } else {  puthelp "PRIVMSG $ch :Text file is empty: $tf"  }      close $nid  ;  file delete $new    }  } else {  close $nid  ;  file rename -force $new $tf  }  return}putlog "EditTextFile+TimedReadLine Ver. 1.0 by SpiKe^^ loaded."</code></pre></div>Let me know if that's what you were looking for.<br><br>EDITED: Added code to make the text file if it doesn't exist.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Dec 04, 2012 8:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-12-04T06:59:11-04:00</updated>

		<published>2012-12-04T06:59:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100352#p100352</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100352#p100352"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100352#p100352"><![CDATA[
Hey SpiKe^^, <br><br>I would like to thank you from the bottom of my heart for your time and effort - the script works lovely, exactly like I wanted, all the functionality is there and its good!<br><br>I would like to ask though, if possible, can you remove the [number-of-line-here] that appears before each message when displayed to the channel?<br><br>And, is there any chance you can modify the script so I can add messages to Messages.txt without being on eTxFile(chan) - meaning I can edit the messages relied to a certain channel (or channels) even if I`m not on it?<br><br>Thanks again!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Tue Dec 04, 2012 6:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-04T01:47:45-04:00</updated>

		<published>2012-12-04T01:47:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100350#p100350</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100350#p100350"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100350#p100350"><![CDATA[
Installed the script and fully tested it, All looks good:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Dec 04, 2012 1:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-03T12:24:03-04:00</updated>

		<published>2012-12-03T12:24:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100346#p100346</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100346#p100346"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100346#p100346"><![CDATA[
Still untested, but this version removes the code that requires tcl 8.5<div class="codebox"><p>Code: </p><pre><code># EditTextFile+TimedReadLine Version 0.5 ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Script Settings ############ Set the full route &amp; file name of the file to edit #set eTxFile(file) {/usr/home/spike/eggdrop/scripts/filename.txt}# Set the channel(s) for this script to run in #set eTxFile(chan) {#yourchannel #anotherchannel #someotherchan}########### Public Command Settings ############ Set the public trigger for the add line command ## to add a line at the end of the file: #    example:  !addline end The text to add at file end.#    example:  !addline The text to add at file end.# to add a line at a specific line position in the file:#    example:  !addline 4 The text to add at file line 4.#    note: this will renumber the original line 4 &amp; all lines after it!set eTxFile(add) {!addline}# Set the public trigger for the read line command ## to read a specific line (by line number) from the text file#    example:  !readline 4#    note: use to check for correct line before doing !editline or !dellineset eTxFile(read) {!readline}# Set the public trigger for the delete line command ## to delete a specific line (by line number) from the text file#    example:  !delline 4#    note: this will renumber all lines after line 4!set eTxFile(del) {!delline}# Set the public trigger for the edit line command ## to edit a specific line (by line number) in the text file#    example:  !editline 4 New text to replace file line 4.set eTxFile(edit) {!editline}# Set the public trigger for the read file command ## to read all lines from the text file#    example:  !readfileset eTxFile(readf) {!readfile}# Set the access flags to use the above public commands #set eTxFile(flags) {o|o}########### Timed Public Read Setting ############ 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(chan)set eTxFile(timed) "5"################ End Settings ################bind pub $eTxFile(flags) $eTxFile(add) etfProcAddbind pub $eTxFile(flags) $eTxFile(del) etfProcDelbind pub $eTxFile(flags) $eTxFile(read) etfProcReadbind pub $eTxFile(flags) $eTxFile(edit) etfProcEditbind pub $eTxFile(flags) $eTxFile(readf) etfProcReadFset eTxFile(chan) [split [string tolower $eTxFile(chan)]]if {$eTxFile(timed)&gt;"0" &amp;&amp; ![info exists eTxFile(tnxread)]} {  if {$eTxFile(timed)&gt;"3"} {  timer 3 [list etfProcTimed]  } else {  timer $eTxFile(timed) [list etfProcTimed]  }  set eTxFile(tnxread) 1}proc etfProcAdd {nk uh hn ch tx} {  set ch [string tolower $ch]  if {[lsearch -exact $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [split [string trim $tx]]  if {[lindex $tx 0] eq "end" || [string is digit -strict [lindex $tx 0]]} {    set addat [lindex $tx 0] ; set tx [string trim [join [lrange $tx 1 end]]]  } else {  set addat end  ;  set tx [join $tx]  }  if {$tx eq ""} {  set add $::eTxFile(add)    puthelp "PRIVMSG $ch :Correct syntax is: $add \[position\] &lt;text to add&gt;"    puthelp "PRIVMSG $ch :Example: $add end Text to add at end of the file."    puthelp "PRIVMSG $ch :Example: $add 4 Text to add at file line 4."    puthelp "PRIVMSG $ch :Example: $add Text to add at end of the file."    return  }  if {$addat ne "end"} {  set tx "$addat $tx"    etfProcEdit $nk $uh $hn $ch $tx add  ;  return  }  puthelp "PRIVMSG $ch :Adding line at end of file: $tx"  set id [open $tf a]  ;  puts $id $tx  ;  close $id  ;  return}proc etfProcReadF {nk uh hn ch tx} {  etfProcRead $nk $uh $hn $ch $tx file  ;  return}proc etfProcTimed {} {  if {$::eTxFile(timed)=="0"} {  unset ::eTxFile(tnxread)  ;  return  }  set chan [lindex $::eTxFile(chan) 0]  etfProcRead $::botnick Timed Line $chan $::eTxFile(tnxread)  timer $::eTxFile(timed) [list etfProcTimed]  ;  return}proc etfProcRead {nk uh hn ch tx {do line} } {  set ch [string tolower $ch]  if {[lsearch -exact $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [string trim $tx]  if {$do eq "line" &amp;&amp; ![string is digit -strict $tx]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(read) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(read) 4"    return  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$uh eq "Timed" &amp;&amp; $lnum=="1"} {  set ln1 $line  }      if {$do eq "file"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"      } elseif {$lnum==$tx} {        if {$uh ne "Timed"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"  }        break      }    }  }  close $tid  if {$lnum=="0"} {    if {[info exists ::eTxFile(tnxread)]} {  set ::eTxFile(tnxread) 1  }    puthelp "PRIVMSG $ch :Text file is empty: $tf" ;  return  }  if {$uh eq "Timed"} {    if {$lnum==$tx} {  incr ::eTxFile(tnxread)    } else {  set line $ln1  ;  set lnum 1  ;  set ::eTxFile(tnxread) 2  }    foreach ch $::eTxFile(chan) {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"  }  } elseif {$do eq "line" &amp;&amp; $tx&gt;$lnum} {  set tl line    if {$lnum&gt;"1"} {  set tl lines  }    puthelp "PRIVMSG $ch :File line $tx doesn't exist ($lnum $tl in the file)"  }  return}proc etfProcDel {nk uh hn ch tx} {  etfProcEdit $nk $uh $hn $ch $tx del  ;  return}proc etfProcEdit {nk uh hn ch tx {do edit} } {  set ch [string tolower $ch]  if {[lsearch -exact $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [split [string trim $tx]]  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      set edit $::eTxFile(edit)      puthelp "PRIVMSG $ch :Correct syntax is: $edit &lt;line#&gt; &lt;new edited text&gt;"      puthelp "PRIVMSG $ch :Example: $edit 4 New text to replace file line 4."      return    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(del) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(del) 4"    return  }  set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]  set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$find} {        if {$do eq "edit"} {          puthelp "PRIVMSG $ch :Replacing line $lnum text: $line"          puthelp "PRIVMSG $ch :with the new text line: $tx"          puts $nid $tx        } elseif {$do eq "del"} {          puthelp "PRIVMSG $ch :Deleting line $lnum text: $line"        } elseif {$do eq "add"} {          puthelp "PRIVMSG $ch :Adding new line $lnum text: $tx"          puts $nid $tx  ;  puts $nid $line        }      } else {  puts $nid $line  }    }  }  close $tid  if {$find&gt;$lnum} {    if {$do eq "add"} {  incr lnum      puthelp "PRIVMSG $ch :Adding new line $lnum text: $tx"      puts $nid $tx  ;  close $nid  ;  file rename -force $new $tf    } else {      if {$lnum&gt;"0"} {  set tl line        if {$lnum&gt;"1"} {  set tl lines  }        puthelp "PRIVMSG $ch :File line $find doesn't exist ($lnum $tl in the file)"      } else {  puthelp "PRIVMSG $ch :Text file is empty: $tf"  }      close $nid  ;  file delete $new    }  } else {  close $nid  ;  file rename -force $new $tf  }  return}putlog "EditTextFile+TimedReadLine Ver. 0.5 by SpiKe^^ loaded."</code></pre></div>Try again and let me know.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Dec 03, 2012 12:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-03T11:41:45-04:00</updated>

		<published>2012-12-03T11:41:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100345#p100345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100345#p100345"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100345#p100345"><![CDATA[
OK, that answers the question of what version of tcl you are using <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>[lsearch -nocase] was added in tcl 8.5, you are using 8.4 or older.<br>I will fix it to work for tcl 8.4 and lower....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Dec 03, 2012 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-12-03T04:30:08-04:00</updated>

		<published>2012-12-03T04:30:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100341#p100341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100341#p100341"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100341#p100341"><![CDATA[
Hello SpiKe^^!<br><br>Thank you for your time and work.<br><br>I am currently testing the script.<br><br>I have tried to add a line, it did not work and I received this error in the partyline:<br><div class="codebox"><p>Code: </p><pre><code>[09:27:01] Tcl error in script for 'timer752':[09:27:01] bad option "-nocase": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start</code></pre></div>None of the public commands work (I did not receive additional error messages)<br><br>Again, thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Mon Dec 03, 2012 4:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-03T02:29:56-04:00</updated>

		<published>2012-12-03T02:29:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100339#p100339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100339#p100339"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100339#p100339"><![CDATA[
Not had a chance to test this any, but here's what I have. Maybe you can try to load and test it some:).<div class="codebox"><p>Code: </p><pre><code># EditTextFile+TimedReadLine Version 0.4 ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Script Settings ############ Set the full route &amp; file name of the file to edit #set eTxFile(file) {/usr/home/spike/eggdrop/scripts/filename.txt}# Set the channel(s) for this script to run in #set eTxFile(chan) {#yourchannel #anotherchannel #someotherchan}########### Public Command Settings ############ Set the public trigger for the add line command ## to add a line at the end of the file: #    example:  !addline end The text to add at file end.#    example:  !addline The text to add at file end.# to add a line at a specific line position in the file:#    example:  !addline 4 The text to add at file line 4.#    note: this will renumber the original line 4 &amp; all lines after it!set eTxFile(add) {!addline}# Set the public trigger for the read line command ## to read a specific line (by line number) from the text file#    example:  !readline 4#    note: use to check for correct line before doing !editline or !dellineset eTxFile(read) {!readline}# Set the public trigger for the delete line command ## to delete a specific line (by line number) from the text file#    example:  !delline 4#    note: this will renumber all lines after line 4!set eTxFile(del) {!delline}# Set the public trigger for the edit line command ## to edit a specific line (by line number) in the text file#    example:  !editline 4 New text to replace file line 4.set eTxFile(edit) {!editline}# Set the public trigger for the read file command ## to read all lines from the text file#    example:  !readfileset eTxFile(readf) {!readfile}# Set the access flags to use the above public commands #set eTxFile(flags) {o|o}########### Timed Public Read Setting ############ 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(chan)set eTxFile(timed) "5"################ End Settings ################bind pub $eTxFile(flags) $eTxFile(add) etfProcAddbind pub $eTxFile(flags) $eTxFile(del) etfProcDelbind pub $eTxFile(flags) $eTxFile(read) etfProcReadbind pub $eTxFile(flags) $eTxFile(edit) etfProcEditbind pub $eTxFile(flags) $eTxFile(readf) etfProcReadFset eTxFile(chan) [split $eTxFile(chan)]if {$eTxFile(timed)&gt;"0" &amp;&amp; ![info exists eTxFile(tnxread)]} {  if {$eTxFile(timed)&gt;"3"} {  timer 3 [list etfProcTimed]  } else {  timer $eTxFile(timed) [list etfProcTimed]  }  set eTxFile(tnxread) 1}proc etfProcAdd {nk uh hn ch tx} {  if {[lsearch -nocase $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [split [string trim $tx]]  if {[lindex $tx 0] eq "end" || [string is digit -strict [lindex $tx 0]]} {    set addat [lindex $tx 0] ; set tx [string trim [join [lrange $tx 1 end]]]  } else {  set addat end  ;  set tx [join $tx]  }  if {$tx eq ""} {  set add $::eTxFile(add)    puthelp "PRIVMSG $ch :Correct syntax is: $add \[position\] &lt;text to add&gt;"    puthelp "PRIVMSG $ch :Example: $add end Text to add at end of the file."    puthelp "PRIVMSG $ch :Example: $add 4 Text to add at file line 4."    puthelp "PRIVMSG $ch :Example: $add Text to add at end of the file."    return  }  if {$addat ne "end"} {  set tx "$addat $tx"    etfProcEdit $nk $uh $hn $ch $tx add  ;  return  }  puthelp "PRIVMSG $ch :Adding line at end of file: $tx"  set id [open $tf a]  ;  puts $id $tx  ;  close $id  ;  return}proc etfProcReadF {nk uh hn ch tx} {  etfProcRead $nk $uh $hn $ch $tx file  ;  return}proc etfProcTimed {} {  if {$::eTxFile(timed)=="0"} {  unset ::eTxFile(tnxread)  ;  return  }  set chan [lindex $::eTxFile(chan) 0]  etfProcRead $::botnick Timed Line $chan $::eTxFile(tnxread)  timer $::eTxFile(timed) [list etfProcTimed]}proc etfProcRead {nk uh hn ch tx {do line} } {  if {[lsearch -nocase $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [string trim $tx]  if {$do eq "line" &amp;&amp; ![string is digit -strict $tx]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(read) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(read) 4"    return  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$uh eq "Timed" &amp;&amp; $lnum=="1"} {  set ln1 $line  }      if {$do eq "file"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"      } elseif {$lnum==$tx} {        if {$uh ne "Timed"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"  }        break      }    }  }  close $tid  if {$lnum=="0"} {  puthelp "PRIVMSG $ch :Text file is empty: $tf" ;  return  }  if {$uh eq "Timed"} {    if {$lnum==$tx} {  incr ::eTxFile(tnxread)    } else {  set line $ln1  ;  set lnum 1  ;  set ::eTxFile(tnxread) 2  }    foreach ch $::eTxFile(chan) {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"  }  } elseif {$do eq "line" &amp;&amp; $tx&gt;$lnum} {    puthelp "PRIVMSG $ch :File line $tx doesn't exist ($lnum lines in the file)"  }  return}proc etfProcDel {nk uh hn ch tx} {  etfProcEdit $nk $uh $hn $ch $tx del  ;  return}proc etfProcEdit {nk uh hn ch tx {do edit} } {  if {[lsearch -nocase $::eTxFile(chan) $ch]=="-1"} {  return  }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"  ;  return  }  set tx [split [string trim $tx]]  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      set edit $::eTxFile(edit)      puthelp "PRIVMSG $ch :Correct syntax is: $edit &lt;line#&gt; &lt;new edited text&gt;"      puthelp "PRIVMSG $ch :Example: $edit 4 New text to replace file line 4."      return    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(del) &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $::eTxFile(del) 4"    return  }  set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]  set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$find} {        if {$do eq "edit"} {          puthelp "PRIVMSG $ch :Replacing line $lnum text: $line"          puthelp "PRIVMSG $ch :with the new text line: $tx"          puts $nid $tx        } elseif {$do eq "del"} {          puthelp "PRIVMSG $ch :Deleting line $lnum text: $line"        } elseif {$do eq "add"} {          puthelp "PRIVMSG $ch :Adding new line $lnum text: $tx"          puts $nid $tx          puts $nid $line        }      } else {  puts $nid $line  }    }  }  close $tid  if {$find&gt;$lnum} {    if {$do eq "add"} {  incr lnum      puthelp "PRIVMSG $ch :Adding new line $lnum text: $tx"      puts $nid $tx  ;  close $nid  ;  file rename -force $new $tf    } else {      puthelp "PRIVMSG $ch :File line $find doesn't exist ($lnum lines in the file)"      close $nid  ;  file delete $new    }  } else {  close $nid  ;  file rename -force $new $tf  }  return}putlog "EditTextFile+TimedReadLine Ver. 0.4 by SpiKe^^ loaded."</code></pre></div>Goodluck and let me know.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Dec 03, 2012 2:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-12-01T13:35:27-04:00</updated>

		<published>2012-12-01T13:35:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100322#p100322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100322#p100322"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100322#p100322"><![CDATA[
Its really up to you <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Sat Dec 01, 2012 1:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-01T12:37:26-04:00</updated>

		<published>2012-12-01T12:37:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100319#p100319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100319#p100319"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100319#p100319"><![CDATA[
Or maybe we could just start with this simple text file editing script i wrote a few days ago. It has !addline , !readline , and !editline already, and I'm sure it works as is. Would just need a little more work to do the rest of what you want:):<br><div class="codebox"><p>Code: </p><pre><code># EditTextFile Version 0.3 ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############  Begin Settings ############ set the full route &amp; file name of the file to edit #set eTxFile(file) {/usr/home/spike/eggdrop/scripts/filename.txt}# set the channel for this script to run in #set eTxFile(chan) {#yourchannel}# set the public trigger for the add line command #set eTxFile(add) {!addline}# set the public trigger for the read line command #set eTxFile(read) {!readline}# set the public trigger for the edit line command #set eTxFile(edit) {!editline}# set the access flags to use the above public commands #set eTxFile(flags) {o|o}############  End Settings ############bind pub $eTxFile(flags) $eTxFile(add) etfProcAddbind pub $eTxFile(flags) $eTxFile(read) etfProcReadbind pub $eTxFile(flags) $eTxFile(edit) etfProcEditproc etfProcAdd {nk uh hn ch tx} {  if {[string tolower $ch] ne [string tolower $::eTxFile(chan)]} { return }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"    return  }  set tx [string trim $tx]  if {$tx eq ""} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(add) text to add to the end of the file."    return  }  puthelp "PRIVMSG $ch :Adding: $tx :to file: [file tail $tf]"  set id [open $tf a]  puts $id $tx  close $id  return}proc etfProcRead {nk uh hn ch tx} {  if {[string tolower $ch] ne [string tolower $::eTxFile(chan)]} { return }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"    return  }  set tx [string trim $tx]  if {![string is digit -strict $tx]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(read) line#"    return  }  set tid [open $tf]  set lnum 0  while {![eof $tid]} {    set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$tx} {        puthelp "PRIVMSG $ch :Existing line $lnum text: $line"        break      }    }  }  close $tid  if {$tx&gt;$lnum} {    puthelp "PRIVMSG $ch :File line $tx doesn't exist ($lnum lines in the file)"  }  return}proc etfProcEdit {nk uh hn ch tx} {  if {[string tolower $ch] ne [string tolower $::eTxFile(chan)]} { return }  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Text file does not exist: $tf"    return  }  set tx [split [string trim $tx]]  if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {    puthelp "PRIVMSG $ch :Correct syntax is: $::eTxFile(edit) line# text to replace original line."    return  }  set find [lindex $tx 0]  set tx [string trim [join [lrange $tx 1 end]]]  set new [file dirname $tf]/newfile.tmp  set nid [open $new w]  set tid [open $tf]  set lnum 0  while {![eof $tid]} {    set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$find} {        puthelp "PRIVMSG $ch :Replacing existing line $lnum text: $line"        puthelp "PRIVMSG $ch :with the new text line: $tx"        puts $nid $tx      } else {  puts $nid $line  }    }  }  close $nid  ;  close $tid  if {$find&gt;$lnum} {    puthelp "PRIVMSG $ch :File line $find doesn't exist ($lnum lines in the file)"    file delete $new  } else {  file rename -force $new $tf  }  return}</code></pre></div>Let me know what route you wish to pursue.<br>Think I prefer starting with my script, as it is simple to edit:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 01, 2012 12:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-12-01T12:58:51-04:00</updated>

		<published>2012-12-01T12:19:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100318#p100318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100318#p100318"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100318#p100318"><![CDATA[
You should search the egghelp script archive for the quote scripts, there are 40 in that catagory: <a href="http://www.egghelp.org/tclhtml/3478-4-3-0-1.htm" class="postlink">http://www.egghelp.org/tclhtml/3478-4-3-0-1.htm</a><br>Two I find promising are: <ul><li>CodeNinja Quote System   ver 1.0.2  31/12/2010 by CodeNinja <br>LegoMan's Quote Database Script ver 1.2.0 08/07/2007 by LegoMan</li> </ul>Looks to me like either of those scripts could manage your text file with !add and !delete commands.<br>If one of those scripts function properly, I could try to add the 'read lines on a timer' part for you.<br><br><br>You might also want to read this egghelp forum string: <a href="http://forum.egghelp.org/viewtopic.php?t=19139" class="postlink">http://forum.egghelp.org/viewtopic.php?t=19139</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 01, 2012 12:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-12-01T10:16:43-04:00</updated>

		<published>2012-12-01T10:16:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100316#p100316</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100316#p100316"/>
		<title type="html"><![CDATA[Timed Messages]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100316#p100316"><![CDATA[
Hey all<br><br>I need your help.<br>I need a script that every X minutes will read according to the order the next line from Messages.TXT (in other words, it reads 1 line each time - not random lines, forever).<br><br>In addition, public commands including: !addmsg, !delmsg &lt;line number&gt;, and !playfile to play the whole file with line numbers before the messages<br><br>* Must support sending messages to more than 1 channel.<br><br>Please help - thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Sat Dec 01, 2012 10:16 am</p><hr />
]]></content>
	</entry>
	</feed>
