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

	<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>2010-03-09T05:14:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2010-03-09T05:14:33-04:00</updated>

		<published>2010-03-09T05:14:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92440#p92440</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92440#p92440"/>
		<title type="html"><![CDATA[stats.mod and empty spaces]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92440#p92440"><![CDATA[
I'm using the stable one (v1.3)<br><br>I found a tcl script to display statistics from stats.mod, it's easy to fix stats.mod issue from there.<br>I know it would be better to modify C code, but I'm not able to do it.<br><br><div class="codebox"><p>Code: </p><pre><code>#################### stats-public.tcl ############################## Ein schönes TCL was dazu dient um das Stats.mod über## Channelbefehle zu steuern.#### Diese Befehle stehen allen Moderatoren und Operatoren## zu verfügung.#### Settings:## Statistik Befehle## ein: !stats +cmd &lt;top10|ttop10|top20|ttop20|stat|tstat|place|tplace|all&gt;## aus: !stats -cmd &lt;top10|ttop10|top20|ttop20|stat|tstat|place|tplace|all&gt;#### User ausschließen von der Channel-Statistik## ein: !stats +user &lt;nick&gt;## aus: !stats -user &lt;nick&gt;#### User zurücksetzen (resetuser)## reset: !stats reset &lt;nick&gt;###### viel spaß damit## ©2002-2003 by  BlackDeath################### stats-public.tcl ##############################catch "unbind pub - !top10 *pub:!top10"catch "unbind pub - !ttop10 *pub:!ttop10"catch "unbind pub - !top20 *pub:!top20"catch "unbind pub - !ttop20 *pub:!ttop20"catch "unbind pub - !stat *pub:!stat"catch "unbind pub - !tstat *pub:!tstat"catch "unbind pub - !place *pub:!place"catch "unbind pub - !tplace *pub:!tplace"catch "unbind pub - !wordstats *pub:!wordstats"catch "unbind pub - !topwords *pub:!topwords"bind pub - !top10 stats_top10bind pub - !ttop10 stats_ttop10bind pub - !top20 stats_top20bind pub - !ttop20 stats_ttop20bind pub - !stat stats_statbind pub - !tstat stats_tstatbind pub - !place stats_placebind pub - !tplace stats_tplacebind pub - !wordstats stats_wordstatsbind pub - !topwords stats_topwordsproc stats_top10 {nick uhost hand chan rest} {if {[stats_cmd "top10" $chan]} {*pub:!top10 $nick $uhost $hand $chan $rest}}proc stats_ttop10 {nick uhost hand chan rest} {if {[stats_cmd "ttop10" $chan]} {*pub:!ttop10 $nick $uhost $hand $chan $rest}}proc stats_top20 {nick uhost hand chan rest} {if {[stats_cmd "top20" $chan]} {*pub:!top20 $nick $uhost $hand $chan $rest}}proc stats_ttop20 {nick uhost hand chan rest} {if {[stats_cmd "ttop20" $chan]} {*pub:!ttop20 $nick $uhost $hand $chan $rest}}proc stats_stat {nick uhost hand chan rest} {if {[stats_cmd "stat" $chan]} {*pub:!stat $nick $uhost $hand $chan $rest}}proc stats_tstat {nick uhost hand chan rest} {if {[stats_cmd "tstat" $chan]} {*pub:!tstat $nick $uhost $hand $chan $rest}}proc stats_place {nick uhost hand chan rest} {if {[stats_cmd "place" $chan]} {*pub:!place $nick $uhost $hand $chan $rest}}proc stats_tplace {nick uhost hand chan rest} {if {[stats_cmd "tplace" $chan]} {*pub:!tplace $nick $uhost $hand $chan $rest}}proc stats_wordstats {nick uhost hand chan rest} {if {[stats_cmd "wordstats" $chan]} {*pub:!wordstats $nick $uhost $hand $chan $rest}}proc stats_topwords {nick uhost hand chan rest} {if {[stats_cmd "topwords" $chan]} {*pub:!topwords $nick $uhost $hand $chan $rest}}set stats_commands {top10 ttop10 top20 ttop20 stat tstat place tplace wordstats topwords}proc stats_cmd {cmd chan} {global stats_cmdstats_cmd_load $chanset cmd [string tolower $cmd]if {[info exists stats_cmd($chan,$cmd)]} {return $stats_cmd($chan,$cmd)} else {return true}}proc stats_cmd_load {chan} {global stats_cmdglobal stats_commandsif {[info exists stats_cmd($chan,-loaded-)]} { return }set filename [string tolower $chan]set filename "statscom.cmd"catch {set f [open $filename r]while {[gets $f line] &gt;= 0} {set switch [string range $line 0 0]set cmd [string tolower [string range $line 1 end]]set idx [lsearch $stats_commands $cmd]if {$idx &gt;= 0} {switch -- $switch {"+" {set stats_cmd($chan,$cmd) true}"-" {set stats_cmd($chan,$cmd) false}}}}close $f} respset stats_cmd($chan,-loaded-) ""}proc stats_cmd_save {chan} {global stats_cmdglobal stats_commandsset filename [string tolower $chan]set filename "statscom.cmd"catch {set f [open $filename w]foreach cmd [split $stats_commands] {set cmd [string tolower $cmd]set opt "+"if {[info exists stats_cmd($chan,$cmd)]} {if {$stats_cmd($chan,$cmd)} {set opt "+"} else {set opt "-"}}puts $f "${opt}${cmd}"}close $f}}bind pub - !stats stats_switchbind bot - "stats-user" stats_bot_userproc stats_schattr {nick user opt} {if {$opt} {set opt "+list"set opt_str "ein"} else {set opt "-list"set opt_str "aus"}catch {set dcclist [dcclist TELNET]set dcc [lindex $dcclist 0]set xtra [lindex $dcc 4]set port [lindex $xtra 1]set idx [connect localhost $port]set hdl [idx2hand $idx]catch { *dcc:schattr $hdl $idx "$user $opt" } resultafter 1killdcc $idxif {$result != "0"} {return $result}} resultif {$result == ""} {puthelp "NOTICE $nick :Anzeigen der Statistiken für Benutzer $user in allen Räumen ${opt_str}geschaltet"putlog "modpub.tcl: $nick changes $user to $opt"} else {puthelp "NOTICE $nick :Fehler beim Umschalten des Statistiken: $result"}return}proc stats_switch_cmd {nick chan cmd opt} {global stats_cmdglobal stats_commandsstats_cmd_load $chanif {$opt} {set opt_str "ein"} else {set opt_str "aus"}if {[string tolower $cmd] == "all"} {foreach cmd [split $stats_commands] {set cmd [string tolower $cmd ]set stats_cmd($chan,$cmd) $opt}puthelp "NOTICE $nick :Alle Befehle im Raum $chan ${opt_str}geschaltet"stats_cmd_save $chanreturn}set cmd [string tolower $cmd]set idx [lsearch $stats_commands $cmd]if {$idx == -1} {puthelp "NOTICE $nick :Falscher Befehl \"$cmd\""return}set stats_cmd($chan,$cmd) $optputhelp "NOTICE $nick :Der Befehl \"$cmd\" im Raum $chan ${opt_str}geschaltet"stats_cmd_save $chanreturn}proc stats_bot_user {from command arg} {# what are the parametersset cmd [split $arg]set nick [lindex $cmd 0]set user [lindex $cmd 1]set opt [lindex $cmd 2]# do the workstats_schattr $nick $user $opt}proc stats_switch_user {nick user opt} {# inform other bots# do it yourselt, toostats_schattr $nick $user $optreturn 0}proc stats_reset_user {nick chan opt} {resetuser $opt $chanputhelp "NOTICE $nick :Statistiken des Benutzers $opt wurden im Raum $chan zurückgesetzt"}proc stats_switch {nick uhost hand chan rest} {if {![isvoice $nick $chan] &amp;&amp; ![isop $nick $chan]} {puthelp "NOTICE $nick :Dieser Befehl ist nur für Moderatoren"return 0}set lrest [split $rest]set cmd [lindex $lrest 0]set arg [lindex $lrest 1]switch -exact -- $cmd {+cmd { stats_switch_cmd $nick $chan $arg true }-cmd { stats_switch_cmd $nick $chan $arg false }reset { stats_reset_user $nick $chan $arg }+user { stats_switch_user $nick $arg true }-user { stats_switch_user $nick $arg false }}}putlog "stats-public.tcl by BlackDeath loaded..."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Tue Mar 09, 2010 5:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[thommey]]></name></author>
		<updated>2010-03-08T17:41:56-04:00</updated>

		<published>2010-03-08T17:41:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92437#p92437</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92437#p92437"/>
		<title type="html"><![CDATA[stats.mod and empty spaces]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92437#p92437"><![CDATA[
You will have to modify the C code of stats.mod to solve this issue. Which version do you use?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9830">thommey</a> — Mon Mar 08, 2010 5:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2010-03-07T13:15:17-04:00</updated>

		<published>2010-03-07T13:15:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92417#p92417</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92417#p92417"/>
		<title type="html"><![CDATA[stats.mod and empty spaces]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92417#p92417"><![CDATA[
At the end of gseen.conf, after binds, there's some tcl code, 2nd and 3rd "if" are about AI feature, but that part "foreach bnd..." could it be what is doing gseen to work with extra empty spaces?. If so, it maybe would  be the solution to fix stats.mod...<div class="codebox"><p>Code: </p><pre><code>bind chjn - * *chjn:gseenbind chpt - * *chpt:gseencatch "unbind pub - !seen *pub:!seen"catch "unbind pub - !seennick *pub:!seennick"catch "unbind pub - !seenstats *pub:!seenstats"bind pub - ${cmdchar}seen *pub:!seenbind pub - ${cmdchar}seennick *pub:!seennickbind pub - ${cmdchar}seenstats *pub:!seenstatsforeach bnd [binds pubm] {  if {([lindex $bnd 2] == "*pubm:seen") || ([lindex $bnd 2] == "*pub:!seenstats")} {    unbind [lindex $bnd 0] [lindex $bnd 1] [lindex $bnd 2] [lindex $bnd 4]  }}if {${ai-seen-binds} != ""} {  foreach mask ${ai-seen-binds} {    bind pubm -|- "% [subst $mask]" *pubm:seen  }}if {${ai-seenstats-binds} != ""} {  foreach mask ${ai-seenstats-binds} {    bind pubm -|- "% [subst $mask]" *pub:!seenstats  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sun Mar 07, 2010 1:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2010-02-28T07:28:35-04:00</updated>

		<published>2010-02-28T07:28:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92279#p92279</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92279#p92279"/>
		<title type="html"><![CDATA[stats.mod and empty spaces]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92279#p92279"><![CDATA[
Hello,<br><br>this module is IMHO the best stats creator for eggdrop, but there's an issue with it, it doesn't "strip" extra empty spaces, so if someone types a command or a nick followed by more than one empty space, it won't neither recognize command or nick.<br><br>In tcl we can solve this with "set arg [lindex $arg 0]" or something like that, but is there an "easy" way to do it in C?<br><br><span style="text-decoration:underline">note</span>: gseen.mod, from the same author, doesn't have such issue. <br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sun Feb 28, 2010 7:28 am</p><hr />
]]></content>
	</entry>
	</feed>
