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

	<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>2003-02-13T08:31:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-13T08:31:20-04:00</updated>

		<published>2003-02-13T08:31:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16539#p16539</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16539#p16539"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16539#p16539"><![CDATA[
hmm..<br><br>i loaded the tcl with the proc by .tcl source ... and it didnt work..after a bot restart it works fine now...thanks ppslim<br><br>this is the code i use now :<div class="codebox"><p>Code: </p><pre><code>bind pub -|- !traffic traffic_pubproc gettraffic {type direction time} {    set d 0    set t 0    switch -- [string tolower $direction] {       "in" { set d 1 }       "out" { set d 3 }       default { error "Invalid direction used" }    }    switch -- [string tolower $time] {       "today" { set t 0 }       "total" { set t 1 }       default { error "Invalid value type given" }    }    set traf [traffic]    if {[set idx [lsearch $traf "$type *"]] &lt; 0} {       error "Invalid traffic type given"    }    return [lindex [lindex $traf $idx] [expr $d + $t]] } proc traffic_pub { nick uhost hand chan text } {    set totaltrafficin [gettraffic total in total]   set todaytrafficin [gettraffic total in today]   set totaltrafficout [gettraffic total out total]   set todaytrafficout [gettraffic total out today]      set totaltrafficin [calc_mb $totaltrafficin]   set todaytrafficin [calc_mb $todaytrafficin]   set totaltrafficout [calc_mb $totaltrafficout]   set todaytrafficout [calc_mb $todaytrafficout]   putserv "PRIVMSG $chan :Total : $totaltrafficin in, $totaltrafficout out"    putserv "PRIVMSG $chan :Today : $todaytrafficin in, $todaytrafficout out" } proc calc_mb { wert } {if {[expr $wert &gt; 1024] &amp;&amp; [expr $wert &lt; 1048576]} {   set wert [expr $wert / 1024]   lappend wert KB   } else {   if {[expr $wert &gt; 1048576]} {      set wert [expr $wert / 1048576]      lappend wert MB   }   } return $wert}</code></pre></div>it works really fine for me, even the unit calculation (my first math function <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> ).<br><br>thanks ppslim for helping me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Thu Feb 13, 2003 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-13T07:36:23-04:00</updated>

		<published>2003-02-13T07:36:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16535#p16535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16535#p16535"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16535#p16535"><![CDATA[
Oh. Sorry then. Just ignore my last post. <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=187">caesar</a> — Thu Feb 13, 2003 7:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-13T07:24:34-04:00</updated>

		<published>2003-02-13T07:24:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16534#p16534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16534#p16534"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16534#p16534"><![CDATA[
My question is aimed at GodOfSuicide, as it's only him getting the errors now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Feb 13, 2003 7:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-13T07:03:36-04:00</updated>

		<published>2003-02-13T07:03:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16533#p16533</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16533#p16533"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16533#p16533"><![CDATA[
I get the normal result for irc in or out. I get 0 for botnet cos in fact it's 0, due the fact that is not linked to any bots.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 13, 2003 7:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-13T06:56:42-04:00</updated>

		<published>2003-02-13T06:56:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16532#p16532</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16532#p16532"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16532#p16532"><![CDATA[
botnet is a vlid type, regardless of the fact you are using a botnet or not.<br><br>No matter if you are, or not using a botnet, the code is still there. All traffic counter, will ramin at 0 as posted.<br><br>If you have any specific code, that generates the error, you should post it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Feb 13, 2003 6:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-13T06:45:51-04:00</updated>

		<published>2003-02-13T06:45:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16531#p16531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16531#p16531"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16531#p16531"><![CDATA[
I just loaded the tcl and .rehash'ed and got the same results as egghead did on the botnet thing, cos I don't have it linked to any bots.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 13, 2003 6:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-02-13T06:28:42-04:00</updated>

		<published>2003-02-13T06:28:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16529#p16529</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16529#p16529"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16529#p16529"><![CDATA[
