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

	<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>2003-02-18T05:41:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-18T05:41:58-04:00</updated>

		<published>2003-02-18T05:41:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16743#p16743</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16743#p16743"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16743#p16743"><![CDATA[
It would be simpler to combine #1 and #2 together.<br><br>Store current settings in memory. Read them at startup, save them at shutdown, save/read on rehash.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Feb 18, 2003 5:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-02-18T04:40:44-04:00</updated>

		<published>2003-02-18T04:40:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16741#p16741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16741#p16741"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16741#p16741"><![CDATA[
Aren't files also inconvenient? You have to edit the file each time you want to change the setting. You may want to add a dcc command to let the owner change settings from the dcc console. That brings you the ease of use of #3 with the compatibility of #1 and #2.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Feb 18, 2003 4:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mike-c]]></name></author>
		<updated>2003-02-18T04:40:05-04:00</updated>

		<published>2003-02-18T04:40:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16740#p16740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16740#p16740"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16740#p16740"><![CDATA[
hmm... on a slightly different topic, as I'm using the settings files for the moment... how would you count the number of files in a directory? (eg. the number of channels with settings)<br><br>either the search function doesn't like me, I'm blind, or it's not been asked <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br><br>Cheers,<br><br>Mike<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1644">mike-c</a> — Tue Feb 18, 2003 4:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mike-c]]></name></author>
		<updated>2003-02-18T04:19:35-04:00</updated>

		<published>2003-02-18T04:19:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16737#p16737</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16737#p16737"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16737#p16737"><![CDATA[
I've coded it using method #1 (setting files), and it works great....<br><br>I went off #2 as that is actually harder than #1 to change things (requires rehash)<br><br>#3 is the ideal, but if it's only on the cvs release, I guess i'll wait (I'm on 1.6.13 atm)<br><br>when 1.6.14 is out, i'll think about rewriting it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>thanks<br><br>Mike<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1644">mike-c</a> — Tue Feb 18, 2003 4:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-02-18T04:09:50-04:00</updated>

		<published>2003-02-18T04:09:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16736#p16736</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16736#p16736"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16736#p16736"><![CDATA[
For #2, you're best off using arrays. Instead of having channame_setting1 as the var, why not have setting1(channame)? Then your config section will look something like<br><div class="codebox"><p>Code: </p><pre><code>set setting1(#chan1) abcset setting2(#chan1) defset setting1(#chan2) ghiset setting2(#chan2) jklproc info_pub {nick uhost hand chan text} {  global setting1 setting2  set chan [string tolower $chan]  blah blah $setting1($chan)}</code></pre></div>#3 is possible... but only with eggdrop 1.6.14 (current cvs version). Yes, people can access it with using the .chanset dcc command. If you want to do it, it goes something like:<br><div class="codebox"><p>Code: </p><pre><code>setudef str setting1setudef str setting2proc info_pub {nick uhost hand chan text} {  set val [channel get $chan setting1]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Feb 18, 2003 4:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mike-c]]></name></author>
		<updated>2003-02-18T03:20:23-04:00</updated>

		<published>2003-02-18T03:20:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16734#p16734</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16734#p16734"/>
		<title type="html"><![CDATA[Channel-Specific Information]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16734#p16734"><![CDATA[
Hi,<br><br>Please excuse the length of this post, it needs explaining <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I'm looking to write a script that gets channel-specific details, and uses them accordingly...<br><br>I've thought of 3 ways to do this (although i'm not sure if 2 of them are possible):<br><br>1) text file for each channel, 1 setting per line<br>2) have 'set channel_var whatever' in the tcl<br>3) Use .chanset settings<br><br>#1 I'm sure could be done easily, but this is not my preferred option, as it requires the editing of text files to change the settings (without writing fancy text editing code from dcc commands)<br><br>#2 I have attempted - I've tried various things but cannot get it to interpret the settings:<div class="codebox"><p>Code: </p><pre><code>bind pub -|- "!info" Info_pubproc Info_pub {nick uhost hand chan text} {  set channel [string tolower $chan]  set mychannel_setting1 foo  &lt;code goes here&gt;}</code></pre></div>If I use:<div class="codebox"><p>Code: </p><pre><code>set Setting1 $[string trimleft $channel #]_setting1</code></pre></div>the code later on puts this to the channel:<blockquote class="uncited"><div>Channel Info: $mychannel_setting1</div></blockquote>(The channel is #mychannel) - it's returning it as a string, not the value of it.<br><br>Now if I use:<div class="codebox"><p>Code: </p><pre><code>set Setting1 [$[string trimleft $channel #]_setting1]</code></pre></div>I get a tcl error saying<blockquote class="uncited"><div>Tcl error [Info_pub]: invalid command name "$mychannel_setting1"</div></blockquote>No matter what I try, it doesn't return the actual value of the variable... How can this be done? (if it can be)<br><br>#3 is my preferred method, but I'm not sure if it's possible...  Is it possible to store strings using .chanset, like you do with <blockquote class="uncited"><div>.chanset #mychannel need-op ...</div></blockquote>... can you create custom settings?  And then how do you read those settings?<br><br><br>If you managed to read this far, thank you <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">  I'm really stuck on this, i've been trying to solve it all night.  All help appreciated <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Cheers,<br><br>Mike<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1644">mike-c</a> — Tue Feb 18, 2003 3:20 am</p><hr />
]]></content>
	</entry>
	</feed>
