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

	<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>2004-02-12T19:08:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Dw2k]]></name></author>
		<updated>2004-02-12T19:08:52-04:00</updated>

		<published>2004-02-12T19:08:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33537#p33537</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33537#p33537"/>
		<title type="html"><![CDATA[foreach loops help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33537#p33537"><![CDATA[
Yeah thanks. Got it now with a bit a help and poke in the right direction.<br><br>My logic was never good <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2329">Dw2k</a> — Thu Feb 12, 2004 7:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-02-12T18:36:53-04:00</updated>

		<published>2004-02-12T18:36:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33531#p33531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33531#p33531"/>
		<title type="html"><![CDATA[foreach loops help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33531#p33531"><![CDATA[
The logic is just a bit misplaced.<br><br>First loop: go through all the channels. This part is correct.<br><br>Second loop: go through each user in the current user.<br><br>If the user is not an op, print that message and break.<br>Otherwise, print the other message and break.<br><br>As you can see, the 2nd loop is only executed once, no matter what -- it just prints out one of the messages, depending on the first user it looks at.<br><br>You can probably figure it out now. Or ask again if you need more help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Feb 12, 2004 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dw2k]]></name></author>
		<updated>2004-02-12T13:53:25-04:00</updated>

		<published>2004-02-12T13:53:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33520#p33520</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33520#p33520"/>
		<title type="html"><![CDATA[foreach loops help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33520#p33520"><![CDATA[
I have a silly problem, with both my code and my head <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br>My head doesn't understand loops in loops, and neither does my bot, as the code is wrong, anyway I digress...<br><div class="codebox"><p>Code: </p><pre><code>proc cmd:opstatus {nick uhost hand chan args} {global botnick hubchan userchanset message ""foreach channel [channels] {if {[onchan $botnick $channel]} {if {![botisop $channel]} {foreach user [chanlist $channel] {if {![isop $user $channel]} {set message "$message \0034$channel\003"break} elseif {[isop $user $channel]} {set message "$message \00310$channel\003"break} }}}}if {$message != ""} {log "opstatus\: $message"}}</code></pre></div>This is a small scanner that should look at each channel the bot is on and see if it is deop'ed, and if it is, is there any other user oped? It prints out the name of the channel in different colours if there are other ops or if there arent.<br><br>Problem being that is that it ignores this logic and prints out the \0034 line regardless if there are op's or not.<br><br>&lt;/long post&gt;<br><br>Thanks for any help <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=2329">Dw2k</a> — Thu Feb 12, 2004 1:53 pm</p><hr />
]]></content>
	</entry>
	</feed>
