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

	<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>2009-11-28T20:12:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2008-03-06T13:25:26-04:00</updated>

		<published>2008-03-06T13:25:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81484#p81484</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81484#p81484"/>
		<title type="html"><![CDATA[Re: Question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81484#p81484"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set $bans_count 0foreach bans [banlist $chan] {    # can use -nocase option below if you wish case to be irrelevant    if {[string equal -- [lindex [split $bans] 5] [lindex [split $text] 0]]} {        set $bans_count [expr $bans_count + 1]    }}if {$bans_count &gt; 0} {    puthelp "NOTICE $nick :Handle \002[lindex [split $text] 0]\002 has $bans_count bans."} else {    puthelp "NOTICE $nick :Handle \002[lindex [split $text] 0]\002 has \002NO\002 bans."}unset $bans_count</code></pre></div>Without knowing what $bans is to really be doing, as in your code it's serving two purposes?? 1. holding contents of each iteration through the foreach or is it 2. used as a ban counter? It can't do both as your code suggests.<br>In the code I provided above, they are seperated and correctly handles strings and lists as what they really are. If you want more help than this, you need to better express your needs.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"></div></blockquote>You can't use "set $bans_count" like that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Thu Mar 06, 2008 1:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-03-06T04:42:42-04:00</updated>

		<published>2008-03-06T04:42:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81476#p81476</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81476#p81476"/>
		<title type="html"><![CDATA[[SOLVED] Some questions]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81476#p81476"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set count [llength [lsearch -all -exact -index 5 [banlist $chan] [lindex [split $text] 0]]]</code></pre></div>('lsearch -all' requires tcl &gt;= 8.4)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Mar 06, 2008 4:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-03-06T14:51:14-04:00</updated>

		<published>2008-03-06T02:37:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81474#p81474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81474#p81474"/>
		<title type="html"><![CDATA[Re: Question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81474#p81474"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set bans_count 0foreach bans [banlist $chan] {    # can use -nocase option below if you wish case to be irrelevant    if {[string equal -- [lindex [split $bans] 5] [lindex [split $text] 0]]} {        set bans_count [expr $bans_count + 1]    }}if {$bans_count &gt; 0} {    puthelp "NOTICE $nick :Handle \002[lindex [split $text] 0]\002 has $bans_count bans."} else {    puthelp "NOTICE $nick :Handle \002[lindex [split $text] 0]\002 has \002NO\002 bans."}unset bans_count</code></pre></div>Without knowing what $bans is to really be doing, as in your code it's serving two purposes?? 1. holding contents of each iteration through the foreach or is it 2. used as a ban counter? It can't do both as your code suggests.<br>In the code I provided above, they are seperated and correctly handles strings and lists as what they really are. If you want more help than this, you need to better express your needs.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br><br>Edit: Haw, corrected the (obvious, thx metroid) bug regarding improper use of markers when setting variables. (set var != set $var.. my bad).  <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=8138">speechles</a> — Thu Mar 06, 2008 2:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2009-11-28T20:12:12-04:00</updated>

		<published>2008-03-06T01:16:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81473#p81473</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81473#p81473"/>
		<title type="html"><![CDATA[[SOLVED] Some questions]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81473#p81473"><![CDATA[
Hy guys..<br><br>I have 2 question that I`m not sure about the answers... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br><br>How can I match a "lindex" split of the text following the public command with a handle and it's banlist to the eggdrop ?!<br><br>Ex: <br><blockquote class="uncited"><div>(07:13) -&gt; *|egg* banlist ryan<br>(07:13) -|egg- Handle <strong class="text-strong">ryan</strong> has 12 bans</div></blockquote>ryan is [lindex [split $text] 0] in the syntax and also a handle to my eggdrop ... so how should I do it ?! ... this way: <br><div class="codebox"><p>Code: </p><pre><code>foreach bans [banlist $chan] {  set author [lindex $bans 5]  if {$author ==  [lindex [split $text] 0]} {    puthelp "NOTICE $nick :Handle\002 $author  \002has $bans bans"  } else {    puthelp "NOTICE $nick :Handle\002 $author  \002has\002 NO \002 bans"   }}</code></pre></div><br>Is this corect <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Thu Mar 06, 2008 1:16 am</p><hr />
]]></content>
	</entry>
	</feed>
