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

	<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>2008-03-31T20:58:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[timt]]></name></author>
		<updated>2008-03-31T20:58:14-04:00</updated>

		<published>2008-03-31T20:58:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82099#p82099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82099#p82099"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82099#p82099"><![CDATA[
user: thank you, i got it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9809">timt</a> — Mon Mar 31, 2008 8:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-03-31T06:06:00-04:00</updated>

		<published>2008-03-31T06:06:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82093#p82093</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82093#p82093"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82093#p82093"><![CDATA[
<blockquote class="uncited"><div>there would be four or five of them</div></blockquote>Actually, there would be five or six (since my bound commands have an embedded argument (+/-)), but I guess he got the idea <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=2878">user</a> — Mon Mar 31, 2008 6:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[timt]]></name></author>
		<updated>2008-03-30T12:36:04-04:00</updated>

		<published>2008-03-30T12:36:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82085#p82085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82085#p82085"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82085#p82085"><![CDATA[
nml375: very nice, Thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9809">timt</a> — Sun Mar 30, 2008 12:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-03-29T08:55:20-04:00</updated>

		<published>2008-03-29T08:55:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82067#p82067</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82067#p82067"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82067#p82067"><![CDATA[
Actually, both "part" and "sign" add a fifth argument, being the reason stated by the user (or server). The use of args in the second example allows us to use the same proc for all three, as it accepts zero or more arguments, adding it to a list.<br><br>In the first example, should you only have the argument-list of {prefix}, you'd only get errors stating something similar to "too many arguments when calling silence" or such (silence would only expect one argument, but there would be four or five of them on the commandline). Here, args will "swallow" the additional arguments, since we really don't care for them anyway.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Mar 29, 2008 8:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[timt]]></name></author>
		<updated>2008-03-28T23:21:19-04:00</updated>

		<published>2008-03-28T23:21:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82063#p82063</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82063#p82063"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82063#p82063"><![CDATA[
Hi, I saw the following codes in the "Script Requests" section under topic: Set or remove "Silence". I apologize in advance for my stupid questions but i really want to learn/understand tcl.<br><br>By user:<div class="codebox"><p>Code: </p><pre><code>bind join - "#chan *!cservice@undernet.org" {silence +}bind part - "#chan *!cservice@undernet.org" {silence -}bind sign - "#chan *!cservice@undernet.org" {silence -}proc silence {prefix args} {putserv "SILENCE $prefix*!*@*"}</code></pre></div>I know the 2nd argument in the above proc is "args" and it's a special one. I'm trying to understand what's the benefit to have "args" here in the above proc? isn't -&gt; proc silence {prefix} was sufficient?<br><br>also as per tcl-commands doc join/part/sign will have 4 arguments so why   the above proc has {prefix args}?<br><br><br>By Sir_Fz:<div class="codebox"><p>Code: </p><pre><code>set swho *!cservice@undernet.orgbind join - "#channelname $swho" silence:controlbind part - "#channelname $swho" silence:controlbind sign - "#channelname $swho" silence:controlproc silence:control {n u h c args} { if {[llength $args]} {  putserv "SILENCE -*!*@*" } {  putserv "SILENCE *!*@*" }}</code></pre></div>Same silly question here. Why "args" is used here? isn't {n u h c} were enough because as per tcl-commands.doc "join/part/sign" proc will have 4 arguments.<br><br>what's advantage to have args here?<br><br>Thanks again.<br>-timt<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9809">timt</a> — Fri Mar 28, 2008 11:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[timt]]></name></author>
		<updated>2008-03-24T20:36:27-04:00</updated>

		<published>2008-03-24T20:36:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82020#p82020</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82020#p82020"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82020#p82020"><![CDATA[
user and Sir_Fz: Thank you so much, now i'm crystal clear and moving well so far.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9809">timt</a> — Mon Mar 24, 2008 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-03-24T08:44:14-04:00</updated>

		<published>2008-03-24T08:44:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82011#p82011</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82011#p82011"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82011#p82011"><![CDATA[
