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

	<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>2005-05-06T21:54:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-06T21:54:29-04:00</updated>

		<published>2005-05-06T21:54:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49149#p49149</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49149#p49149"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49149#p49149"><![CDATA[
Glad you understood it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> hopefully next time you'll be able to tweak such things by yourself <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri May 06, 2005 9:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-05-06T20:40:29-04:00</updated>

		<published>2005-05-06T20:40:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49144#p49144</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49144#p49144"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49144#p49144"><![CDATA[
All okay! Thanks... I've been looking at the code... I get what you made... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>You passed all dcc-stuff to pub-stuff... so you have a proc for dcc and another for pub... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Nice!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"> <br>Thanks for the work! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Fri May 06, 2005 8:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-06T20:23:31-04:00</updated>

		<published>2005-05-06T20:23:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49142#p49142</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49142#p49142"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49142#p49142"><![CDATA[
This is probably caused by the uncorrect code format after you pasted it. Try it now (I edited it.).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri May 06, 2005 8:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-05-06T20:15:33-04:00</updated>

		<published>2005-05-06T20:15:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49140#p49140</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49140#p49140"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49140#p49140"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>Tcl error [pub:serveronline]: wrong # args: should be "clock format clockval ?-format string? ?-gmt boolean?"</code></pre></div>this shows up .... the dcc still works, but not the pub... :\<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Fri May 06, 2005 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-06T20:21:12-04:00</updated>

		<published>2005-05-05T17:33:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49071#p49071</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49071#p49071"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49071#p49071"><![CDATA[
