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

	<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>2013-01-22T14:31:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2013-01-22T14:31:47-04:00</updated>

		<published>2013-01-22T14:31:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100721#p100721</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100721#p100721"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100721#p100721"><![CDATA[
Ceasar:<br>Try the both codes in a logic table.. And read up on De Morgan's law.<br><div class="codebox"><p>Code: </p><pre><code>(!expression_A || !expression_B) =&gt; !(expression_A &amp;&amp; expression_B)</code></pre></div>In extension:<div class="codebox"><p>Code: </p><pre><code>!(!expression_A || !expression_B) =&gt; !(!(expression_A &amp;&amp; expression_B)) =&gt; (expression_A &amp;&amp; expression_B)</code></pre></div><div class="codebox"><p>Code: </p><pre><code>/---+---+------------+---------------------\| A | B | !A or !B   | !(A and B)          || 0 | 0 | 1 or 1 = 1 | !(0 and 0) = !0 = 1 || 0 | 1 | 1 or 0 = 1 | !(0 and 1) = !0 = 1 || 1 | 0 | 0 or 1 = 1 | !(1 and 0) = !0 = 1 || 1 | 1 | 0 or 0 = 0 | !(1 and 1) = !1 = 0 |\---+---+------------+---------------------/</code></pre></div>Edit: Added logic/truth-table<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Jan 22, 2013 2:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-22T11:54:04-04:00</updated>

		<published>2013-01-22T11:54:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100715#p100715</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100715#p100715"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100715#p100715"><![CDATA[
I will do some tests on my own cos I still don't get what's wrong in there. Following my logic I'd would have said that:<div class="codebox"><p>Code: </p><pre><code>      if {![isop $nick $chan] || ![isvoice $nick $chan]} return      # execute code</code></pre></div>if any of the two statements (if the user isn't channel operator or he doesn't have voice) returns true it would <em class="text-italics">return</em>, else would execute code, and:<div class="codebox"><p>Code: </p><pre><code>      if {[isop $nick $chan] || [isvoice $nick $chan]} {        # execute code      }      return 0</code></pre></div>if any of the two statements (if the user is channel operator or he has voice) returns true it would execute code, else would <em class="text-italics">return</em>.<br><br>Edit: you are right. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> I don't understand why this double negation expressions with an <em class="text-italics">or</em> operator works like an <em class="text-italics">and</em> expression, not like an <em class="text-italics">or</em> expression as it should.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jan 22, 2013 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bryanwny]]></name></author>
		<updated>2013-01-22T11:01:59-04:00</updated>

		<published>2013-01-22T11:01:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100714#p100714</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100714#p100714"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100714#p100714"><![CDATA[
Lets just say I didn't and that's that.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br><br>EDIT:  Curiosity got the better of me.  Yes, I killed the bot entirely and reloaded it.  Yes, I made sure 'alter-alice.tcl' was loaded in the .conf after alice.tcl.  As you can see below, I was opped and the bot didn't respond.  Gave myself a + as well, and it answered.  Took the @ away, leaving the +, no response.  Took both the @ and + off, no response.  It would appear that SpiKe is correct.  Sorry caesar!  Psst, you did all the hard work and SpiKe only had to change a couple characters!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> thank you both!<blockquote class="uncited"><div>[10:11am] &lt;@Bryan&gt; ANC hi there!<br>[10:11am] * Bryan sets mode: +v Bryan<br>[10:11am] &lt;@Bryan&gt; ANC hi there!<br>[10:12am] &lt;@ANC&gt; Hello .<br>[10:12am] * Bryan sets mode: -v Bryan<br>[10:12am] &lt;@Bryan&gt; ANC hi how are you?<br>[10:13am] * Bryan sets mode: +v-o Bryan Bryan<br>[10:13am] &lt;+Bryan&gt; ANC whats your name?<br>[10:14am] * ChanServ sets mode: +o Bryan<br>[10:14am] * Bryan sets mode: -v Bryan<br>[10:14am] * Bryan sets mode: -o Bryan<br>[10:15am] &lt;Bryan&gt; ANC hi there!</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12079">bryanwny</a> — Tue Jan 22, 2013 11:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-22T02:08:35-04:00</updated>

		<published>2013-01-22T02:08:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100708#p100708</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100708#p100708"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100708#p100708"><![CDATA[
I have my doubts that bryanwny did the things correctly. Anyway. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jan 22, 2013 2:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-01-22T02:11:03-04:00</updated>

		<published>2013-01-22T02:04:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100707#p100707</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100707#p100707"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100707#p100707"><![CDATA[
double negative with an or operator works like an and, <br>whatever...  mine worked, yours didn't....  nuff said:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Jan 22, 2013 2:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-22T02:07:29-04:00</updated>

		<published>2013-01-22T02:01:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100706#p100706</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100706#p100706"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100706#p100706"><![CDATA[
Read again what I said above about expressions and look then on:<div class="codebox"><p>Code: </p><pre><code>if {![isop $nick $chan] || ![isvoice $nick $chan]} return </code></pre></div>I don't see any &amp;&amp; in there, on ANY of the codes I've posted. I may be dumb but I'm not blind.<br><br>Here's something to see better:<blockquote class="uncited"><div>% set one "0"; set two "0"<br>0<br>% if {$one || $two} { puts "valid" } else { puts "false" }<br>false<br>% if {!$one || !$two} { puts "valid" } else { puts "false" }<br>valid</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jan 22, 2013 2:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-01-22T01:52:37-04:00</updated>

		<published>2013-01-22T01:52:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100705#p100705</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100705#p100705"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100705#p100705"><![CDATA[