demond uses [fixargs] to swap between channel-name and text depending on whether the trigger of the procedure was from a pubm or a notc (so he used upvar to be able to change the value of chan and text). I think if $::lastbind is "**" then it's a notc otherwise it's a pub (you'll have to trace his logic).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Mar 24, 2008 8:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-03-24T00:05:26-04:00</updated>

		<published>2008-03-24T00:05:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=82005#p82005</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=82005#p82005"/>
		<title type="html"><![CDATA[Re: codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=82005#p82005"><![CDATA[
<blockquote class="uncited"><div>why $::lastbind == "**" , what this line will do?<br>and what's the purpose to have upvar here in the procedure and what's the benefit?</div></blockquote>The global variable "lastbind" ("$::varname" is just another way to address global variables) is set by eggdrop (see doc/tcl-commands.doc)<br><br>Upvar imports variables from a different scope...in this case the parent scope, so when the variables are changed in the fixargs proc, their values are also changed in the code invoking fixargs.<br><blockquote class="uncited"><div>what's the purpose to have 'hash' and 'md5' here? what this lines will do?</div></blockquote>That's just the way demond chose to do it...if you want his reason, ask him <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (I'm guessing the fact that md5-hashes have a fixed and pretty short length is part of the reason)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Mar 24, 2008 12:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[timt]]></name></author>
		<updated>2008-03-23T22:11:29-04:00</updated>

		<published>2008-03-23T22:11:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81999#p81999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81999#p81999"/>
		<title type="html"><![CDATA[codes reveiw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81999#p81999"><![CDATA[
Hi,<br><br>I'm new in the world of TCL and i'm reading tips section of this forum as well as different documents/tutorials as well to learn tcl language. Now i'm trying to study different scripts to understand the codes. This forum is the best source and a lot of good coders are here to help the users. I chose 2 excellent excellent scripts for my study to understand the codes:<br><br>1: xchannel by demond<br>2: allprotection by Sir_Fz<br><br>I've started xchannel first and i've some silly questions and i hope someone will be able to explain them. Also i think this thread will help other new comers like me as well.<br><br>I would appreciate if someone would explain these codes please, i do understand a bit but still confused. this procedure -&gt; proc fixargs {chan text args} is called from all other procedures like for example:<div class="codebox"><p>Code: </p><pre><code>proc repeat {nick uhost hand chan args} {   variable repeats   fixargs chan text $args...............</code></pre></div>Here is the actrual procedure<div class="codebox"><p>Code: </p><pre><code>proc fixargs {chan text args} {   upvar $chan xchan; upvar $text xtext   if {$::lastbind == "**"} {      set xtext $xchan      set xchan [lindex $args 0]   } {      set n [llength $args]      set xtext [lindex $args [incr n -1]]   }}</code></pre></div>why $::lastbind == "**" , what this line will do?<br>and what's the purpose to have upvar here in the procedure and what's the benefit?<br><br>2:<br><br>I understood this procedure<div class="codebox"><p>Code: </p><pre><code>proc maskhost {nuhost {type 0}} {   scan $nuhost {%[^!]!%[^@]@%s} nick user host   scan [set mask [::maskhost $nuhost]] {%*[^@]@%s} mhost   switch $type {   0 - 1 {return $mask}       ;# *!*foo@*.bar.com   2 {return *!*@$host}       ;# *!*@moo.bar.com   3 {return *!*@$mhost}      ;# *!*@*.bar.com   4 {return *!*$user@$host}  ;# *!*foo@moo.bar.com   5 {return *!*$user@*}      ;# *!*foo@*   6 {return $nuhost}   }}</code></pre></div>but i'm confused when it's set in different procedure like<br><div class="codebox"><p>Code: </p><pre><code>set hash [md5 $chan:$what:[maskhost $nick!$uhost]]</code></pre></div>i mean what's the purpose to have 'hash' and 'md5' here? what this lines will do?<br><br>I think for now its enough for me to digest all this.<br><br>Thank you<br>regards<br>-timt<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9809">timt</a> — Sun Mar 23, 2008 10:11 pm</p><hr />
]]></content>
	</entry>
	</feed>
