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

	<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-02-18T07:59:30-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-02-18T07:59:30-04:00</updated>

		<published>2013-02-18T07:59:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101056#p101056</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101056#p101056"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101056#p101056"><![CDATA[
Replace<blockquote class="uncited"><div>foreach n $temp(ignore) { if {[string tolower $nick] == [string tolower $n]} { return } } </div></blockquote>with<blockquote class="uncited"><div>if {[lsearch -nocase $temp(ignore) $nick]} return </div></blockquote>or using my version<blockquote class="uncited"><div>foreach n $temp(ignore) { if {[string match -nocase $nick $n]} { break } }</div></blockquote>This last version is better than the first i made (now its using string match and break) the secod is caesar idea<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Mon Feb 18, 2013 7:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-02-18T07:35:44-04:00</updated>

		<published>2013-02-18T07:35:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101055#p101055</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101055#p101055"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101055#p101055"><![CDATA[
Replace the foreach line with the one I mentioned? <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=187">caesar</a> — Mon Feb 18, 2013 7:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2013-02-18T05:27:50-04:00</updated>

		<published>2013-02-18T05:27:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101054#p101054</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101054#p101054"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101054#p101054"><![CDATA[
So how would the script look like if you add this fix?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Mon Feb 18, 2013 5:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-02-18T05:20:17-04:00</updated>

		<published>2013-02-18T05:20:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101053#p101053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101053#p101053"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101053#p101053"><![CDATA[
There no need to loop inside a list when you have list functions specially made for this kind of operations like <em class="text-italics"><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/lsearch.htm" class="postlink">lsearch</a></em> that will "see if a list contains a particular element".<br><br>Also, to end a loop you should use <em class="text-italics">break</em> not <em class="text-italics">return</em>. There's no need for two transformations of strings in to lower format if you would have used <em class="text-italics">string match -nocase</em> for instance.<br><br>Anyway, the best option would have been a <em class="text-italics">lsearch -nocase</em> like this:<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -nocase $temp(ignore) $nick]} return</code></pre></div>instead of the foreach line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Feb 18, 2013 5:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2013-02-16T09:12:58-04:00</updated>

		<published>2013-02-16T09:12:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101029#p101029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101029#p101029"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101029#p101029"><![CDATA[
Works great! Thank you!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Sat Feb 16, 2013 9:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-02-16T09:00:04-04:00</updated>

		<published>2013-02-16T09:00:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101028#p101028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101028#p101028"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101028#p101028"><![CDATA[
Try this<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - *word* pub_randomset temp(ignore) {"nick1""nick2"}proc pub_random {nick mask hand channel args} {global randommessage tempforeach n $temp(ignore) { if {[string tolower $nick] == [string tolower $n]} { return } }putquick "PRIVMSG $channel :[lindex $randommessage [rand [llength $randommessage]]]"}set randommessage {"Message 1""Message 2""Message 3"}putlog "Random Reply Script Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Sat Feb 16, 2013 9:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x0x]]></name></author>
		<updated>2013-02-16T08:49:15-04:00</updated>

		<published>2013-02-16T08:49:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101027#p101027</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101027#p101027"/>
		<title type="html"><![CDATA[Ignore certain nicks (random reply script)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101027#p101027"><![CDATA[
This script replies to certain words (wildcard) with a random message. I would like to have it ignore a couple of nicknames tho. How to add this?<br><br><div class="codebox"><p>Code: </p><pre><code>bind pubm - *word* pub_randomproc pub_random {nick mask hand channel args} {   global randommessage   putquick "PRIVMSG $channel :[lindex $randommessage [rand [llength $randommessage]]]"   }set randommessage {"Message 1""Message 2""Message 3"}putlog "Random Reply Script Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10486">x0x</a> — Sat Feb 16, 2013 8:49 am</p><hr />
]]></content>
	</entry>
	</feed>
