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

	<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>2016-02-14T16:00:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[King]]></name></author>
		<updated>2016-02-14T16:00:22-04:00</updated>

		<published>2016-02-14T16:00:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104694#p104694</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104694#p104694"/>
		<title type="html"><![CDATA[[Request] Bot Report File Script - King]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104694#p104694"><![CDATA[
Thanks a lot Spike^^, does everything exactly as I wanted, actually learn some stuffs from this script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12595">King</a> — Sun Feb 14, 2016 4:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2016-02-14T14:24:58-04:00</updated>

		<published>2016-02-14T14:24:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104692#p104692</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104692#p104692"/>
		<title type="html"><![CDATA[ReportBot Ver 0.2 by SpiKe^^]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104692#p104692"><![CDATA[
<blockquote class="uncited"><div>though, I'd like to change the time to duration instead of date.</div></blockquote>Here is a new version of the script with the option to choose date submitted or time ago...<br><div class="codebox"><p>Code: </p><pre><code>###########################  ReportBot Version 0.2  ############################ 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 ## Note: this script requires tcl 8.5 or higher! ## Note: this script requires alltools.tcl! ############################ General Script Settings ############################ Set the channel(s) for this script to run in.#   Ex.  set reBot(chan) {#yourchannel}#   Ex.  set reBot(chan) {#yourchannel #anotherchannel #someotherchan}set reBot(chan) {#yourchannel}# Set the file name or /fullRoute/fileName of the script data file.#   Ex.  set reBot(file) {reBot_data.txt}#   Ex.  set reBot(file) {/usr/home/spike/eggdrop/scripts/reBot_data.txt}set reBot(file) {reBot_data.txt}# Should this script message the perm owner(s) when a new report is received?#  0 = no, do not message the owner(s)#  1 = yes, message the owner(s) if they are onlineset reBot(msgOwner) 1# In the return from !reportlist, use date submitted or time ago??#  1 = use date submitted:   Example.  Date: 2/12/2016#  2 = use time ago:  Example.  Time: about 1 hour &amp; 15 minutes ago.set reBot(addWhen) 2############################ END OF SCRIPT SETINGS ############################## edit command access flags and triggers here ##bind pub -|- !reportbot reportBot:addbind msg mno !reportlist reportBot:listbind msg mno !reportdel reportBot:del# END edit command access flags &amp; triggers here #set reBot(chan) [split $reBot(chan)]proc reportBot:add {nick uhost hand chan text} {  global reBot owner  if {[lsearch -exact -nocase $reBot(chan) $chan] == -1} { return 0 }  set text [string trim $text]  if {$text eq ""} {    putnotc $nick "Correct syntax is: !reportbot &lt;something to report&gt;"    putnotc $nick "Example: !reportbot The bot is no longer opping me."    return 0  }  if {![string match {[.!?]} [stridx $text end]]} { append text "." }  lappend reBot(-data) [list [unixtime] $nick $uhost $hand $chan $text]  reportBot:writeFile  putnotc $nick "Your report has been received. Thanks for participating."  if {$reBot(msgOwner) == 1} {    set msg "\[ReportBot\] New report received from $nick $uhost"    if {[llength $reBot(chan)] &gt; 1} { append msg " on $chan" }    foreach hnd [split $owner ", "] {      if {$hnd eq ""} { continue }      if {[handonchan $hnd] &amp;&amp; [matchattr $hnd n]} {        putmsg [hand2nick $hnd] "$msg "$text""      }    }  }  return 0}proc reportBot:list {nick uhost hand text} {  global reBot  if {![llength $reBot(-data)]} {    putmsg $nick "Report list is currently empty."  } else {    set cnt 0    foreach item $reBot(-data) {      incr cnt      foreach {ut nk uh hn ch tx} $item { break }      if {[llength $reBot(chan)] == 1} {  set ch ""      } else { set ch " on $ch" }      if {$reBot(addWhen) == 2} {        set when "Time: about "        set dur [split [duration [expr {[unixtime] - $ut}]]]        if {[llength $dur] == 2} {          append when "[join $dur] ago."        } else {          if {[string match "sec*" [lindex $dur end]]} {            set dur [lrange $dur 0 end-2]          }          if {[llength $dur] == 2} {            append when "[string trimright [join $dur] ","] ago."          } else {            set dur [lrange $dur 0 3]            set dur [lreplace $dur 1 1 [string trim [lindex $dur 1] ","] &amp;]            append when "[string trimright [join $dur] ","] ago."          }        }      } else { set when "Date: [strftime %m/%d/%Y $ut]" }      putmsg $nick "\[$cnt\] $nk $uh$ch Report: $tx $when"    }  }  return 0}proc reportBot:del {nick uhost hand text} {  global reBot  set text [split [string trim $text]]  if {![string is digit -strict [lindex $text 0]]} {    putmsg $nick "Correct syntax is: !reportdel &lt;report number(s) to delete&gt;"    putmsg $nick "Example: !reportdel 3"    putmsg $nick "Example: !reportdel 1 3 4"    if {[llength $reBot(-data)]} { return 0 }  }  if {![llength $reBot(-data)]} {    putmsg $nick "Report list is currently empty."  } else {    set del ""  ;  set err ""    foreach item $text {      if {$item eq ""} { continue }      if {[string is digit $item] &amp;&amp; $item &lt;= [llength $reBot(-data)]} {        lappend del $item      } else {  set err $item  ;  break  }    }    if {[llength $del]} {      set cnt 0      set newdata ""      foreach item $reBot(-data) {        incr cnt        if {[lsearch $del $cnt] == -1} { lappend newdata $item ; continue }        foreach {ut nk uh hn ch tx} $item { break }        putmsg $nick "Deleted report #$cnt: $nk $uh "$tx""      }      set reBot(-data) $newdata      reportBot:writeFile    }    if {$err ne ""} {      if {[string is digit $err]} {        putmsg $nick "ReportBot Error: Report #$err does not exist!"        putmsg $nick "Use: !reportlist :for a list of all current reports."      } else {        putmsg $nick "ReportBot Error: Invalid !reportdel command option: $err"        putmsg $nick "Use: !reportdel :for correct syntax to delete reports."      }    }  }  return 0}# set global reBot(-data) variable to match script data file #proc reportBot:readFile {} {  global reBot  if {![file exists $reBot(file)]} {    set reBot(-data) ""  } else {    set id [open $reBot(file)]    set data [read -nonewline $id]    close $id    set reBot(-data) [split $data \n]  }}# set global reBot(-data) variable at script load #reportBot:readFile# write script data file to match global reBot(-data) variable #proc reportBot:writeFile {} {  global reBot  if {![llength $reBot(-data)]} {    file delete $reBot(file)  } else {    set id [open $reBot(file) w]    foreach item $reBot(-data) {      puts $id $item    }    close $id  }}putlog "ReportBot Ver 0.2 by SpiKe^^ loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Feb 14, 2016 2:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2016-02-13T22:57:40-04:00</updated>

		<published>2016-02-13T22:57:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104689#p104689</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104689#p104689"/>
		<title type="html"><![CDATA[[Request] Bot Report File Script - King]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104689#p104689"><![CDATA[
<blockquote class="uncited"><div>had to input the proc to get it working though since you forgot them </div></blockquote>Sorry 'bout that:)<br>All fixed in the above posted script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Feb 13, 2016 10:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[King]]></name></author>
		<updated>2016-02-13T22:34:09-04:00</updated>

		<published>2016-02-13T22:34:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104688#p104688</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104688#p104688"/>
		<title type="html"><![CDATA[[Request] Bot Report File Script - King]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104688#p104688"><![CDATA[
Nice, thanks Spike^^, that works perfectly, had to input the proc to get it working though since you forgot them <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> works exactly as I wanted.<br><br>Seems quiet easy to you considering the fact that you've done it with ease, though, I'd like to change the time to duration instead of date. But, it's fine otherwise, thanks again <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12595">King</a> — Sat Feb 13, 2016 10:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2016-02-13T22:54:04-04:00</updated>

		<published>2016-02-13T17:44:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104685#p104685</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104685#p104685"/>
		<title type="html"><![CDATA[ReportBot Ver 0.1 by SpiKe^^]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104685#p104685"><![CDATA[
Script has not been tested, try it out and see what we have.<br><br>Some notes on this script:<br><br>This script only keeps a data file so it can retain all its current data through an Eggdrop start/restart. <br>Do Not edit this file except through the public !reportbot and private message !reportdel commands!<br><br>All script data is always stored and kept current in the global array variable reBot(-data).  That variable is a tcl list, and each element of that list is a tcl list with 6 elements like this...<br> {unixtime nick uhost handle channel reporttext}<br><br>The script currently has just 3 commands:<br><br>1) Public command: !reportbot &lt;something to report&gt; :available to all channel users.<br><br>2) Private message command: !reportlist :available to all global owners, masters, and operators. <br>Use this command to see all current reports.<br>Use the report numbers from this list for the !reportdel command.<br><br>3) Private message command: !reportdel &lt;report number(s) to delete&gt; :available to all global owners, masters, and operators. <br>Use this command to delete reports that are closed out.<br>Use the report numbers from the current !reportlist command reply.<br>IMPORTANT: After a successful !reportdel command, all/some reports may be renumbered to reflect their now current numbering!!! <br>Make sure to get the current report numbering with the !reportlist command before doing another !reportdel  command!!!<br><br><div class="codebox"><p>Code: </p><pre><code>###########################  ReportBot Version 0.1  ############################ 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 ## Note: this script requires tcl 8.5 or higher! ## Note: this script requires alltools.tcl! ############################ General Script Settings ############################ Set the channel(s) for this script to run in.#   Ex.  set reBot(chan) {#yourchannel}#   Ex.  set reBot(chan) {#yourchannel #anotherchannel #someotherchan}set reBot(chan) {#yourchannel}# Set the file name or /fullRoute/fileName of the script data file.#   Ex.  set reBot(file) {reBot_data.txt}#   Ex.  set reBot(file) {/usr/home/spike/eggdrop/scripts/reBot_data.txt}set reBot(file) {reBot_data.txt}# Should this script message the perm owner(s) when a new report is received?#  0 = no, do not message the owner(s)#  1 = yes, message the owner(s) if they are onlineset reBot(msgOwner) 1############################ END OF SCRIPT SETINGS ############################## edit command access flags and triggers here ##bind pub -|- !reportbot reportBot:addbind msg mno !reportlist reportBot:listbind msg mno !reportdel reportBot:del# END edit command access flags &amp; triggers here #set reBot(chan) [split $reBot(chan)]proc reportBot:add {nick uhost hand chan text} {  global reBot owner  if {[lsearch -exact -nocase $reBot(chan) $chan] == -1} { return 0 }  set text [string trim $text]  if {$text eq ""} {    putnotc $nick "Correct syntax is: !reportbot &lt;something to report&gt;"    putnotc $nick "Example: !reportbot The bot is no longer opping me."    return 0  }  if {![string match {[.!?]} [stridx $text end]]} { append text "." }  lappend reBot(-data) [list [unixtime] $nick $uhost $hand $chan $text]  reportBot:writeFile  putnotc $nick "Your report has been received. Thanks for participating."  if {$reBot(msgOwner) == 1} {    set msg "\[ReportBot\] New report received from $nick $uhost"    if {[llength $reBot(chan)] &gt; 1} { append msg " on $chan" }    foreach hnd [split $owner ", "] {      if {$hnd eq ""} { continue }      if {[handonchan $hnd] &amp;&amp; [matchattr $hnd n]} {        putmsg [hand2nick $hnd] "$msg \"$text\""      }    }  }  return 0}proc reportBot:list {nick uhost hand text} {  global reBot  if {![llength $reBot(-data)]} {    putmsg $nick "Report list is currently empty."  } else {    set cnt 0    foreach item $reBot(-data) {      incr cnt      foreach {ut nk uh hn ch tx} $item { break }      set date [strftime %m/%d/%Y $ut]      if {[llength $reBot(chan)] == 1} {  set ch ""      } else { set ch " on $ch" }      putmsg $nick "\[$cnt\] $nk $uh$ch Report: $tx Date: $date"    }  }  return 0}proc reportBot:del {nick uhost hand text} {  global reBot  set text [split [string trim $text]]  if {![string is digit -strict [lindex $text 0]]} {    putmsg $nick "Correct syntax is: !reportdel &lt;report number(s) to delete&gt;"    putmsg $nick "Example: !reportdel 3"    putmsg $nick "Example: !reportdel 1 3 4"    if {[llength $reBot(-data)]} { return 0 }  }  if {![llength $reBot(-data)]} {    putmsg $nick "Report list is currently empty."  } else {    set del ""  ;  set err ""    foreach item $text {      if {$item eq ""} { continue }      if {[string is digit $item] &amp;&amp; $item &lt;= [llength $reBot(-data)]} {        lappend del $item      } else {  set err $item  ;  break  }    }    if {[llength $del]} {      set cnt 0      set newdata ""      foreach item $reBot(-data) {        incr cnt        if {[lsearch $del $cnt] == -1} { lappend newdata $item ; continue }        foreach {ut nk uh hn ch tx} $item { break }        putmsg $nick "Deleted report #$cnt: $nk $uh \"$tx\""      }      set reBot(-data) $newdata      reportBot:writeFile    }    if {$err ne ""} {      if {[string is digit $err]} {        putmsg $nick "ReportBot Error: Report #$err does not exist!"        putmsg $nick "Use: !reportlist :for a list of all current reports."      } else {        putmsg $nick "ReportBot Error: Invalid !reportdel command option: $err"        putmsg $nick "Use: !reportdel :for correct syntax to delete reports."      }    }  }  return 0}# set global reBot(-data) variable to match script data file #proc reportBot:readFile {} {  global reBot  if {![file exists $reBot(file)]} {    set reBot(-data) ""  } else {    set id [open $reBot(file)]    set data [read -nonewline $id]    close $id    set reBot(-data) [split $data \n]  }}# set global reBot(-data) variable at script load #reportBot:readFile# write script data file to match global reBot(-data) variable #proc reportBot:writeFile {} {  global reBot  if {![llength $reBot(-data)]} {    file delete $reBot(file)  } else {    set id [open $reBot(file) w]    foreach item $reBot(-data) {      puts $id $item    }    close $id  }}putlog "ReportBot Ver 0.1 by SpiKe^^ loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Feb 13, 2016 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-02-13T09:30:52-04:00</updated>

		<published>2016-02-13T09:30:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104681#p104681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104681#p104681"/>
		<title type="html"><![CDATA[Re: [Request] Bot Report File Script - King]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104681#p104681"><![CDATA[
<blockquote class="uncited"><div><br>... Which will then saves the report to a .txt file ...<br><br>...<br>... I'll try to take it from there.<br></div></blockquote><br>Check out:<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=6885" class="postlink">http://forum.egghelp.org/viewtopic.php?t=6885</a><br><br>That shows you not only how to write to a text file, but also how to read from one too.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat Feb 13, 2016 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[King]]></name></author>
		<updated>2016-02-12T23:32:23-04:00</updated>

		<published>2016-02-12T23:32:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104680#p104680</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104680#p104680"/>
		<title type="html"><![CDATA[[Request] Bot Report File Script - King]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104680#p104680"><![CDATA[
Hello world,<br><br>I'm requesting a simple script for bot reports, usually would be categorized as feedbacks or bug reports for the bot. Which will then saves the report to a .txt file along with the issuer. For example;<br><br>&lt;~King&gt; !reportbot Please add a spam protection to the bot, thank you.<br>[notice from bot] Your report was sent, thanks for your corporation King!<br><br>BotReports.txt example.<br><br>Nick: King Userhost: (King@Reporting/bot/example) Report: Please add a spam protection to the bot, thank you. Date: 2/12/2016.<br>Nick: Test Userhost: (<a href="mailto:test@test.test.test">test@test.test.test</a>) Report: Testing bot report.<br><br>This is just an example, you can create it simpler than this without userhost and time, just log reports to a .txt file per lines and I'll try to take it from there.<br><br>If possible, I'd like to be notified that a new report was recieved. (As the bot owner).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12595">King</a> — Fri Feb 12, 2016 11:32 pm</p><hr />
]]></content>
	</entry>
	</feed>
