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

	<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-01-11T09:20:31-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-01-11T09:20:31-04:00</updated>

		<published>2003-01-11T09:20:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15174#p15174</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15174#p15174"/>
		<title type="html"><![CDATA[Help with || (or).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15174#p15174"><![CDATA[
Hi strikelight.<br><br>Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> It works now, I understand what you said. That would explain the ERROR message I was getting.<br><br>- type<p>Statistics: Posted by Guest — Sat Jan 11, 2003 9:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-01-10T20:20:17-04:00</updated>

		<published>2003-01-10T20:20:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15152#p15152</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15152#p15152"/>
		<title type="html"><![CDATA[Re: Help with || (or).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15152#p15152"><![CDATA[
<blockquote class="uncited"><div>Hi guys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Havin a problem (again)  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"> <br><div class="codebox"><p>Code: </p><pre><code>proc check:devoice {nick host hand chan text} {        set devoicenick [lindex $text 0]        if {[matchattr $nick -|m $chan] || [$devoicenick == $nick]} {                putserv "MODE $chan -v $devoicenick"                return 0        } else {                puthelp "NOTICE $nick :Permission denied."        }        return 0}</code></pre></div>It's meant to check if the user who is carrying out the devoice command has either an "m" flag in the channel (which works) or if it is their own nick. I can get it to check if they have the m flag fine - it's the other bit I'm having problems with. I have tried all I can fink of and looked at other peoples scripts. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"> <br><br>Thanks in advance.<br><br>- type.</div></blockquote>Your problem lays in: [$devoicenick == $nick]<br><br>[]'s are used to evaluate TCL commands, not expressions in 'if' statements.<br><br>You simply want: ($devoicenick == $nick)<br>(Parentheses group them together, making the code logic look better)<br><br>And a suggestion... You should have a case insensitive comparison..<br>ie.<br>([string tolower $devoicenick] == [string tolower $nick])<br><br>Note how we use []'s to evaluate the command "string tolower", and leave the expression, == , out of the []'s .<br><br>I know this probably sounds/looks confusing.. But try going over some of the TCL tutorial sites (like suninet's) again and again till you start to see. <br><br>Edit:<br>Noticed another possible downfall... (that is so rampant on this forum it seems)<br>the usage of a list operation on a string.. (set devoicenick [lindex $text 0])<br><br>$text is a string ...<br>lindex is a list operation ...<br><br>You need to first convert text into a list before doing a list operation on it..<br>This is done with "split" ..<br><br>set devoicenick [lindex [split $text] 0]<br><br>and since lindex returns an element in this case which is a string, devoicenick will be a string as well.<br><br>This will help avoid problems you may have encountered with user's who have special characters in their nicks.<br><br>Hope this helps...<br> <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=2005">strikelight</a> — Fri Jan 10, 2003 8:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-01-10T18:49:11-04:00</updated>

		<published>2003-01-10T18:49:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15148#p15148</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15148#p15148"/>
		<title type="html"><![CDATA[Help with || (or).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15148#p15148"><![CDATA[
Hi guys <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Havin a problem (again)  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"> <br><div class="codebox"><p>Code: </p><pre><code>proc check:devoice {nick host hand chan text} {        set devoicenick [lindex $text 0]        if {[matchattr $nick -|m $chan] || [$devoicenick == $nick]} {                putserv "MODE $chan -v $devoicenick"                return 0        } else {                puthelp "NOTICE $nick :Permission denied."        }        return 0}</code></pre></div>It's meant to check if the user who is carrying out the devoice command has either an "m" flag in the channel (which works) or if it is their own nick. I can get it to check if they have the m flag fine - it's the other bit I'm having problems with. I have tried all I can fink of and looked at other peoples scripts. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"> <br><br>Thanks in advance.<br><br>- type.<p>Statistics: Posted by Guest — Fri Jan 10, 2003 6:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
