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

	<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>2014-07-31T06:54:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-07-31T06:54:50-04:00</updated>

		<published>2014-07-31T06:54:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103098#p103098</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103098#p103098"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103098#p103098"><![CDATA[
I think that the utility of the lead :: is essentialy when you use the import/export.<br>And it might be a little bit faster for the tcl to use the full path (::namespace::procedure) than looking in the namespace for the existence of a sub-namespace and then looking in global.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Jul 31, 2014 6:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daigo]]></name></author>
		<updated>2014-07-29T11:09:59-04:00</updated>

		<published>2014-07-29T11:09:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103090#p103090</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103090#p103090"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103090#p103090"><![CDATA[
<blockquote class="uncited"><div>My guess is that the difference is that in the second the <em class="text-italics">respond</em> proc is inside the <em class="text-italics">MyScript</em> namespace.</div></blockquote>Both of them are inside the <em class="text-italics">MyScript</em> namespace (I'm looking at another script that uses the double colons before the <em class="text-italics">MyScript</em> bind). What's interesting is, this script I'm looking at uses <em class="text-italics">global</em>. Here is the script:<br><div class="codebox"><p>Code: </p><pre><code>namespace eval magic8ball {variable 8ballCatch "!8ball"proc 8ball {nick host handle channel arg} {  global 8ballCatch  set cmd [string tolower [lindex $arg 0]]  if {[file exists /eggdrop/scripts/8ball.txt]} {    set list [open /eggdrop/scripts/8ball.txt r]    set reply ""    while {![eof $list]} {      set tmp [gets $list]      set reply [lappend test [string trim $tmp]]    }    close $list  }  set number [rand [expr [llength $reply] + 1]]  puthelp "PRIVMSG $channel :8-ball\: [lindex $reply $number]"}bind pub - $8ballCatch ::magic8ball::8ball}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12410">daigo</a> — Tue Jul 29, 2014 11:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-07-29T10:52:33-04:00</updated>

		<published>2014-07-29T10:52:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103089#p103089</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103089#p103089"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103089#p103089"><![CDATA[
My guess is that the difference is that in the second the <em class="text-italics">respond</em> proc is inside the <em class="text-italics">MyScript</em> namespace.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jul 29, 2014 10:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daigo]]></name></author>
		<updated>2014-07-29T10:29:10-04:00</updated>

		<published>2014-07-29T10:29:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103088#p103088</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103088#p103088"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103088#p103088"><![CDATA[
<blockquote class="uncited"><div>You might like to read:<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=12900" class="postlink">http://forum.egghelp.org/viewtopic.php?t=12900</a></div></blockquote>The article says to use <div class="codebox"><p>Code: </p><pre><code>bind pub - "hi" MyScript::respond </code></pre></div> in their example. What is the difference between using this and <div class="codebox"><p>Code: </p><pre><code>bind pub - "hi" ::MyScript::respond </code></pre></div>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12410">daigo</a> — Tue Jul 29, 2014 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-07-29T08:24:37-04:00</updated>

		<published>2014-07-29T08:24:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103085#p103085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103085#p103085"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103085#p103085"><![CDATA[
You might like to read:<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=12900" class="postlink">http://forum.egghelp.org/viewtopic.php?t=12900</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue Jul 29, 2014 8:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2014-07-28T21:31:20-04:00</updated>

		<published>2014-07-28T21:31:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103079#p103079</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103079#p103079"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103079#p103079"><![CDATA[
An Eggdrop bot can have only One Global Variable named txt<br><br>Usually txt is used in a proc, and that would be a local variable.<br>In most cases, local variables do not interfere with global variables.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Jul 28, 2014 9:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[daigo]]></name></author>
		<updated>2014-07-28T20:40:49-04:00</updated>

		<published>2014-07-28T20:40:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103078#p103078</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103078#p103078"/>
		<title type="html"><![CDATA[Can I use the same variable name for different scripts?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103078#p103078"><![CDATA[
I am running all scripts on one eggdrop bot. Is it okay for me to use the same variable name if they are in different scripts? For instance, if I have this line in one script:<br><div class="codebox"><p>Code: </p><pre><code>set txt [string tolower $txt]</code></pre></div>Can I use the same line of code in another script? Or do I have to change <div class="codebox"><p>Code: </p><pre><code>txt</code></pre></div> to something else?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12410">daigo</a> — Mon Jul 28, 2014 8:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
