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

	<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>2006-05-16T15:51:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-16T15:51:39-04:00</updated>

		<published>2006-05-16T15:51:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63094#p63094</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63094#p63094"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63094#p63094"><![CDATA[
what have you tried? Do you have a user/bot named 'Dasha' in the user records of your bot 'Anthem' with an hostname, that always matchs the other bot?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 16, 2006 3:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Igoshin]]></name></author>
		<updated>2006-05-16T09:09:04-04:00</updated>

		<published>2006-05-16T09:09:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63087#p63087</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63087#p63087"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63087#p63087"><![CDATA[
I replace but nothing change. can you give a edited code ? I tell you the two eggdrops. The eggdrop "Dasha" have a statistic.tcl and i want when dasha is down the eggdrop with nickname "Anthem" witch he is in the channel to answer !top10, but if "dasha" is online anthem do not answer to !top10. Can you do this because i can`t.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7755">Igoshin</a> — Tue May 16, 2006 9:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-16T07:48:55-04:00</updated>

		<published>2006-05-16T07:48:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63086#p63086</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63086#p63086"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63086#p63086"><![CDATA[
search at beginning of statistics::spew and statistics::toplist<div class="codebox"><p>Code: </p><pre><code>![channel get $channel stat]</code></pre></div>and replace it to<div class="codebox"><p>Code: </p><pre><code>![channel get $channel stat] || [hand2nick nick1] != ""</code></pre></div>dont forget to replace 'nick1' to the handle of your bot, alternately you can use '[onchan nick1 $channel]', if you dont want to add the bot as a handle a refer check for the primary nick (you will then of course get double replies, if nick1 bot uses its alternate nick).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 16, 2006 7:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Igoshin]]></name></author>
		<updated>2006-05-16T04:20:16-04:00</updated>

		<published>2006-05-16T04:20:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63083#p63083</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63083#p63083"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63083#p63083"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set nomer 10bind time - "* * * * *" time:ChanLimitproc time:ChanLimit {min hour day month year} {    global nomer    foreach chan [channels] {set newlimit [expr [llength [chanlist $chan]] + $nomer]set currentlimit [currentlimit $chan]if {$currentlimit &lt; [expr $newlimit - 1] || $currentlimit &gt; [expr $newlimit + 1]} {    putserv "mode $chan +l $newlimit"}    }    }proc currentlimit {chan} {    set currentmodes [getchanmode $chan]    if {[string match "*l*" [lindex $currentmodes 0]]} {return [lindex $currentmodes end]     }    return 0} putlog "&lt;&lt;&lt; Channel Limit loaded &gt;&gt;&gt;"</code></pre></div> <br>this is firts and second:<div class="codebox"><p>Code: </p><pre><code>  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   -|-  ${trigger}stat   [namespace current]::spew  bind PUB   -|-  ${trigger}top10  [namespace current]::toplist  bind PUB   -|-  ${trigger}top20  [namespace current]::toplist  bind PUBM  -|-  *                [namespace current]::monitor  bind CTCP  -|-  ACTION           [namespace current]::ctcp  bind EVNT  -|-  save             [namespace current]::save  bind TIME  -|-  {00 * * * *}     [namespace current]::cleanupdb  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(words) [regexp -all -- {\S+} $arguments]  set added(letters) [regexp -all -- {\S} $arguments]  if {[string length $smileyregex] &gt;= 1} {    set added(smilies) [regexp -all -- $smileyregex $arguments]  } else {    set added(smilies) 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 lines words letters smilies lastnick  incr lines 1  incr words $added(words)  incr letters $added(letters)  incr smilies $added(smilies)  set data($channel,$hostname) "[unixtime] $lines $words $letters $smilies $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 :\ 7« CTaTucTuka - Unknown User \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 lines words letters smilies lastnick    set wpl [round [expr ($words / $lines.)]]    set spl [round [expr ($smilies / $lines.)]]    set lpw [round [expr ($letters / $words.)]]    putserv "PRIVMSG $channel :\ 7« CTaTucTuka 3a \002$target\002 - \002$lines\002 PeDa, \002$words\002 ($wpl B 4ac) Dymu, \002$letters\002 ($lpw) bykBu, \002$smilies\002 ($spl) ycMuBku\ » "  } else {    putserv "PRIVMSG $channel :\ 7« CTaTucTuka - No valuable information available for \002$target\002\ » "  }}proc statistics::top {channel number {type ""}} {  variable data  set statistics {}  switch $type {    {lines} {set index 1}    {letters} {set index 3}    {smilies} {set index 4}    {default} {set index 2 ; set type "words"}  }  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 "\ 7« Top$number $type - No valuable information available for \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 -- {^(words|letters|smilies|lines|)$} $key]} {    putserv "PRIVMSG $channel : 7« CTaTucTuka - Unknown option: \002$key\002, valid options are \002letters\002, \002lines\002, \002smilies\002 and \002words\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 lines words letters smilies lastnick]} {      set data($channel,$hostname) "$lastseen $lines $words $letters $smilies $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</code></pre></div>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7755">Igoshin</a> — Tue May 16, 2006 4:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-05-15T19:50:30-04:00</updated>

		<published>2006-05-15T19:50:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63066#p63066</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63066#p63066"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63066#p63066"><![CDATA[
<blockquote class="uncited"><div>I don`t remember from where i download but if you want to send you a tcl just say icq number.</div></blockquote>Post the script using <span style="text-decoration:underline">code tags</span> so it can be seen.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon May 15, 2006 7:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Igoshin]]></name></author>
		<updated>2006-05-15T06:06:30-04:00</updated>

		<published>2006-05-15T06:06:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63033#p63033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63033#p63033"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63033#p63033"><![CDATA[
I don`t remember from where i download but if you want to send you a tcl just say icq number.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7755">Igoshin</a> — Mon May 15, 2006 6:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-15T05:39:42-04:00</updated>

		<published>2006-05-15T05:39:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63031#p63031</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63031#p63031"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63031#p63031"><![CDATA[
Not unless you link/post us the script, because we are too lazy to search the exact versions of scripts you refer to <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=2382">De Kus</a> — Mon May 15, 2006 5:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Igoshin]]></name></author>
		<updated>2006-05-15T05:33:49-04:00</updated>

		<published>2006-05-15T05:33:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63029#p63029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63029#p63029"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63029#p63029"><![CDATA[
Sorry but i`m new in this and can you tell me where i must put it. Cam you show me a example.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7755">Igoshin</a> — Mon May 15, 2006 5:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-15T04:32:28-04:00</updated>

		<published>2006-05-15T04:32:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63028#p63028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63028#p63028"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63028#p63028"><![CDATA[
you can simply fetch the binding of any stats script and check if the bot is online by something like 'if {[hand2nick nick1] != ""} {return 1}' (which of courses requires nick1 to be a handle name with a host matching the other bot).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Mon May 15, 2006 4:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Igoshin]]></name></author>
		<updated>2006-05-15T03:55:35-04:00</updated>

		<published>2006-05-15T03:55:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63026#p63026</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63026#p63026"/>
		<title type="html"><![CDATA[Help me to made a tcl.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63026#p63026"><![CDATA[
I have 2 eggdrops first with name nick1 and second with name nick2. In bot nick1 i have statistic.tcl ( for !top10 !stat nickname and this ). And i want when nick1 is down, nick2 ( to answer to !top10 !stat ) and with statistic at nick1. Sorry for my bad eglish. Thanks in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7755">Igoshin</a> — Mon May 15, 2006 3:55 am</p><hr />
]]></content>
	</entry>
	</feed>
