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

	<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>2009-03-19T19:26:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-19T19:26:46-04:00</updated>

		<published>2009-03-19T19:26:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87963#p87963</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87963#p87963"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87963#p87963"><![CDATA[
There is an ongoing irc protocol error, namely that the last parameter should be prefixed with a : should it contain any whitespaces..<br><br>Further, you cannot have an array with the same name as a scalar variable (that is, you can't have $chan and $chan(something) ). Also, I believe you intended that array to be in the global namespace (globalspace). Any variable created within a proc will not be available outside the proc, and it's value does not persist in between calls. To access a variable in the global globalspace, prefix the name with the namespace separator ::<br><br>Change this:<div class="codebox"><p>Code: </p><pre><code>putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider)..."</code></pre></div>Into something like this:<div class="codebox"><p>Code: </p><pre><code>putserv "TOPIC $chan :$::chan(header) $::chan(topic) $::chan(divider)..."</code></pre></div>Next, you should only prefix a variable with $ when you intend to do a variable substitution. That means, taking the contents of the variable and inserting it directly into the command line replacing the variable name before the command line is evaluated.<br><br>As such, these lines will cause an error:<div class="codebox"><p>Code: </p><pre><code>set $chan(topic) ...</code></pre></div>Use this instead:<div class="codebox"><p>Code: </p><pre><code>#set the variable in the local namespace, will not persist in between calls:set chan(topic) ...#set the variable in globalspace, which will persist in between calls:set ::chan(topic) ...</code></pre></div>Also, your parameter lists in your proc is in the wrong order. For pub bindings, the order is nickname, host, handle, channel, and text. The names does not matter (with the exeption of "args" - but simply stay away from that for now), just the order.<br><br>Considder this:<div class="codebox"><p>Code: </p><pre><code>proc TOPICDEFAULTS:proc {nick host handle chan text} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Mar 19, 2009 7:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-19T19:11:28-04:00</updated>

		<published>2009-03-19T19:11:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87962#p87962</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87962#p87962"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87962#p87962"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc TOPICDEFAULTS:proc { nick chan host handel text } {  set $chan(topic) "Channel Topic"  set $chan(divider) "||"  set $chan(owner) "The topic"  set $chan(verb) "has"  set $chan(status) "been set."  set $chan(header) "Topic:"  set $chan(static) "Welcome to the channel."  putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"}  proc TOPIC:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(topic) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc HEADER:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(header) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc OWNER:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(owner) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc VERB:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(verb) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc STATUS:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(status) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc STATIC:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(static) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}proc DIVIDER:proc { nick chan host handel text } {  if ([isop $nick $chan]) {    set $chan(divider) $text    putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"  }  else {    putserv "PRIVMSG $chan Error: You are not channel operator."  }}bind pub - "!topic" TOPIC:procbind pub - "!header" HEADER:procbind pub - "!owner" OWNER:procbind pub - "!tdefaults" TOPICDEFAULTS:procbind pub - "!verb" VERB:procbind pub - "!status" STATUS:procbind pub - "!static" STATIC:proc</code></pre></div>here is a script me &amp; my friend wrote <br>can some1 check it i haven't loaded it yet<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Thu Mar 19, 2009 7:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-19T17:50:08-04:00</updated>

		<published>2009-03-19T17:50:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87958#p87958</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87958#p87958"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87958#p87958"><![CDATA[
There is no native database support in eggdrop nor tcl. Tcl does however provide a nice (and in my opininon easy to use) interface for reading and writing to files.<br><br>There are some extensions such as <a href="http://www.xdobry.de/mysqltcl/" class="postlink">mysqltcl</a>, that allows you to communicate with an MySQL database.<br>Also, <a href="http://tcllib.sourceforge.net" class="postlink">tcllib</a> does have an <a href="http://tcllib.sourceforge.net/doc/ini.html" class="postlink">inifile</a> extension that may be of interest.<br><br>Also, if you got some user- or channel-related data, eggdrop does provide some facilities for storing them. For users, they're called the XTRA field (see the <strong class="text-strong">setuser</strong> tcl command), while for channels you can use the <strong class="text-strong">setudef</strong> command to create custom channel settings.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Mar 19, 2009 5:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-19T17:06:13-04:00</updated>

		<published>2009-03-19T17:06:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87956#p87956</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87956#p87956"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87956#p87956"><![CDATA[
<blockquote class="uncited"><div>There are many scripts in the TCL Archive. Search topic and see which one is as close to what your looking for and use it for reference:)<br><br>I use MC_8's topic resync great script.</div></blockquote>starr where do u live in TN i live in savannah<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Thu Mar 19, 2009 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[starr]]></name></author>
		<updated>2009-03-19T09:01:30-04:00</updated>

		<published>2009-03-19T09:01:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87951#p87951</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87951#p87951"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87951#p87951"><![CDATA[
There are many scripts in the TCL Archive. Search topic and see which one is as close to what your looking for and use it for reference:)<br><br>I use MC_8's topic resync great script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8814">starr</a> — Thu Mar 19, 2009 9:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-17T22:52:50-04:00</updated>

		<published>2009-03-17T22:52:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87921#p87921</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87921#p87921"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87921#p87921"><![CDATA[
<blockquote class="uncited"><div>No clue, I don't read mIRC.<br><br>Explain what it does in plain English.</div></blockquote>its a multichan topic script that reads an ini and writes to 1<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Tue Mar 17, 2009 10:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-16T21:58:32-04:00</updated>

		<published>2009-03-16T21:58:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87897#p87897</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87897#p87897"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87897#p87897"><![CDATA[
No clue, I don't read mIRC.<br><br>Explain what it does in plain English.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Mar 16, 2009 9:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T20:15:32-04:00</updated>

		<published>2009-03-16T20:15:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87892#p87892</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87892#p87892"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87892#p87892"><![CDATA[
<blockquote class="uncited"><div>Been there, done that, got the tee shirt (if you mean store in a file)<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=16624" class="postlink">http://forum.egghelp.org/viewtopic.php?t=16624</a><br><br>If you mean to a database proper then you need an addon such as the tcl interface for mysql.</div></blockquote>how would i go about making a multi chan topic script<br><br>here is an mirc 1 i wrote <br><div class="codebox"><p>Code: </p><pre><code>on *:TEXT:!topic *:#: {  if ($nick isop # || $nick ishop #) {   writeini network $+ .ini # topic $2-   topic # $readini($network $+ .ini, #, topic) // $readini($network $+ .ini, #,owner) is $readini($network $+ .ini, #, status) // $readini($network $+ .ini, #, static)  } else msg # Sorry $nick $+ , you must be an OP(@) or HOP(%) to use this command.}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-16T18:58:09-04:00</updated>

		<published>2009-03-16T18:58:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87891#p87891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87891#p87891"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87891#p87891"><![CDATA[
Been there, done that, got the tee shirt (if you mean store in a file)<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=16624" class="postlink">http://forum.egghelp.org/viewtopic.php?t=16624</a><br><br>If you mean to a database proper then you need an addon such as the tcl interface for mysql.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Mar 16, 2009 6:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T17:28:04-04:00</updated>

		<published>2009-03-16T17:28:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87889#p87889</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87889#p87889"/>
		<title type="html"><![CDATA[mirc scripter new to tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87889#p87889"><![CDATA[
hey im Aaron ive been scripting in mirc for a while<br><br>i want to know how to store stuff to a database oor ini or whatever<br><br>like in mirc theirs<br><br> <br><div class="codebox"><p>Code: </p><pre><code>/writeini &lt;file&gt; &lt;section&gt; &lt;item&gt; &lt;value&gt;</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 5:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
