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

	<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>2011-02-27T14:17:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-02-27T14:16:13-04:00</updated>

		<published>2011-02-27T14:16:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96235#p96235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96235#p96235"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96235#p96235"><![CDATA[
<blockquote class="uncited"><div>Thanks guys for the help.<br><br>Using willyw's vsrsion as its the simplest and works great <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>caesar,<br><div class="codebox"><p>Code: </p><pre><code>if {[string tolower $chan] = "#help"} { # do whatever } </code></pre></div>It dont make any difference if the chan name is upper or lower case <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"></div></blockquote>ahh snap.. should have been == not =, meaning:<div class="codebox"><p>Code: </p><pre><code>if {[string tolower $chan] == "#help"} { # do whatever } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Feb 27, 2011 2:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-02-27T13:51:04-04:00</updated>

		<published>2011-02-27T13:51:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96233#p96233</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96233#p96233"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96233#p96233"><![CDATA[
<blockquote class="uncited"><div>willyw,<br>You can simplify that code further, since you've defined "whatever" as a flag.<div class="codebox"><p>Code: </p><pre><code>..if {[channel get "whatever"]} {...</code></pre></div>...</div></blockquote>Cool.  Thanks for coming in.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Now that you mention it, vaguely I remember finding more than one way to do it.<br><br>Honestly, I have no idea where I got that bit of code.  I have no doubt that I borrowed it from someone else's scripts.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sun Feb 27, 2011 1:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-02-27T13:32:18-04:00</updated>

		<published>2011-02-27T13:32:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96232#p96232</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96232#p96232"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96232#p96232"><![CDATA[
willyw,<br>You can simplify that code further, since you've defined "whatever" as a flag.<div class="codebox"><p>Code: </p><pre><code>..if {[channel get "whatever"]} {...</code></pre></div>Gemster,<br>Case-matching with channel names is generally an issue, as on most networks, clients are free to use whatever case they prefer. Also, most irc clients preserve the case the user used to join the channel:<br>Thus, someone joining #help and then typing .help, would then trigger the code, while someone joining #Help (same channel, different case) and then typing .help, would not. That is why you should use the code suggested by Caesar<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Feb 27, 2011 1:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-02-27T11:48:57-04:00</updated>

		<published>2011-02-27T11:48:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96231#p96231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96231#p96231"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96231#p96231"><![CDATA[
<blockquote class="uncited"><div>seems there is a few ways..<br><br>this way is my fav<br>...</div></blockquote><br>I like this one... makes it easy to turn the script ON and OFF, on a per channel basis:<br><div class="codebox"><p>Code: </p><pre><code>setudef flag whateverbind pub - "!command"  someprocproc someproc {nick uhost handle chan text} {    if {([lsearch -exact [channel info $chan] {+whatever}] != -1)} {       # your procedure code       # line by line       # goes here        } }</code></pre></div>Use:<br>.chanset #channel +whatever<br>to enable, on a given channel<br>and<br>.chanset #channel -whatever <br>to disable it on a given channel.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sun Feb 27, 2011 11:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-02-27T11:38:16-04:00</updated>

		<published>2011-02-27T11:38:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96230#p96230</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96230#p96230"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96230#p96230"><![CDATA[
<blockquote class="uncited"><div>...<br>Using willyw's vsrsion as its the simplest and works great <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br>...</div></blockquote>Don't gloss over the word "rough" in my other post above.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I just wanted to get you pointed in the right direction.  <br><br>There could be loopholes to fall through, with what I quickly did.<br>Caesar may very well have a point -  experiment carefully and be sure.<br><br>I'm glad it got you going though.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sun Feb 27, 2011 11:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-02-27T09:26:27-04:00</updated>

		<published>2011-02-27T09:26:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96228#p96228</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96228#p96228"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96228#p96228"><![CDATA[
Thanks guys for the help.<br><br>Using willyw's vsrsion as its the simplest and works great <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>caesar,<br><div class="codebox"><p>Code: </p><pre><code>if {[string tolower $chan] = "#help"} { # do whatever } </code></pre></div>It dont make any difference if the chan name is upper or lower case <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>doggo,<br><br>Some channel have botserv where !help does work.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Sun Feb 27, 2011 9:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doggo]]></name></author>
		<updated>2011-02-27T06:28:01-04:00</updated>

		<published>2011-02-27T06:28:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96226#p96226</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96226#p96226"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96226#p96226"><![CDATA[
seems there is a few ways..<br><br>this way is my fav<br><div class="codebox"><p>Code: </p><pre><code>if {$chan != "#help"} {putquick "privmsg $chan :!help dont work in here;return}//return, with a chan msg explaining whyif {$chan != "#help"} {return}//return, without a channel msg</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11046">doggo</a> — Sun Feb 27, 2011 6:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-02-27T14:17:18-04:00</updated>

		<published>2011-02-27T05:13:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96225#p96225</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96225#p96225"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96225#p96225"><![CDATA[
Since <strong class="text-strong">FOO</strong> is not equal with <strong class="text-strong">foo</strong> you have to either use 'string tolower' on $chan where all upper (or title) case letters are converted to lower case OR 'string equal -nocase' where the strings are compared in a case-insensitive manner.<br><br>Examples:<div class="codebox"><p>Code: </p><pre><code>if {[string tolower $chan] == "#help"} {# do whatever}</code></pre></div>or:<div class="codebox"><p>Code: </p><pre><code>if {[string equal -nocase $chan "#help"]} {# do whatever}</code></pre></div>Edit: fixed minor typo.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Feb 27, 2011 5:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-02-26T22:46:02-04:00</updated>

		<published>2011-02-26T22:46:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96224#p96224</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96224#p96224"/>
		<title type="html"><![CDATA[Re: If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96224#p96224"><![CDATA[
<blockquote class="uncited"><div>...<br>for example if a user types .help in the channel #help the bot will respond but if they type .help in another channel like #lobby it wont respond.<br></div></blockquote>Here's a rough idea  (not tested):<br><div class="codebox"><p>Code: </p><pre><code>bind pub - ".help" fooproc foo {nick uhost handle chan text} {     if {"$chan" != "#help"} {        return        }# whatever other commands you want go here}</code></pre></div>Even though I didn't test it for errors,  I bet you get the idea.  <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=10420">willyw</a> — Sat Feb 26, 2011 10:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gemster]]></name></author>
		<updated>2011-02-26T21:13:43-04:00</updated>

		<published>2011-02-26T21:13:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96223#p96223</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96223#p96223"/>
		<title type="html"><![CDATA[If statment for command only on that channel ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96223#p96223"><![CDATA[
Hi,<br><br>had a look through a links that i have bookmarked from willyw <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>Anyways im looking for an if statment where a command can only responded to on a channel.<br><br>for example if a user types .help in the channel #help the bot will respond but if they type .help in another channel like #lobby it wont respond.<br><br>Thanks<br>Gemster<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11375">Gemster</a> — Sat Feb 26, 2011 9:13 pm</p><hr />
]]></content>
	</entry>
	</feed>