try adding this to the script:<div class="codebox"><p>Code: </p><pre><code>bind pub - !bestserver pub:serveronlineproc pub:serveronline {nick uhost hand chan text} {    global server-online serveraddress    # initialise serverlist and serverdata    set serverlist [list]    # if data file exists, read data from file and analyse the data    if { [file exists serveronline.dat] } {       # read data from file       set fileid [open serveronline.dat r]       set serverdata [read $fileid]       close $fileid       # analyse data       set serverdata [split $serverdata "\n"]       foreach line $serverdata {          if { [scan $line "%s %d %d" name distime contime] != 3 } {             continue          }          set servertime [expr $distime - $contime]          if { $servertime &lt; 0 } { continue }          set date [clock format $distime -format "%d-%b-%y %H:%M" -gmt YES]          lappend serverlist [list $name $date $servertime ]       }    }    # if bot is connected add current server    set name $serveraddress    if { $name != "" } {          set curtime [clock seconds]       set servertime [ expr $curtime - ${server-online} ]       set date "&lt;- I am here"       lappend serverlist [list $name $date $servertime]    }    # no valid data?    if { [llength $serverlist] &lt; 1 } {       puthelp "PRIVMSG $chan :No server online data available."       return 1    }    # sort the list: longest connection time comes first    set serverlist [lsort -index 2 -integer -decreasing $serverlist]    # only take first 20 entries    set serverlist [lrange $serverlist 0 19]    # formatting: determine maximum string length of servername    set namelen 0    foreach serverinfo $serverlist {       set servername [lindex $serverinfo 0]       set serverlen [string length $servername]       if { $serverlen &gt; $namelen } { set namelen $serverlen }    }    incr namelen 3    # formatting: rank, servername, onlinetime    append fmtstring %-3d % - $namelen s %-18s %-s    # output the servernames and the respective online times    set count 0    puthelp "PRIVMSG $chan :Servers (host:port), date and time of disconnection and the online times:\r"    foreach serverinfo $serverlist {       incr count       set servername [lindex $serverinfo 0]       set serverdate [lindex $serverinfo 1]       set servertime [duration [lindex $serverinfo 2] ]       set string [format $fmtstring $count $servername $serverdate $servertime]       # seems my telnet client is bugged?       append string "\r"       puthelp "PRIVMSG $chan :$string"   }    puthelp "PRIVMSG $chan :End of servers and the online times.\r" }</code></pre></div>Edit: fixed code format.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 05, 2005 5:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-05-05T15:23:46-04:00</updated>

		<published>2005-05-05T15:23:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49067#p49067</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49067#p49067"/>
		<title type="html"><![CDATA[onlineserver.tcl - best server times (make public command)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49067#p49067"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#---------------------------------------------------------------------# serveronline.tcl# Tcl script for IRC bot eggdrop## A ".bestserver" on the partyline displays a ranking of the servers# with the longest online times (duration of connection between # server and bot).# Upon each disconnect from the ircserver the bot writes the# duration of the connection to a file.## v0: 23-Sep-2003# v1: 27-Sep-2003# v2: 01-Oct-2003# + include current server#---------------------------------------------------------------------package require Tcl 8.4package require eggdrop 1.6.15#---------------------------------------------------------------------# bindings# dcc binding to display result# event binding for logging online time when disconnecting#---------------------------------------------------------------------bind DCC n bestserver dcc:serveronlinebind EVNT - disconnect-server evnt:serveronline#---------------------------------------------------------------------# Upon a disconnect write time and online time to file#---------------------------------------------------------------------proc evnt:serveronline { type } {   global server-online serveraddress   set currenttime [clock seconds]   set fileid [open serveronline.dat a+]   puts $fileid "$serveraddress $currenttime ${server-online}"   close $fileid}#---------------------------------------------------------------------# Analyse the data file and report the respective online times.#---------------------------------------------------------------------proc dcc:serveronline { hand idx text } {   global server-online serveraddress   # initialise serverlist and serverdata   set serverlist [list]   # if data file exists, read data from file and analyse the data   if { [file exists serveronline.dat] } {      # read data from file       set fileid [open serveronline.dat r]      set serverdata [read $fileid]      close $fileid      # analyse data      set serverdata [split $serverdata "\n"]      foreach line $serverdata {         if { [scan $line "%s %d %d" name distime contime] != 3 } {            continue         }         set servertime [expr $distime - $contime]         if { $servertime &lt; 0 } { continue }         set date [clock format $distime -format\            "%d-%b-%y %H:%M" -gmt YES]         lappend serverlist [list $name $date $servertime ]      }   }   # if bot is connected add current server   set name $serveraddress   if { $name != "" } {          set curtime [clock seconds]      set servertime [ expr $curtime - ${server-online} ]       set date "&lt;- I am here"      lappend serverlist [list $name $date $servertime]   }   # no valid data?   if { [llength $serverlist] &lt; 1 } {      putdcc $idx "No server online data available."      return 1   }   # sort the list: longest connection time comes first   set serverlist [lsort -index 2 -integer -decreasing $serverlist]   # only take first 20 entries   set serverlist [lrange $serverlist 0 19]   # formatting: determine maximum string length of servername   set namelen 0   foreach serverinfo $serverlist {      set servername [lindex $serverinfo 0]      set serverlen [string length $servername]      if { $serverlen &gt; $namelen } { set namelen $serverlen }   }   incr namelen 3   # formatting: rank, servername, onlinetime   append fmtstring %-3d % - $namelen s %-18s %-s   # output the servernames and the respective online times   set count 0   putdcc $idx "Servers (host:port), date and time of disconnection\      and the online times:\r"   foreach serverinfo $serverlist {      incr count      set servername [lindex $serverinfo 0]      set serverdate [lindex $serverinfo 1]      set servertime [duration [lindex $serverinfo 2] ]      set string [format $fmtstring $count $servername\         $serverdate $servertime]      # seems my telnet client is bugged?      append string "\r"      putdcc $idx $string   }   putdcc $idx "End of servers and the online times.\r"}putlog "Loaded (version 2): Serveronline."</code></pre></div>My ideia was just to put a !bestserver public command available...<br>how can it be done?<br>greetz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Thu May 05, 2005 3:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
