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

	<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-10-11T03:07:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2010-10-11T03:07:22-04:00</updated>

		<published>2010-10-11T03:07:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94685#p94685</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94685#p94685"/>
		<title type="html"><![CDATA[Peak.tcl with notice when new peak is achieved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94685#p94685"><![CDATA[
You need to load compat.tcl before peak.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Mon Oct 11, 2010 3:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[coke]]></name></author>
		<updated>2010-10-10T12:36:27-04:00</updated>

		<published>2010-10-10T12:36:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94680#p94680</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94680#p94680"/>
		<title type="html"><![CDATA[Peak.tcl with notice when new peak is achieved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94680#p94680"><![CDATA[
I just tried to use this script and eggdrop says <br><div class="codebox"><p>Code: </p><pre><code>[18:18] invalid command name "date"    while executing"date"    (procedure "load_peak" line 27)    invoked from within"load_peak load"    (file "scripts/peak.tcl" line 199)    invoked from within"source scripts/peak.tcl"    (file "eggdrop.conf" line 264)[18:18] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div>I guess TCL has got updated as the script comes from 1997. Could anyone tell me how to fix this?<br><br>I am looking for a peak script that saves nicklist on peak.<br><br>Thanks in advance!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11380">coke</a> — Sun Oct 10, 2010 12:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-04-11T11:12:40-04:00</updated>

		<published>2005-04-11T11:12:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48009#p48009</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48009#p48009"/>
		<title type="html"><![CDATA[Peak.tcl with notice when new peak is achieved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48009#p48009"><![CDATA[
Hey! Thanks for the quick reply... I don't know much of tCL, but what you wrote makes sense...<br><br>I even tried touse puthelp instead of putquick, but nothing appears when a peak record is set.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><br><br>Is there something wrong?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Mon Apr 11, 2005 11:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-11T02:14:40-04:00</updated>

		<published>2005-04-11T02:14:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47986#p47986</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47986#p47986"/>
		<title type="html"><![CDATA[Peak.tcl with notice when new peak is achieved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47986#p47986"><![CDATA[
Replacing this procedure:<br><div class="codebox"><p>Code: </p><pre><code># On join, check number of users and save it, if it is a peakproc join_peak {nick userhost handle channel} {   global peakfile peak timezone   set channel [string tolower $channel]   set onchannel [llength [chanlist $channel]]   if {![info exist peak(peak!$channel)]} {      if {[file exists ${peakfile}.$channel]} {         set in [open ${peakfile}.$channel r]         set peak(nicks!$channel) [lsort -command icompare [gets $in]]         set peak(peak!$channel) [llength $peak(nicks!$channel)]         set peak(date!$channel) [gets $in]         close $in      } {         set peak(peak!$channel) $onchannel         set peak(date!$channel) "[date] at [time] $timezone"         set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]      }   }   if {$onchannel &gt;= $peak(peak!$channel)} {      set peak(peak!$channel) $onchannel      set peak(date!$channel) "[date] at [time] $timezone"      set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]      set out [open ${peakfile}.$channel w]      puts $out $peak(nicks!$channel)      puts $out $peak(date!$channel)      close $out   }}</code></pre></div><br>To this, by adding an extra line should do it:<br><div class="codebox"><p>Code: </p><pre><code># On join, check number of users and save it, if it is a peakproc join_peak {nick userhost handle channel} {   global peakfile peak timezone   set channel [string tolower $channel]   set onchannel [llength [chanlist $channel]]   if {![info exist peak(peak!$channel)]} {      if {[file exists ${peakfile}.$channel]} {         set in [open ${peakfile}.$channel r]         set peak(nicks!$channel) [lsort -command icompare [gets $in]]         set peak(peak!$channel) [llength $peak(nicks!$channel)]         set peak(date!$channel) [gets $in]         close $in      } {         set peak(peak!$channel) $onchannel         set peak(date!$channel) "[date] at [time] $timezone"         set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]      }   }   if {$onchannel &gt;= $peak(peak!$channel)} {      set peak(peak!$channel) $onchannel      set peak(date!$channel) "[date] at [time] $timezone"      set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]      set out [open ${peakfile}.$channel w]      puts $out $peak(nicks!$channel)      puts $out $peak(date!$channel)      close $out      putquick "NOTICE $channel: Peak on $channel with [llength [chanlist $channel]] users on [date] at [time] $timezone."   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Apr 11, 2005 2:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-04-10T22:41:23-04:00</updated>

		<published>2005-04-10T22:41:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47977#p47977</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47977#p47977"/>
		<title type="html"><![CDATA[Peak.tcl with notice when new peak is achieved]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47977#p47977"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># peak.tclset peakv "23may97"#   Shows the peak usage of a given channel, optionally listing the#   users at that time## Originally: zpeak.tcl## - 10feb97: by zarni &lt;zarni@weirdness.com&gt;# - 23may97: by Ernst &lt;ernstde@sti.com.br&gt;#            - changed name to "peak"#            - multi-channel support (egg1.0)#            - sorts peak userlist alfabetically#            - added '.peak' to DCC#            - added '.peak reset #channel'#            - added timezone var#            - don't save [ctime [unixtime]] but "[date] at [time] $timezone"#              (because I feel better this way :)#            - changed putserv to puthelp (because thats the way it should be)#            - changed PRIVMSG to NOTICE (because it's a bot) (configurable)#            - some other things I don't remember## -- here you can change some things... ---------------------------------------# files to be created to store peak info ($peakfile.#channel)set peakfile ".peakfile"# timezone your bot sits inif {![info exists timezone]} {set timezone "GMT-03"}# flag required to use '!peak' in a channelset pubpeakflag v# flag required to use '.peak reset'set resetpeakflag n# answer to queries via PRIVMSG? (1 = PRIVMSG,  0 = NOTICE)set peak_privmsg 0# show the nicks of the users on the channel at the peak time?# the nicks are always saved so you can toggle at any time.set shownicks 1# -- and here comes the script ------------------------------------------------if {$peak_privmsg} {set peakout "PRIVMSG"} {set peakout "NOTICE"}# Little proc to compare string ignoring case, used in sortingproc icompare {arg1 arg2} { return [string compare [string tolower $arg1] [string tolower $arg2]] }# Loads peak data or resets itproc load_peak { arg } {# load_peak #chan         - Resets channel# load_peak reset         - Resets all# load_peak anything else - Loads everythingglobal peakfile peak timezoneif {[string index $arg 0] == "#"} {set chanlist [lindex $arg 0]if {[file exists ${peakfile}.$chanlist]} { file delete ${peakfile}.$chanlist }} {set chanlist [channels]if {[string tolower $arg] == "reset"} {foreach chan $chanlist {if {[file exists ${peakfile}.$chan]} { file delete ${peakfile}.$chan }}}}foreach chan $chanlist {set chan [string tolower $chan]if {[file exists ${peakfile}.$chan]} {set in [open ${peakfile}.$chan r]set peak(nicks!$chan) [lsort -command icompare [gets $in]]set peak(peak!$chan) [llength $peak(nicks!$chan)]set peak(date!$chan) [gets $in]close $in} {set peak(peak!$chan) [llength [chanlist $chan]]set peak(date!$chan) "[date] at [time] $timezone"set peak(nicks!$chan) [lsort -command icompare [chanlist $chan]]}}}# On join, check number of users and save it, if it is a peakproc join_peak {nick userhost handle channel} {global peakfile peak timezoneset channel [string tolower $channel]set onchannel [llength [chanlist $channel]]if {![info exist peak(peak!$channel)]} {if {[file exists ${peakfile}.$channel]} {set in [open ${peakfile}.$channel r]set peak(nicks!$channel) [lsort -command icompare [gets $in]]set peak(peak!$channel) [llength $peak(nicks!$channel)]set peak(date!$channel) [gets $in]close $in} {set peak(peak!$channel) $onchannelset peak(date!$channel) "[date] at [time] $timezone"set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]}}if {$onchannel &gt;= $peak(peak!$channel)} {set peak(peak!$channel) $onchannelset peak(date!$channel) "[date] at [time] $timezone"set peak(nicks!$channel) [lsort -command icompare [chanlist $channel]]set out [open ${peakfile}.$channel w]puts $out $peak(nicks!$channel)puts $out $peak(date!$channel)close $out}}# Answer to private peak-queries via NOTICEsproc msg_peak {nick userhost handle args} {global peak shownicks peakoutset channel [string tolower [lindex $args 0]]if {$channel == ""} {puthelp "$peakout $nick :Usage: 'peak &lt;channel&gt;'"} {puthelp "$peakout $nick :Peak statistics for $channel."puthelp "$peakout $nick :Peaked at \002$peak(peak!$channel)\002 users on \002$peak(date!$channel)\002 "if {$shownicks == 1} {puthelp "$peakout $nick :Users present: $peak(nicks!$channel)"}}}# Answer to peak-queries via PUBLIC messageproc pub_peak {nick userhost handle channel args} {global peak shownicks peakoutset channel [string tolower $channel]puthelp "$peakout $channel :Peak statistics for $channel."puthelp "$peakout $channel :Peaked at \002$peak(peak!$channel)\002 users on \002$peak(date!$channel)\002"if {$shownicks == 1} {puthelp "$peakout $channel :Users present: $peak(nicks!${channel})"}}# Answer to peak-queries via DCC (or to reset peak data)proc dcc_peak {hand idx arg} {global peak shownicks resetpeakflagset channel [string tolower [lindex $arg 0]]if {$channel == "reset"} {if {[matchattr $hand $resetpeakflag]} {set chan [string tolower [lindex $arg 1]]if { $chan == "all" } {putdcc $idx "Reseting all peak statistics."load_peak resetreturn 1} elseif {[string index $chan 0] == "#"} {putdcc $idx "Reseting peak statistics for $chan."load_peak $chanreturn 1} else {putdcc $idx "Reseting peak statistics for [lindex [console $idx] 0]."load_peak [lindex [console $idx] 0]return 1}} {putdcc $idx "You have no access to this."   return 0}} {if {$channel == ""} { set channel [lindex [console $idx] 0]}if {[lsearch [array names peak] peak!$channel] == -1} {putdcc $idx "No peak statistics for $channel avaliable."return 0} {putdcc $idx "Peak statistics for $channel."putdcc $idx "Peaked at $peak(peak!$channel) users on $peak(date!$channel) "if {$shownicks == 1} {putdcc $idx "Users present: $peak(nicks!$channel)"}return 1}}}bind join - * join_peakbind msg - peak msg_peakbind pub $pubpeakflag !peak pub_peakbind dcc - peak dcc_peak# Sets variables when loadingforeach c [channels] {set chan [string tolower $c]if {![info exists peak(peak!${chan})]} { set peak(peak!${chan}) 0 }if {![info exists peak(date!${chan})]} { set peak(date!${chan}) "" }if {![info exists peak(nicks!${chan})]} { set peak(nicks!${chan}) "" }}# Loads current peak statistics for active channelsload_peak loadputlog "- Peak (v$peakv) by zarni and Ernst loaded"</code></pre></div><br>Now, how do I make this one (quite a nice script!) to notice a channel when a new peak record is achieved?<br>This on records the peak record and persons when the peak was found.... all ok, but I would like a notice when that peak is achieved. Something like:<br><br>Peak on #channel with X users on DATE.<br><br>Can you help me out?<br>Greetz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Sun Apr 10, 2005 10:41 pm</p><hr />
]]></content>
	</entry>
	</feed>