Like caesar I've used the following code:<br><div class="codebox"><p>Code: </p><pre><code>proc gettraffic {type direction time} {    set d 0    set t 0    switch -- [string tolower $direction] {       "in" { set d 1 }       "out" { set d 3 }       default { error "Invalid direction used" }    }    switch -- [string tolower $time] {       "today" { set t 0 }       "total" { set t 1 }       default { error "Invalid value type given" }    }    set traf [traffic]    putlog "TRAFFIC: $traf"   if {[set idx [lsearch $traf "$type *"]] &lt; 0} {       error "Invalid traffic type given"    }    return [lindex [lindex $traf $idx] [expr $d + $t]] } </code></pre></div>restart/rehash your bot and then<br><blockquote class="uncited"><div>*** egghead joined the party line.<br>.tcl putlog "[gettraffic botnet out total]" <br>[05:27] 0</div></blockquote>This is a bot not linked to a botnet.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Feb 13, 2003 6:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-13T06:12:06-04:00</updated>

		<published>2003-02-13T06:12:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16527#p16527</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16527#p16527"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16527#p16527"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>.tcl putlog "[gettraffic botnet out total]"</code></pre></div>gave me an error</div></blockquote>What error did you get?</div></blockquote>invalid traffic type<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Thu Feb 13, 2003 6:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-13T04:41:56-04:00</updated>

		<published>2003-02-13T04:41:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16521#p16521</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16521#p16521"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16521#p16521"><![CDATA[
I'm running a eggdrop 1.6.13 and works smoothly. Also your pub proc works to.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 13, 2003 4:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-02-13T02:37:22-04:00</updated>

		<published>2003-02-13T02:37:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16519#p16519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16519#p16519"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16519#p16519"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>.tcl putlog "[gettraffic botnet out total]"</code></pre></div>gave me an error</div></blockquote>What error did you get?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Feb 13, 2003 2:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-12T18:28:49-04:00</updated>

		<published>2003-02-12T18:28:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16509#p16509</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16509#p16509"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16509#p16509"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>.tcl putlog "[gettraffic botnet out total]"</code></pre></div>gave me an error<br>also did<div class="codebox"><p>Code: </p><pre><code>proc traffic_pub { nick uhost hand chan text } {set IRCfromSERVERtoday [gettraffic irc in today] putserv "notice $nick :$IRCfromSERVERtoday"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Wed Feb 12, 2003 6:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-12T18:11:49-04:00</updated>

		<published>2003-02-12T18:11:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16507#p16507</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16507#p16507"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16507#p16507"><![CDATA[
Please show the exact command you are using, as it works for me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Feb 12, 2003 6:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-12T17:37:39-04:00</updated>

		<published>2003-02-12T17:37:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16506#p16506</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16506#p16506"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16506#p16506"><![CDATA[
still doesnt work for me....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Wed Feb 12, 2003 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-12T14:19:35-04:00</updated>

		<published>2003-02-12T14:19:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16492#p16492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16492#p16492"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16492#p16492"><![CDATA[
Sorry - my fault. I do remember thinking about it, but got sidetracked when I spotted a correction.<br><br>CHange <div class="codebox"><p>Code: </p><pre><code>if {[set idx [lsearch $traf $type]] &lt; 0} {</code></pre></div>to<div class="codebox"><p>Code: </p><pre><code>if {[set idx [lsearch $traf "$type *"]] &lt; 0} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Feb 12, 2003 2:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-12T13:45:26-04:00</updated>

		<published>2003-02-12T13:45:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16490#p16490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16490#p16490"/>
		<title type="html"><![CDATA[Traffic Script...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16490#p16490"><![CDATA[
when i use this i allways get<div class="codebox"><p>Code: </p><pre><code>Tcl error [traffic_pub]: Invalid traffic type given</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Wed Feb 12, 2003 1:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
