<?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/21332" />

	<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>2023-12-30T15:17:34-04:00</updated>

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

		<entry>
		<author><name><![CDATA[snowtroll]]></name></author>
		<updated>2023-12-30T15:17:34-04:00</updated>

		<published>2023-12-30T15:17:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112342#p112342</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112342#p112342"/>
		<title type="html"><![CDATA[Re: todo list]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112342#p112342"><![CDATA[
Perfect! Thank you<br><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code># EditTextFile (ToDo-List ver) 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 channel(s) for this script to run in #set eTxFile(chan) {#anotherchannel #someotherchan}# Set the full route &amp; file name of the ToDo-List file #set eTxFile(file) {/home/eggdrop/scripts/todo.txt}# Set the access flags to use the ToDo-List public commands #set eTxFile(flags) {o|o}########### Public Command Trigger ############ Set the public trigger for all the ToDo-List commands ##    note: All ToDo-List commands start with this one word!set eTxFile(cmd) {!todo}########### Public Command Options ############ Set the command option for the add line command ## to add a line at the end of the file:#    example:  !todo add The text to add at file end.#    example:  !todo add end The text to add at file end.# to add a line at a specific line position in the file:#    example:  !todo add 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) {add}# Set the command option for the delete line command ## to delete a specific line (by line number) from the text file#    example:  !todo del 4#    note: this will renumber all lines after line 4!set eTxFile(del) {del}# Set the command option for the list file command ## to list all lines from the text file#    example:  !todo list# note: list is also the default if no command option is given!#    example:  !todoset eTxFile(list) {list}########### Extended Command Options ############ Set the command option for the read line command ## to read a specific line (by line number) from the text file#    example:  !todo read 4#    note: use to check for correct line before doing !todo del or editset eTxFile(read) {read}# Set the command option for the edit line command ## to edit a specific line (by line number) in the text file#    example:  !todo edit 4 New text to replace file line 4.set eTxFile(edit) {edit}# Set the command option to get help with this script ## to see all valid ToDo-List command options#    example:  !todo helpset eTxFile(help) {help}################ End Settings ################bind pub $eTxFile(flags) $eTxFile(cmd) etfProcCmdset eTxFile(chan) [split $eTxFile(chan)]proc etfProcCmd {nk uh hn ch tx} {  global eTxFile  if {[lsearch -nocase $eTxFile(chan) $ch]=="-1"} {  return 0  }  set tx [split [string trim $tx]]  set opt [lindex $tx 0]  set tx [string trim [join [lrange $tx 1 end]]]  if {$opt eq $eTxFile(add)} {    etfProcAdd $nk $ch $tx  } elseif {$opt eq $eTxFile(del)} {    etfProcEdit $nk $ch $tx del  } elseif {$opt eq "" || $opt eq $eTxFile(list)} {    etfProcRead $nk $ch $tx file  } elseif {$opt eq $eTxFile(read)} {    etfProcRead $nk $ch $tx  } elseif {$opt eq $eTxFile(edit)} {    etfProcEdit $nk $ch $tx  } else {    if {$opt eq $eTxFile(help)} {      puthelp "PRIVMSG $ch :--- ToDo-List script help ---"    } else {      puthelp "PRIVMSG $ch :Invalid ToDo-List command option: $opt"    }    puthelp "PRIVMSG $ch :Valid options for $eTxFile(cmd): \             $eTxFile(add), $eTxFile(del), $eTxFile(list),\             $eTxFile(read), $eTxFile(edit), $eTxFile(help)"    puthelp "PRIVMSG $ch :To get help for an option, use it without arguments."    puthelp "PRIVMSG $ch :Example: $eTxFile(cmd) $eTxFile(add)"    puthelp "PRIVMSG $ch :Example: $eTxFile(cmd) $eTxFile(del)"  }  return 0}proc etfProcAdd {nk ch tx} {  set tx [split $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(cmd) $::eTxFile(add)"    puthelp "PRIVMSG $ch :Correct syntax is: $add \[position\] &lt;text to add&gt;"    puthelp "PRIVMSG $ch :Example: $add Text to add at end of the list."    puthelp "PRIVMSG $ch :Example: $add end Text to add at end of the list."    puthelp "PRIVMSG $ch :Example: $add 4 Text to add at list line 4."    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 $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 ToDo text file: $tf"  } elseif {[info exists nofile]} {    puthelp "PRIVMSG $ch :Added line to new ToDo-List: $tx"  } else {    puthelp "PRIVMSG $ch :Added line at end of ToDo-List: $tx"  }  return}proc etfProcRead {nk ch tx {do line} } {  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty."  ;  return  }  if {$do eq "line" &amp;&amp; ![string is digit -strict $tx]} {    set read "$::eTxFile(cmd) $::eTxFile(read)"    puthelp "PRIVMSG $ch :Correct syntax is: $read &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $read 4"    return  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$do eq "file"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"      } elseif {$lnum==$tx} {        puthelp "PRIVMSG $ch :\[$lnum\]  $line"  ;  break      }    }  }  close $tid  if {$lnum=="0"} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty." ;  return  }  if {$do eq "line" &amp;&amp; $tx&gt;$lnum} {  set tl line    if {$lnum&gt;"1"} {  set tl lines  }    puthelp "PRIVMSG $ch :List line $tx doesn't exist ($lnum $tl in the list)"  }  return}proc etfProcEdit {nk ch tx {do edit} } {  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty."  ;  return  }  set tx [split $tx]  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      set edit "$::eTxFile(cmd) $::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 list line 4."      return    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    set del "$::eTxFile(cmd) $::eTxFile(del)"    puthelp "PRIVMSG $ch :Correct syntax is: $del &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $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 :List line $find doesn't exist ($lnum $tl in the list)"      } else {  puthelp "PRIVMSG $ch :ToDo-List is currently empty."  }      close $nid  ;  file delete $new    }  } else {  close $nid  ;  file rename -force $new $tf  }  return}putlog "EditTextFile (ToDo-List ver) Ver. 0.4 by SpiKe^^ loaded."</code></pre></div></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13131">snowtroll</a> — Sat Dec 30, 2023 3:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[FmX]]></name></author>
		<updated>2023-12-30T12:32:33-04:00</updated>

		<published>2023-12-30T12:32:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112341#p112341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112341#p112341"/>
		<title type="html"><![CDATA[Re: todo list]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112341#p112341"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># EditTextFile (ToDo-List ver) 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 channel(s) for this script to run in #set eTxFile(chan) {#anotherchannel #someotherchan}# Set the full route &amp; file name of the ToDo-List file #set eTxFile(file) {/home/eggdrop/scripts/todo.txt}# Set the access flags to use the ToDo-List public commands #set eTxFile(flags) {o|o}########### Public Command Trigger ############ Set the public trigger for all the ToDo-List commands ##    note: All ToDo-List commands start with this one word!set eTxFile(cmd) {!todo}########### Public Command Options ############ Set the command option for the add line command ## to add a line at the end of the file:#    example:  !todo add The text to add at file end.#    example:  !todo add end The text to add at file end.# to add a line at a specific line position in the file:#    example:  !todo add 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) {add}# Set the command option for the delete line command ## to delete a specific line (by line number) from the text file#    example:  !todo del 4#    note: this will renumber all lines after line 4!set eTxFile(del) {del}# Set the command option for the list file command ## to list all lines from the text file#    example:  !todo list# note: list is also the default if no command option is given!#    example:  !todoset eTxFile(list) {list}########### Extended Command Options ############ Set the command option for the read line command ## to read a specific line (by line number) from the text file#    example:  !todo read 4#    note: use to check for correct line before doing !todo del or editset eTxFile(read) {read}# Set the command option for the edit line command ## to edit a specific line (by line number) in the text file#    example:  !todo edit 4 New text to replace file line 4.set eTxFile(edit) {edit}# Set the command option to get help with this script ## to see all valid ToDo-List command options#    example:  !todo helpset eTxFile(help) {help}################ End Settings ################bind pub $eTxFile(flags) $eTxFile(cmd) etfProcCmdset eTxFile(chan) [split $eTxFile(chan)]proc etfProcCmd {nk uh hn ch tx} {  global eTxFile  if {[lsearch -nocase $eTxFile(chan) $ch]=="-1"} {  return 0  }  set tx [split [string trim $tx]]  set opt [lindex $tx 0]  set tx [string trim [join [lrange $tx 1 end]]]  if {$opt eq $eTxFile(add)} {    etfProcAdd $nk $ch $tx  } elseif {$opt eq $eTxFile(del)} {    etfProcEdit $nk $ch $tx del  } elseif {$opt eq "" || $opt eq $eTxFile(list)} {    etfProcRead $nk $ch $tx file  } elseif {$opt eq $eTxFile(read)} {    etfProcRead $nk $ch $tx  } elseif {$opt eq $eTxFile(edit)} {    etfProcEdit $nk $ch $tx  } else {    if {$opt eq $eTxFile(help)} {      puthelp "PRIVMSG $ch :--- ToDo-List script help ---"    } else {      puthelp "PRIVMSG $ch :Invalid ToDo-List command option: $opt"    }    puthelp "PRIVMSG $ch :Valid options for $eTxFile(cmd): \             $eTxFile(add), $eTxFile(del), $eTxFile(list),\             $eTxFile(read), $eTxFile(edit), $eTxFile(help)"    puthelp "PRIVMSG $ch :To get help for an option, use it without arguments."    puthelp "PRIVMSG $ch :Example: $eTxFile(cmd) $eTxFile(add)"    puthelp "PRIVMSG $ch :Example: $eTxFile(cmd) $eTxFile(del)"  }  return 0}proc etfProcAdd {nk ch tx} {  set tx [split $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(cmd) $::eTxFile(add)"    puthelp "PRIVMSG $ch :Correct syntax is: $add \[position\] &lt;text to add&gt;"    puthelp "PRIVMSG $ch :Example: $add Text to add at end of the list."    puthelp "PRIVMSG $ch :Example: $add end Text to add at end of the list."    puthelp "PRIVMSG $ch :Example: $add 4 Text to add at list line 4."    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 $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 ToDo text file: $tf"  } elseif {[info exists nofile]} {    puthelp "PRIVMSG $ch :Added line to new ToDo-List: $tx"  } else {    puthelp "PRIVMSG $ch :Added line at end of ToDo-List: $tx"  }  return}proc etfProcRead {nk ch tx {do line} } {  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty."  ;  return  }  if {$do eq "line" &amp;&amp; ![string is digit -strict $tx]} {    set read "$::eTxFile(cmd) $::eTxFile(read)"    puthelp "PRIVMSG $ch :Correct syntax is: $read &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $read 4"    return  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$do eq "file"} {  puthelp "PRIVMSG $ch :\[$lnum\]  $line"      } elseif {$lnum==$tx} {        puthelp "PRIVMSG $ch :\[$lnum\]  $line"  ;  break      }    }  }  close $tid  if {$lnum=="0"} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty." ;  return  }  if {$do eq "line" &amp;&amp; $tx&gt;$lnum} {  set tl line    if {$lnum&gt;"1"} {  set tl lines  }    puthelp "PRIVMSG $ch :List line $tx doesn't exist ($lnum $tl in the list)"  }  return}proc etfProcEdit {nk ch tx {do edit} } {  set tf $::eTxFile(file)  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :ToDo-List is currently empty."  ;  return  }  set tx [split $tx]  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      set edit "$::eTxFile(cmd) $::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 list line 4."      return    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    set del "$::eTxFile(cmd) $::eTxFile(del)"    puthelp "PRIVMSG $ch :Correct syntax is: $del &lt;line#&gt;"    puthelp "PRIVMSG $ch :Example: $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 :List line $find doesn't exist ($lnum $tl in the list)"      } else {  puthelp "PRIVMSG $ch :ToDo-List is currently empty."  }      close $nid  ;  file delete $new    }  } else {  close $nid  ;  file rename -force $new $tf  }  return}putlog "EditTextFile (ToDo-List ver) Ver. 0.4 by SpiKe^^ loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8470">FmX</a> — Sat Dec 30, 2023 12:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[snowtroll]]></name></author>
		<updated>2023-12-23T07:50:03-04:00</updated>

		<published>2023-12-23T07:50:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112330#p112330</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112330#p112330"/>
		<title type="html"><![CDATA[todo list]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112330#p112330"><![CDATA[
Looking for a script that can do a todo/task list. Maybe also with a "claim task" function.<br>The main need would be:<br>!todo (list all tasks that needs to be done with an ID(number))<br>!todo add &lt;some task thats need to be done&gt;<br>!todo del # (ID)<br>!todo complete # (ID)<br><br>Maybe as an extra function:<br>!todo claim # (ID)<br>This would then add (username) at the end of the task so when doing !todo it shows that (username) is working on the specific task.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13131">snowtroll</a> — Sat Dec 23, 2023 7:50 am</p><hr />
]]></content>
	</entry>
	</feed>