Again...  your code required the person to be Both opped And voiced to execute the command.<br>That is Not what the user was shooting for:)<br>I am done arguing though on this string.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Jan 22, 2013 1:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-22T02:00:05-04:00</updated>

		<published>2013-01-22T01:45:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100704#p100704</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100704#p100704"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100704#p100704"><![CDATA[
Really? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> <br><br>According to the expressions <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/expr.htm" class="postlink">page</a>:<blockquote class="uncited"><div>&amp;&amp;<br>    Logical AND. Produces a 1 result if both operands are non-zero, 0 otherwise. Valid for boolean and numeric (integers or floating-point) operands only.<br><br>||<br>    Logical OR. Produces a 0 result if both operands are zero, 1 otherwise. Valid for boolean and numeric (integers or floating-point) operands only. </div></blockquote>Again, your point?<br><div class="codebox"><p>Code: </p><pre><code>if {[isop $nick $chan] || [isvoice $nick $chan]} { execute this code } else { return }</code></pre></div>that translates to check if it's op OR if it's voice and if ANY of the statements returns true then <em class="text-italics">executes this code</em>. If none of the statements returns true then it will simply return.<br><br>that is the same as:<div class="codebox"><p>Code: </p><pre><code>if {![isop $nick $chan] || ![isvoice $nick $chan]} { return } else { execute this code }</code></pre></div>that translates into if the user isn't operator OR isn't voiced then return, else if ANY of the statements returns true then will <em class="text-italics">execute this code</em>.<br><br>The only difference is given by the position of <em class="text-italics">return</em>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jan 22, 2013 1:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-01-22T01:42:08-04:00</updated>

		<published>2013-01-22T01:42:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100703#p100703</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100703#p100703"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100703#p100703"><![CDATA[
not really...  you needed more like this for yours to work correctly:)<br><div class="codebox"><p>Code: </p><pre><code>if {![isop $nick $chan] &amp;&amp; ![isvoice $nick $chan]} return</code></pre></div>The or (||) was what made yours not work. That was my point.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Jan 22, 2013 1:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-22T01:25:11-04:00</updated>

		<published>2013-01-22T01:25:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100701#p100701</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100701#p100701"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100701#p100701"><![CDATA[
yes, that's the opposite of:<div class="codebox"><p>Code: </p><pre><code>if {[isop $nick $chan] || [isvoice $nick $chan]} { </code></pre></div>but instead to continue with that <em class="text-italics">alice:pubquery</em> proc it returns if any of the checks (op or voice) fails.<br><br>Your point?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jan 22, 2013 1:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-01-21T12:26:13-04:00</updated>

		<published>2013-01-21T12:26:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100698#p100698</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100698#p100698"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100698#p100698"><![CDATA[
First chunk of code is wrote so it requires both ops and voice:)<blockquote class="uncited"><div>if {![isop $nick $chan] || ![isvoice $nick $chan]} return</div></blockquote>That will return out, if you <span style="text-decoration:underline">either</span> don't have ops |or| don't have voice, double negatives can be very confusing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Jan 21, 2013 12:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bryanwny]]></name></author>
		<updated>2013-01-21T03:30:58-04:00</updated>

		<published>2013-01-21T03:30:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100692#p100692</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100692#p100692"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100692#p100692"><![CDATA[
caesar, I couldn't remember if maybe I didn't kill/reload the bot and just did a .rehash when i tried your 2nd chunk of code, so I just tried it again with a proper shut down/reload -- it still didn't work for me.  Why?  Beats me!  Like you said, at least it's working now though  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12079">bryanwny</a> — Mon Jan 21, 2013 3:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-01-21T02:00:54-04:00</updated>

		<published>2013-01-21T02:00:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100690#p100690</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100690#p100690"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100690#p100690"><![CDATA[
I don't get it. The code I've wrote and Spike's are basically doing the same thing, just written in a different manner. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> <br><br>Anyway, it's good if it's finally working. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jan 21, 2013 2:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bryanwny]]></name></author>
		<updated>2013-01-20T23:20:01-04:00</updated>

		<published>2013-01-20T23:20:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100685#p100685</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100685#p100685"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100685#p100685"><![CDATA[
That seems to have done the trick, SpiKe!  Thank you everyone for your time and help, much appreciated  <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=12079">bryanwny</a> — Sun Jan 20, 2013 11:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-01-20T22:46:32-04:00</updated>

		<published>2013-01-20T22:46:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100682#p100682</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100682#p100682"/>
		<title type="html"><![CDATA[alice.tcl 1.4.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100682#p100682"><![CDATA[
Try it this way....<br><div class="codebox"><p>Code: </p><pre><code>if {[info commands alice:pubquery] eq ""} {    rename alice:pub_query alice:pubquery    proc alice:pub_query {nick uhost hand chan text} {       if {[isop $nick $chan] || [isvoice $nick $chan]} {        alice:pubquery $nick $uhost $hand $chan $text       }      return 0   } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Jan 20, 2013 10:46 pm</p><hr />
]]></content>
	</entry>
	</feed>
