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

	<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>2002-09-18T10:40:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-09-18T10:40:47-04:00</updated>

		<published>2002-09-18T10:40:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11064#p11064</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11064#p11064"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11064#p11064"><![CDATA[
Yep.. I was looking in the TCL docs on my computer and I found this.<br><blockquote class="uncited"><div><br>Append - To add to a string as a list (myhelpme.file)</div></blockquote>So I played with it for a while and got this: <div class="codebox"><p>Code: </p><pre><code> set asus_times "" if {$days} {  append asus_times "$days "  if {$days == "1"} {   append asus_times "day "   } else {    append asus_times "days "    }   }  if {$hours} {   append asus_times "$hours "   if {$hours == "1"} {    append asus_times "hour "    } else {     append asus_times "hours "    }   } return $asus_times}</code></pre></div>And so on for days minutes hours seconds.. Thanx for all the help guys.. keep it up.<br><br>------------<br>ThePope<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Wed Sep 18, 2002 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-09-18T05:08:31-04:00</updated>

		<published>2002-09-18T05:08:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11050#p11050</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11050#p11050"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11050#p11050"><![CDATA[
You have to make a string together, to return.<br><br>Tcl can't return multiple arguements from a proc, as such, you have to make one.<br><br>IE<div class="codebox"><p>Code: </p><pre><code>return "$day $month $year"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Sep 18, 2002 5:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-09-17T21:25:29-04:00</updated>

		<published>2002-09-17T21:25:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11037#p11037</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11037#p11037"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11037#p11037"><![CDATA[
