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

	<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>2021-07-20T13:08:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-07-20T13:08:44-04:00</updated>

		<published>2021-07-20T13:08:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110131#p110131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110131#p110131"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110131#p110131"><![CDATA[
To answer your first question PePiNo, the only script which i know is similar and that i would recommend is <a href="https://tclarchive.org/search.php?str=arfer+chanstats&amp;cb1=t&amp;cb2=a&amp;cb3=d&amp;sub.x=0&amp;sub.y=0" class="postlink">Here</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Tue Jul 20, 2021 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[PePiNo]]></name></author>
		<updated>2021-07-19T19:46:01-04:00</updated>

		<published>2021-07-19T19:46:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110127#p110127</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110127#p110127"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110127#p110127"><![CDATA[
TNKS!! BRO U ARE THE BEST!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12929">PePiNo</a> — Mon Jul 19, 2021 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2021-07-19T03:02:08-04:00</updated>

		<published>2021-07-19T03:02:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110124#p110124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110124#p110124"/>
		<title type="html"><![CDATA[Re: hi]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110124#p110124"><![CDATA[
LOL !<br>DasBrain was speaking of missing linebreaks, you didn't add the linebreaks.<br><br>Here is the formated script:<div class="codebox"><p>Code: </p><pre><code># Statistics.tcl (C) 2013 mifrith# type ".chanset &lt;chan&gt; +stat" on the partyline to ativate the script for a specific channel.# commands: !stat &lt;nick&gt; - shows information about you or a nick. (works only for other nicks when you are op on a channel)# !top10 &lt;smiles|palavras|linhas|letras&gt; - shows the top10 chatters, default option is words# !top20 &lt;smiles|palavras|linhas|letras&gt; - same as $top10 but with places 11-20 namespace eval statistics {# Storage file variable storage {scripts/dbase/statistics}# Kill unused entries after x days variable killafter 30# Command trigger variable trigger {!}# smiley regex (only touch this, if you really know, what you are doing!)variable smileyregex {(:|8|;)(-|o)?(&gt;|&lt;|D|O|o|\)|\(|\]|\[|P|p|\||\\|/)} bind PUB -|- !stat bind PUB -|- !top10 [namespace current]::toplistbind PUB -|- !top20 [namespace current]::toplistbind PUBM -|- * bind CTCP -|- ACTION bind EVNT -|- save bind TIME -|- {00 * * * *} setudef flag stat namespace export spew top10 toplist save load monitor } proc statistics::ctcp {nickname hostname handle target keyword arguments} {if {[validchan $target]} {monitor $nickname $hostname $handle $target $arguments}return 0} proc statistics::monitor {nickname hostname handle channel arguments} {variable datavariable smileyregexif {([isbotnick $nickname]) || (![channel get $channel stat])} { return 0 }set hostname [maskhost *!$hostname]regsub -all -- {\002|\003[\d]{0,2}(,[\d]{0,2})? |\006|\007|\017|\026|\037|\n|\t} $arguments {} argumentsset added(palavras) [regexp -all -- {\S+} $arguments]set added(letras) [regexp -all -- {\S} $arguments]if {[string length $smileyregex] &gt;= 1} {set added(smiles) [regexp -all -- $smileyregex $arguments]} else { set added(smiles) 0 }if {(![info exists data($channel,$hostname)])} {set data($channel,$hostname) "0 0 0 0 0 NULL"}regexp -- {^(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $data($channel,$hostname) -&gt; lastseen linhas palavras letras smiles lastnickincr linhas 1incr palavras $added(palavras)incr letras $added(letras)incr smiles $added(smiles)set data($channel,$hostname) "[unixtime] $linhas $palavras $letras $smiles $nickname"} proc statistics::spew {nickname hostname handle channel arguments} {variable dataif {(![channel get $channel stat])} { return 0 }if {([isop $nickname $channel]) &amp;&amp; ([string length $arguments] &gt;= 1)} {set target [lindex [clean $arguments] 0]} else {set target $nickname}if {![onchan $target $channel]} {putserv "PRIVMSG $channel :\[Utilizador desconhecido \002$target\002\]"return 0}set targethost [maskhost *![getchanhost $target $channel]] if {[info exists data($channel,$targethost)]} {regexp -- {^(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $data($channel,$targethost) -&gt; lastseen linhas palavras letras smiles lastnickset wpl [round [expr ($palavras / $linhas.)]]set spl [round [expr ($smiles / $linhas.)]]set lpw [round [expr ($letras / $palavras.)]]putserv "PRIVMSG $channel :\[\002$target\002 escreveu \002$linhas\002 linhas, \002$palavras\002 ($wpl por linha) palavras e \002$letras\002 ($lpw por palavra) letras, contem \002$smiles\002 ($spl por linha) smiles\]"} else {putserv "PRIVMSG $channel :\[Não há informações disponiveis para \002$target\002\]" }} proc statistics::top {channel number {type ""}} {variable data set statistics {}switch $type {{linhas} {set index 1}{letras} {set index 3}{smiles} {set index 4}{default} {set index 2set type "palavras"}}foreach {user stats} [array get data $channel,*] {set stats [clean $stats]lappend statistics "[lindex [clean $stats] 5] [lindex $stats $index]" }set statistics [lrange [lsort -integer -decreasing -index 1 [lsort -unique -index 0 [lsort -integer -increasing -index 1 $statistics]]] [expr $number - 10] [expr $number - 1]]if {$statistics == ""} {return "\[Top$number $type - Não há informações disponiveis para \002$channel\002\]"}set output "\[Top$number $type -"for {set i 0} {$i &lt; [llength $statistics]} {incr i 1} {set item [lindex $statistics $i]append output "\x20[expr $i+$number-9]: \002[join [lindex [clean $item] 0] { }]\002 ([lindex $item 1])"}append output "\]"return $output } proc statistics::toplist {nickname hostname handle channel arguments} {global lastbindif {(![channel get $channel stat])} { return 0 }set arguments [clean $arguments]set key [lindex $arguments 0]if {![regexp -- {^.*?([0-9]+)$} $lastbind -&gt; number]} { return 0 }if {![regexp -nocase -- {^(palavras|letras|smiles|linhas|)$} $key]} {putserv "PRIVMSG $channel :\[Opção desconhecida: \002$key\002, as opções disponiveis são \002letras\002, \002linhas\002, \002smiles\002 and \002palavras\002\]"return 0}putserv "PRIVMSG $channel :[top $channel $number [string tolower $key]]"} proc statistics::cleanupdb {args} {variable killaftervariable dataset killed 0foreach {item} [array names data] {set lastseen [lindex [clean $data($item)] 0]set expire [expr 60 * 60 * 24 * $killafter]if {[expr [unixtime] - $lastseen] &gt;= $expire} {incr killedunset data($item)}}return $killed} proc statistics::load {} {variable datavariable storageregexp -- {^(\S+/)?.*$} $storage -&gt; directoryif {[string length $directory] &gt;= 1} {if {![file isdirectory $directory]} {file mkdir $directory}}if {![file exists $storage]} { return 0 }if {[array exists data]} {array unset data}set file [open $storage r]while {![eof $file]} {gets $file lineif {[regexp -nocase -- {^channel:(\S+)\sid:(\S+)\svalue: (\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $line -&gt; channel hostname lastseen linhas palavras letras smiles lastnick]} {set data($channel,$hostname) "$lastseen $linhas $palavras $letras $smiles $lastnick"}}close $file} proc statistics::save {args} {variable datavariable storageset file [open $storage w]foreach chan_user [array names data] {regexp {^(\S+),(\S+)$} $chan_user -&gt; channel userputs $file "channel:$channel id:$user value:$data($chan_user)"}close $file} proc statistics::clean {i} {regsub -all -- \\\\ $i \\\\\\\\ iregsub -all -- \\\[ $i \\\\\[ iregsub -all -- \\\] $i \\\\\] iregsub -all -- \\\} $i \\\\\} iregsub -all -- \\\{ $i \\\\\{ ireturn $i} proc statistics::round {num} {if {![string match "*.*" $num]} {return $num\.0}if {![regexp -- {^(\d+?)\.(\d+)$} $num -&gt; primary secondary]} {error "syntax error in expression '$num'"}set secondary [expr round([string index $secondary 0].[string range $secondary 1 end])]return [expr {($secondary == 10) ? ($primary+1.0) : "$primary.$secondary"}]} statistics::load putlog "Statistics by mifrith"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Jul 19, 2021 3:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gulio]]></name></author>
		<updated>2021-07-19T02:59:35-04:00</updated>

		<published>2021-07-19T02:59:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110122#p110122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110122#p110122"/>
		<title type="html"><![CDATA[hi]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110122#p110122"><![CDATA[
Pepino here is ur script formated<br><div class="codebox"><p>Code: </p><pre><code> http://paste.tclhelp.net/?id=6pdm</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12887">Gulio</a> — Mon Jul 19, 2021 2:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DasBrain]]></name></author>
		<updated>2021-07-17T19:55:33-04:00</updated>

		<published>2021-07-17T19:55:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110111#p110111</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110111#p110111"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110111#p110111"><![CDATA[
Well, the code is still not correctly formatted - there are linebreaks missing.<br><br>Not sure how this happened - but please fix that as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12909">DasBrain</a> — Sat Jul 17, 2021 7:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[PePiNo]]></name></author>
		<updated>2021-07-17T19:35:23-04:00</updated>

		<published>2021-07-17T19:35:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110110#p110110</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110110#p110110"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110110#p110110"><![CDATA[
tnks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12929">PePiNo</a> — Sat Jul 17, 2021 7:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DasBrain]]></name></author>
		<updated>2021-07-17T19:23:00-04:00</updated>

		<published>2021-07-17T19:23:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110109#p110109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110109#p110109"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110109#p110109"><![CDATA[
Please format your code with<br><div class="codebox"><p>Code: </p><pre><code>[code]</code></pre></div>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12909">DasBrain</a> — Sat Jul 17, 2021 7:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[PePiNo]]></name></author>
		<updated>2021-07-17T22:08:23-04:00</updated>

		<published>2021-07-17T18:58:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110108#p110108</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110108#p110108"/>
		<title type="html"><![CDATA[stats]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110108#p110108"><![CDATA[
Any script similar?<div class="codebox"><p>Code: </p><pre><code># Statistics.tcl (C) 2013 mifrith # type ".chanset &lt;chan&gt; +stat" on the partyline to ativate the script for a specific channel. # commands: !stat &lt;nick&gt; - shows information about you or a nick. (works only for other nicks when you are op on a channel) # !top10 &lt;smiles|palavras|linhas|letras&gt; - shows the top10 chatters, default option is words # !top20 &lt;smiles|palavras|linhas|letras&gt; - same as $top10 but with places 11-20 namespace eval statistics { # Storage file variable storage {scripts/dbase/statistics} # Kill unused entries after x days variable killafter 30 # Command trigger variable trigger {!} # smiley regex (only touch this, if you really know, what you are doing!) variable smileyregex {(:|8|;)(-|o)?(&gt;|&lt;|D|O|o|\)|\(|\]|\[|P|p|\||\\|/)} bind PUB -|- !stat bind PUB -|- !top10 [namespace current]::toplist bind PUB -|- !top20 [namespace current]::toplist bind PUBM -|- * bind CTCP -|- ACTION bind EVNT -|- save bind TIME -|- {00 * * * *} setudef flag stat namespace export spew top10 toplist save load monitor } proc statistics::ctcp {nickname hostname handle target keyword arguments} { if {[validchan $target]} { monitor $nickname $hostname $handle $target $arguments } return 0 } proc statistics::monitor {nickname hostname handle channel arguments} { variable data variable smileyregex if {([isbotnick $nickname]) || (![channel get $channel stat])} { return 0 } set hostname [maskhost *!$hostname] regsub -all -- {\002|\003[\d]{0,2}(,[\d]{0,2})? |\006|\007|\017|\026|\037|\n|\t} $arguments {} arguments set added(palavras) [regexp -all -- {\S+} $arguments] set added(letras) [regexp -all -- {\S} $arguments] if {[string length $smileyregex] &gt;= 1} { set added(smiles) [regexp -all -- $smileyregex $arguments] } else { set added(smiles) 0 } if {(![info exists data($channel,$hostname)])} { set data($channel,$hostname) "0 0 0 0 0 NULL" } regexp -- {^(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $data($channel,$hostname) -&gt; lastseen linhas palavras letras smiles lastnick incr linhas 1 incr palavras $added(palavras) incr letras $added(letras) incr smiles $added(smiles) set data($channel,$hostname) "[unixtime] $linhas $palavras $letras $smiles $nickname" } proc statistics::spew {nickname hostname handle channel arguments} { variable data if {(![channel get $channel stat])} { return 0 } if {([isop $nickname $channel]) &amp;&amp; ([string length $arguments] &gt;= 1)} { set target [lindex [clean $arguments] 0] } else { set target $nickname } if {![onchan $target $channel]} { putserv "PRIVMSG $channel :\[Utilizador desconhecido \002$target\002\]" return 0 } set targethost [maskhost *![getchanhost $target $channel]] if {[info exists data($channel,$targethost)]} { regexp -- {^(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $data($channel,$targethost) -&gt; lastseen linhas palavras letras smiles lastnick set wpl [round [expr ($palavras / $linhas.)]] set spl [round [expr ($smiles / $linhas.)]] set lpw [round [expr ($letras / $palavras.)]] putserv "PRIVMSG $channel :\[\002$target\002 escreveu \002$linhas\002 linhas, \002$palavras\002 ($wpl por linha) palavras e \002$letras\002 ($lpw por palavra) letras, contem \002$smiles\002 ($spl por linha) smiles\]" } else { putserv "PRIVMSG $channel :\[Não há informações disponiveis para \002$target\002\]" } } proc statistics::top {channel number {type ""}} { variable data set statistics {} switch $type { {linhas} {set index 1} {letras} {set index 3} {smiles} {set index 4} {default} {set index 2 ; set type "palavras"} } foreach {user stats} [array get data $channel,*] { set stats [clean $stats] lappend statistics "[lindex [clean $stats] 5] [lindex $stats $index]" } set statistics [lrange [lsort -integer -decreasing -index 1 [lsort -unique -index 0 [lsort -integer -increasing -index 1 $statistics]]] [expr $number - 10] [expr $number - 1]] if {$statistics == ""} { return "\[Top$number $type - Não há informações disponiveis para \002$channel\002\]" } set output "\[Top$number $type -" for {set i 0} {$i &lt; [llength $statistics]} {incr i 1} { set item [lindex $statistics $i] append output "\x20[expr $i+$number-9]: \002[join [lindex [clean $item] 0] { }]\002 ([lindex $item 1])" } append output "\]" return $output } proc statistics::toplist {nickname hostname handle channel arguments} { global lastbind if {(![channel get $channel stat])} { return 0 } set arguments [clean $arguments] set key [lindex $arguments 0] if {![regexp -- {^.*?([0-9]+)$} $lastbind -&gt; number]} { return 0 } if {![regexp -nocase -- {^(palavras|letras|smiles|linhas|)$} $key]} { putserv "PRIVMSG $channel :\[Opção desconhecida: \002$key\002, as opções disponiveis são \002letras\002, \002linhas\002, \002smiles\002 and \002palavras\002\]" return 0 } putserv "PRIVMSG $channel :[top $channel $number [string tolower $key]]" } proc statistics::cleanupdb {args} { variable killafter variable data set killed 0 foreach {item} [array names data] { set lastseen [lindex [clean $data($item)] 0] set expire [expr 60 * 60 * 24 * $killafter] if {[expr [unixtime] - $lastseen] &gt;= $expire} { incr killed unset data($item) } } return $killed } proc statistics::load {} { variable data variable storage regexp -- {^(\S+/)?.*$} $storage -&gt; directory if {[string length $directory] &gt;= 1} { if {![file isdirectory $directory]} { file mkdir $directory } } if {![file exists $storage]} { return 0 } if {[array exists data]} { array unset data } set file [open $storage r] while {![eof $file]} { gets $file line if {[regexp -nocase -- {^channel:(\S+)\sid:(\S+)\svalue: (\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\S+)$} $line -&gt; channel hostname lastseen linhas palavras letras smiles lastnick]} { set data($channel,$hostname) "$lastseen $linhas $palavras $letras $smiles $lastnick" } } close $file } proc statistics::save {args} { variable data variable storage set file [open $storage w] foreach chan_user [array names data] { regexp {^(\S+),(\S+)$} $chan_user -&gt; channel user puts $file "channel:$channel id:$user value:$data($chan_user)" } close $file } proc statistics::clean {i} { regsub -all -- \\\\ $i \\\\\\\\ i regsub -all -- \\\[ $i \\\\\[ i regsub -all -- \\\] $i \\\\\] i regsub -all -- \\\} $i \\\\\} i regsub -all -- \\\{ $i \\\\\{ i return $i } proc statistics::round {num} { if {![string match "*.*" $num]} { return $num\.0 } if {![regexp -- {^(\d+?)\.(\d+)$} $num -&gt; primary secondary]} { error "syntax error in expression '$num'" } set secondary [expr round([string index $secondary 0].[string range $secondary 1 end])] return [expr {($secondary == 10) ? ($primary+1.0) : "$primary.$secondary"}] } statistics::load putlog "Statistics by mifrith"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12929">PePiNo</a> — Sat Jul 17, 2021 6:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
