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

	<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-08-24T15:50:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-08-24T15:50:05-04:00</updated>

		<published>2003-08-24T15:50:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25603#p25603</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25603#p25603"/>
		<title type="html"><![CDATA[Need a Pro's view on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25603#p25603"><![CDATA[
Ok to start off with, why don't you make it all use 1 file. That will simplify it a lot and naturally lead into using a nicer loop. It looks like each file you have only has 1 line in it. So, just get rid of the open/close stuff and read multiple lines instead of 1.<br><div class="codebox"><p>Code: </p><pre><code>set fp [open botdata r]gets $fp lineset locatebot1 blah blah...gets $fp lineset locatebot2 blah blah...gets $fp lineset locatebot3 ......close $fp</code></pre></div>Get the idea?<br><br>Now once you do that, you will only have 1 file you have to read from and things will already be simpler. The next step would be to use a loop to read the files, but that will come later.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Aug 24, 2003 3:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-08-24T15:23:57-04:00</updated>

		<published>2003-08-24T15:23:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25600#p25600</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25600#p25600"/>
		<title type="html"><![CDATA[Need a Pro's view on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25600#p25600"><![CDATA[
Thats why I'm looking here for help, I'm not exactly sure how the dynamic code would work, I haven't worked much with arrays and lists.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Aug 24, 2003 3:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-08-24T14:20:38-04:00</updated>

		<published>2003-08-24T14:20:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25593#p25593</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25593#p25593"/>
		<title type="html"><![CDATA[Need a Pro's view on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25593#p25593"><![CDATA[
omg....just one little question..<br><br><br>why don't you code DYNAMICLY ?<br><br>search userfile for each user with b flag, then check the bots name and use it as new var...would be less work and easyer to extend<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Sun Aug 24, 2003 2:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-24T13:42:16-04:00</updated>

		<published>2003-08-24T13:42:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25591#p25591</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25591#p25591"/>
		<title type="html"><![CDATA[Need a Pro's view on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25591#p25591"><![CDATA[
Do you need the data to be stored in different files? If so: use an array to store the names and a foreach loop to read them. If not: store everything (for one channel) in one file and just read / output the lines. This way you'll only have one instance of code doing this work. (and only one place to alter if you screw up/decide to change something <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> — Sun Aug 24, 2003 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-08-24T09:47:17-04:00</updated>

		<published>2003-08-24T09:47:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25576#p25576</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25576#p25576"/>
		<title type="html"><![CDATA[Need a Pro's view on this]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25576#p25576"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc list_bots { nick user hand chan arg } {   global botsbot1 botsbot2 botsbot3 botsbot4 botsbot5 botsbot6 botsbot7 botsbot8 botsbot9 botsbot10 mainchanbots mainchannation   global nationbot1 nationbot2   global dbotsbot1 dbotsbot2 dbotsbot3 dbotsbot4 dbotsbot5 dbotsbot6 dbotsbot7 dbotsbot8 dbotsbot9 dbotsbot10   global dnationbot1 dnationbot2   if {$chan == $mainchanbots} {   set fs [open $botsbot1 r]     gets $fs line     set locatebot1 [lindex $line 0]     set locatechar1 [lindex $line 1]     set location1 [lindex $line 2]     set action1 [lrange $line 3 end]   close $fs   set fs [open $botsbot2 r]     gets $fs line     set locatebot2 [lindex $line 0]     set locatechar2 [lindex $line 1]     set location2 [lindex $line 2]     set action2 [lrange $line 3 end]   close $fs   set fs [open $botsbot3 r]     gets $fs line     set locatebot3 [lindex $line 0]     set locatechar3 [lindex $line 1]     set location3 [lindex $line 2]     set action3 [lrange $line 3 end]   close $fs   set fs [open $botsbot4 r]     gets $fs line     set locatebot4 [lindex $line 0]     set locatechar4 [lindex $line 1]     set location4 [lindex $line 2]     set action4 [lrange $line 3 end]   close $fs   set fs [open $botsbot5 r]     gets $fs line     set locatebot5 [lindex $line 0]     set locatechar5 [lindex $line 1]     set location5 [lindex $line 2]     set action5 [lrange $line 3 end]   close $fs   set fs [open $botsbot6 r]     gets $fs line     set locatebot6 [lindex $line 0]     set locatechar6 [lindex $line 1]     set location6 [lindex $line 2]     set action6 [lrange $line 3 end]   close $fs   set fs [open $botsbot7 r]     gets $fs line     set locatebot7 [lindex $line 0]     set locatechar7 [lindex $line 1]      set location7 [lindex $line 2]     set action7 [lrange $line 3 end]   close $fs   set fs [open $botsbot8 r]     gets $fs line     set locatebot8 [lindex $line 0]     set locatechar8 [lindex $line 1]      set location8 [lindex $line 2]     set action8 [lrange $line 3 end]   close $fs   set fs [open $botsbot9 r]     gets $fs line     set locatebot9 [lindex $line 0]     set locatechar9 [lindex $line 1]      set location9 [lindex $line 2]     set action9 [lrange $line 3 end]   close $fs   set fs [open $botsbot10 r]     gets $fs line     set locatebot10 [lindex $line 0]     set locatechar10 [lindex $line 1]      set location10 [lindex $line 2]     set action10 [lrange $line 3 end]   close $fs   putquick "PRIVMSG $chan :\002Format\:\002 \(\0032CharName\003\) \0034Location\003 \(\0036Action of the bot\003\)"   putquick "PRIVMSG $chan :\002$dbotsbot1\:\002 \(\0032$locatechar1\003\) \0034$location1\003 \(\0036$action1\003\)  \002$dbotsbot2\:\002 \(\0032$locatechar2\003\) \0034$location2\003 \(\0036$action2\003\)"   putquick "PRIVMSG $chan :\002$dbotsbot3\:\002 \(\0032$locatechar3\003\) \0034$location3\003 \(\0036$action3\003\)  \002$dbotsbot4\:\002 \(\0032$locatechar4\003\) \0034$location4\003 \(\0036$action4\003\)"   putquick "PRIVMSG $chan :\002$dbotsbot5\:\002 \(\0032$locatechar5\003\) \0034$location5\003 \(\0036$action5\003\)  \002$dbotsbot6\:\002 \(\0032$locatechar6\003\) \0034$location6\003 \(\0036$action6\003\)"   putquick "PRIVMSG $chan :\002$dbotsbot7\:\002 \(\0032$locatechar7\003\) \0034$location7\003 \(\0036$action7\003\)  \002$dbotsbot8\:\002 \(\0032$locatechar8\003\) \0034$location8\003 \(\0036$action8\003\)"   putquick "PRIVMSG $chan :\002$dbotsbot9\:\002 \(\0032$locatechar9\003\) \0034$location9\003 \(\0036$action9\003\)  \002$dbotsbot10\:\002 \(\0032$locatechar10\003\) \0034$location10\003 \(\0036$action10\003\)"   return 0  }   if {$chan == $mainchannation} {   set fs [open $nationbot1 r]     gets $fs line     set locatebot1 [lindex $line 0]     set locatechar1 [lindex $line 1]     set location1 [lindex $line 2]     set action1 [lrange $line 3 end]   close $fs   set fs [open $nationbot2 r]     gets $fs line     set locatebot2 [lindex $line 0]     set locatechar2 [lindex $line 1]     set location2 [lindex $line 2]     set action2 [lrange $line 3 end]   close $fs   putquick "PRIVMSG $chan :\002Format\:\002 \(\0032CharName\003\) \0034Location\003 \(\0036Action of the bot\003\)"   putquick "PRIVMSG $chan :\002$dnationbot1\:\002 \(\0032$locatechar1\003\) \0034$location1\003 \(\0036$action1\003\)  \002$dnationbot2\:\002 \(\0032$locatechar2\003\) \0034$location2\003 \(\0036$action2\003\)"   return 0  }  return 0}</code></pre></div>Ok, basically, I know there is a way to clean this up.  for example, when the bot files are opened, I want it to read it to a list, then on this part:<br><div class="codebox"><p>Code: </p><pre><code>   putquick "PRIVMSG $chan :\002Format\:\002 \(\0032CharName\003\) \0034Location\003 \(\0036Action of the bot\003\)"   putquick "PRIVMSG $chan :\002$dnationbot1\:\002 \(\0032$locatechar1\003\) \0034$location1\003 \(\0036$action1\003\)  \002$dnationbot2\:\002 \(\0032$locatechar2\003\) \0034$location2\003 \(\0036$action2\003\)"</code></pre></div>I want to output the data from the list with a color scheme, if anyone can help me out or gets what I am asking, I could use the help, thanks.  This code allows for two channels.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Sun Aug 24, 2003 9:47 am</p><hr />
]]></content>
	</entry>
	</feed>