Yes I understand that stdragon!<br><br>But how do I go around to doing this???<br><br>I have messed around with<br><div class="codebox"><p>Code: </p><pre><code>proc asus_time {time} {set ltime [expr [unixtime] - $time]set seconds [expr $ltime % 60]set ltime [expr ($ltime - $seconds) / 60]set minutes [expr $ltime % 60]set ltime [expr ($ltime - $minutes) / 60]set hours [expr $ltime % 24]set days [expr ($ltime - $hours) / 24]set asus_times ""                if {$day &lt; "1"} {                 set assus_day "days "                } else {                 set sday_day "day "               return $day $asus_day}But I am still a little lost------------ThePope              </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Tue Sep 17, 2002 9:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-09-17T21:03:19-04:00</updated>

		<published>2002-09-17T21:03:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11036#p11036</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11036#p11036"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11036#p11036"><![CDATA[
You've gotta put together a string and return it in your time proc. You calculate all the values, but you don't use them hehe.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Sep 17, 2002 9:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-09-17T20:45:13-04:00</updated>

		<published>2002-09-17T20:45:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11035#p11035</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11035#p11035"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11035#p11035"><![CDATA[
Sorry I forgot something to..<br><br>I know there is a way, but have no idea about doing it!<br><br>So when the bot says the uptime it says it as<br><br>eg : <strong class="text-strong">Online for 1 day 2 hours 23 minutes 13seconds</strong><br><br>and when the bot goes to 2 days it or 2 minutes it changes the (s)<br><br>eg :<strong class="text-strong">Online for 4 days 13 hours 1 minute 2 seconds</strong><br><br>Thanx in Advance<br><br>------------<br>ThePope<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Tue Sep 17, 2002 8:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-09-17T20:40:21-04:00</updated>

		<published>2002-09-17T20:40:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11034#p11034</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11034#p11034"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11034#p11034"><![CDATA[
Thanx for all the help.. I looked up about triggers and found my answer!<br><br>Now for the next problem.. Status.tcl v1.0.0 uptime <br><div class="codebox"><p>Code: </p><pre><code> asus_msg $asus_who "Online for [asus_time $uptime]"</code></pre></div>Now when I write status I get:<br><blockquote class="uncited"><div>(10:37am) &lt;Asustek&gt; Online for 0</div></blockquote>I am not sure what is going on.. I have look around for a TCL that does it.. But I dont get the idea of it..<br><br>This is the <strong class="text-strong">proc asus_time</strong><br><div class="codebox"><p>Code: </p><pre><code>proc asus_time {time} {set ltime [expr [unixtime] - $time]set seconds [expr $ltime % 60]set ltime [expr ($ltime - $seconds) / 60]set minutes [expr $ltime % 60]set ltime [expr ($ltime - $minutes) / 60]set hours [expr $ltime % 24]set days [expr ($ltime - $hours) / 24]}</code></pre></div>Thanx to anyone that can help me!!<br><br>------------<br>ThePope<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Tue Sep 17, 2002 8:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-09-15T16:36:56-04:00</updated>

		<published>2002-09-15T16:36:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10934#p10934</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10934#p10934"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10934#p10934"><![CDATA[
I think you could it by creating a new tcl source command called eggsource for use only in the config file:<br><br>1. Create a new namespace for the script to load into (or maybe a slave interpreter?)<br>2. Import all of the eggdrop vars + procs into that namespace<br>3. Overwrite the "global" command so that it uses namespace vars instead<br>4. Overwrite the bind, unbind, timer, killtimer, etc, so that it keeps track of all binds and timers that exist in that namespace<br>5. Load the script into the new namespace (with a catch {} so that errors do not crash the bot)<br><br>Then the unload command would:<br><br>1. Find the namespace associated with that script<br>2. Delete all timers + binds using the recorded information<br>3. Delete the namespace, so that all the script's variables are reset<br><br>I've been thinking about writing something like this for a while, but haven't gotten around to it. It's part of an "eggdrop package manager" I was thinking about. People could use it to automatically download and install scripts, and then easiliy unload them if they suck.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Sep 15, 2002 4:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-09-15T11:38:43-04:00</updated>

		<published>2002-09-15T11:38:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10920#p10920</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10920#p10920"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10920#p10920"><![CDATA[
<blockquote class="uncited"><div>Egghead, I agree mostly that .rehash is pretty dumb. Another thing that would be nice is an .unload command for scripts that will cancel timers, binds, etc that it produced. It might be kind of tricky, but I think it would be pretty nice.<br><br>Just a suggestion for your freshmint, you might want to kill timers as well.</div></blockquote>Thanks for the suggestion to kill timers too. I've looked briefly into writing an .unload script. It seems the way to go is to parse out any proc definition, binding, timer etc. from the plain text file and then removing it.<br><br>Just as a warning for those who may want to use the freshmint script: when implementing and testing the purging of timers upon a .rehash, some (somewhat old <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> ) scripts produced errors.<br><br>It can happen as follows: somewhere in a script the following statement occurs:<br><div class="codebox"><p>Code: </p><pre><code>set timervar [timer 10 procedure]</code></pre></div>i.e. the variable "timervar" contains the timerID.<br><br>Then somewhere else in the script the following statement is found:<br><div class="codebox"><p>Code: </p><pre><code>if {[info exists timervar]} { killtimer $timervar }</code></pre></div>i.e. if the variable timervar (containing the timerID) exists, it is assumed that the timerID exists and the associated timer is subsequently killed.<br><br>The following situation may occur however: a timer is started and the variable "timervar" is set. Then upon a rehash the freshmint script purges the timer.<br>But the statement [info exists timervar] still does evaluate to 1 (TRUE) however, since the variable still exists even though the associated timer was already purged. The statement "killtimer $timervar" subsequently will produce errors.<br>The way to avoid such error, is to iterate on the list of timers itself and see if the timerid is in it instead of testing on the existence of a variable <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=282">egghead</a> — Sun Sep 15, 2002 11:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-09-15T01:48:28-04:00</updated>

		<published>2002-09-15T01:48:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10902#p10902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10902#p10902"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10902#p10902"><![CDATA[
Egghead, I agree mostly that .rehash is pretty dumb. Another thing that would be nice is an .unload command for scripts that will cancel timers, binds, etc that it produced. It might be kind of tricky, but I think it would be pretty nice.<br><br>Just a suggestion for your freshmint, you might want to kill timers as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Sep 15, 2002 1:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-09-14T18:51:32-04:00</updated>

		<published>2002-09-14T18:51:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10897#p10897</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10897#p10897"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10897#p10897"><![CDATA[
<blockquote class="uncited"><div>The current .restart and .rehash behaviours are correct.<br><br>.rehash is designed to refresh what is contained in the user, channel, notes and config files. IE just re-read file changes.<br></div></blockquote>The current .rehash leads to undesired (i.e. confusing) situations, where binds are not purged. Given the fact that the config file and all tcl scripts are reread, there is no reason to retain old bindings. Thus, the current behaviour is fairly incorrect behaviour, which can lead to error messages with eggdrop complaining that it can't find procedures etc. etc.<br><br>Another serious and very incorrect situation is that on a rehash it appears that the bot doesn't recognise users for the period between "Writing user file..." and the "Userfile loaded, unpacking..." (at least in 1.6.9 <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=282">egghead</a> — Sat Sep 14, 2002 6:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-09-14T18:21:25-04:00</updated>

		<published>2002-09-14T18:21:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10891#p10891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10891#p10891"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10891#p10891"><![CDATA[
The current .restart and .rehash behaviours are correct.<br><br>.rehash is designed to refresh what is contained in the user, channel, notes and config files. IE just re-read file changes.<br><br>.restart is designed to clear memory as well. Due to this, all information regarding connections to servers, userfile information and scripts are lost, thus eggdrop clears up any connections first, avoiding painful timeouts and so on.<br><br>While a .restart is painful to developers on slow connections, they should also be aware, that re-connections can help locate bugs.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Sep 14, 2002 6:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-09-14T06:42:19-04:00</updated>

		<published>2002-09-14T06:42:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10869#p10869</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10869#p10869"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10869#p10869"><![CDATA[
<blockquote class="uncited"><div>If you change the trigger and just do a rehash, the new trigger will be bind but the old one will still be there as well. Do a restart to clear old binds.</div></blockquote>A bit off-topic, but under script development conditions, I've  found it cumbersome to .restart the bot everytime. Especially if the bot connects slowly to a server, in which case one has to wait with testing a script until the bot has reconnected to the server and rejoined a channel. I'm even not sure if it is desired behaviour that the bot keeps old bindings after a .rehash. <br><br>Under script development conditions, I'm now using and testing a script that purges packages/procedures/bindings upon a .rehash. Maybe purging of all "listen"s should be added too. Any feedback is appreciated.<br><br><a href="http://members.fortunecity.com/eggheadtcl/freshmint.tcl.txt" class="postlink">http://members.fortunecity.com/eggheadt ... nt.tcl.txt</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Sat Sep 14, 2002 6:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[slennox]]></name></author>
		<updated>2002-09-14T06:11:29-04:00</updated>

		<published>2002-09-14T06:11:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10868#p10868</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10868#p10868"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10868#p10868"><![CDATA[
If you change the trigger and just do a rehash, the new trigger will be bind but the old one will still be there as well. Do a restart to clear old binds.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13034">slennox</a> — Sat Sep 14, 2002 6:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-09-13T21:07:57-04:00</updated>

		<published>2002-09-13T21:07:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=10865#p10865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=10865#p10865"/>
		<title type="html"><![CDATA[Eggdrop v's Windrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=10865#p10865"><![CDATA[
Hey peoples. I am writing a status TCL that will work with Eggdrop and Windrops. Just got a little problem with the trigger!<br><br>I am running eggdrop 1.6.9 (Lunix 2.4.7-10) and windrop 1.6.6-handle32 (winXp). Both running that TCL but with different triggers. eg: <strong class="text-strong">`status</strong> and <strong class="text-strong">!status</strong><br><br>But when you load both eggdrop and windrop into the same chan and write either of them two triggers. Both bots exec the TCL, so you could say I have a little problem!! I will paste a little just to see if you guys can see where I went wrong (I cant find it).<br><div class="codebox"><p>Code: </p><pre><code>### What is the trigger that you like???### Default: set asus(trig) "!"set asus(trig) "`"### What flag is needed to trigger### Default: set asus(flag) "m"set asus(flag) "m"bind pub $asus(flag) $asus(trig)status asus_pub_statusbind msg $asus(flag) status asus_msg_statusproc asus_pub_status {nick uhost hand chan vasus} { global asus botnick asus_status $nick $uhost $hand $chan $vasus}proc asus_msg_status {nick uhost hand vasus} { global asus botnick set chan [lindex [split $vasus] 0] if {$asus(msgtype) == "2"} {  if {[lindex $vasus 0] == ""} {   puthelp "NOTICE $nick :Usage: /msg $botnick status &lt;#chan&gt;"   return 0   }  } asus_status $nick $uhost $hand $chan $vasus}</code></pre></div>So if I change the <strong class="text-strong">asus(trig)</strong> to another symbol it does the same. Thanx in Advance<br><br>--------------<br>ThePope<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Fri Sep 13, 2002 9:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
