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

	<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-12-21T15:53:16-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-12-21T15:53:16-04:00</updated>

		<published>2013-12-21T15:53:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102392#p102392</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102392#p102392"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102392#p102392"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc doJoinBinds {} {  # unbind any existing onjoin binds #  foreach jbind [binds fambot:onjoin] {    foreach {typ flg name hit prc} $jbind {  break  }    unbind $typ $flg $name $prc  }  # bind back the current 'family' channels #  foreach line [split [string trim $::family] "\n"] {    bind join - "[lindex [split [string trim $line]] 1] *" fambot:onjoin  }}doJoinBinds</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 21, 2013 3:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-12-21T15:10:45-04:00</updated>

		<published>2013-12-21T15:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102391#p102391</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102391#p102391"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102391#p102391"><![CDATA[
Maybe try this...<br><div class="codebox"><p>Code: </p><pre><code>proc doJoinBinds {} {   foreach line [split [string trim $::family] "\n"] {      bind join - "[lindex [split [string trim $line]] 1] *" fambot:onjoin   }}doJoinBinds</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 21, 2013 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-12-21T15:25:30-04:00</updated>

		<published>2013-12-21T14:33:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102388#p102388</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102388#p102388"/>
		<title type="html"><![CDATA[inspired by beer.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102388#p102388"><![CDATA[
<blockquote class="uncited"><div>I'm learning a lot of tcl principles by looking at your beer.tcl script, but the lack of comments makes it difficult to decipher sometimes xD</div></blockquote>Nice to hear you gather inspiration from my beer:)<br><br>Sorry there are few comments in the script, but at least it's short.<br>I would be glad to answer any specific questions you have about beer.<br>You can always contact me here, or at the contact info in beer.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 21, 2013 2:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mrNobody]]></name></author>
		<updated>2013-12-21T14:32:10-04:00</updated>

		<published>2013-12-21T14:32:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102387#p102387</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102387#p102387"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102387#p102387"><![CDATA[
could anyone tell me how I can bind all those chans to an onjoin event?<br><br>I tried <div class="codebox"><p>Code: </p><pre><code>set famchans [split [string trim $family] "\n"]foreach famchan $famchans {  if {[llength $famchan]&gt;"1"} {    bind join - "[lindex $famchan 1] *" fambot:onjoin  }}</code></pre></div>but that doesn't replace the [lindex $famchan 1] and crashes the bot<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12300">mrNobody</a> — Sat Dec 21, 2013 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2013-12-21T14:22:41-04:00</updated>

		<published>2013-12-21T14:22:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102386#p102386</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102386#p102386"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102386#p102386"><![CDATA[
Worth mentioning,<br>array set expects a valid list of key-value pairs as input. For a trivial case, you'll be able to craft lists by hand; though I generally recommend using the list command for building more complex lists. This is especially important if you have strings containing spaces or brackets/braces.<br><div class="codebox"><p>Code: </p><pre><code>set family [list pubchan "#chan1 here" \  famchan "#chan2 {there}" \  capochan #otherchan \  topchan "We're on the top #chan" \]...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Dec 21, 2013 2:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mrNobody]]></name></author>
		<updated>2013-12-21T14:14:37-04:00</updated>

		<published>2013-12-21T14:14:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102385#p102385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102385#p102385"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102385#p102385"><![CDATA[
oh very interesting nml! I'm gonna look into that as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12300">mrNobody</a> — Sat Dec 21, 2013 2:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2013-12-21T14:11:53-04:00</updated>

		<published>2013-12-21T14:11:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102384#p102384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102384#p102384"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102384#p102384"><![CDATA[
Another option..<div class="codebox"><p>Code: </p><pre><code>set family {   pubchan #chan1   famchan #chan2   capochan #chan3   topchan #chan4}proc test {nick host handle chan text} {  array set fam $::family  puthelp "PRIVMSG $chan :pubchan is $fam(pubchan), famchan is $fam(famchan), capochan is $fam(capochan), topchan is $fam(topchan)"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Dec 21, 2013 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mrNobody]]></name></author>
		<updated>2013-12-21T13:44:31-04:00</updated>

		<published>2013-12-21T13:44:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102383#p102383</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102383#p102383"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102383#p102383"><![CDATA[
thnx spike, works flawlessly :)<br><br>I'm learning a lot of tcl principles by looking at your beer.tcl script, but the lack of comments makes it difficult to decipher sometimes xD<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12300">mrNobody</a> — Sat Dec 21, 2013 1:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-12-21T13:06:05-04:00</updated>

		<published>2013-12-21T13:06:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102380#p102380</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102380#p102380"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102380#p102380"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set family {    pubchan #chan1    famchan #chan2    capochan #chan3    topchan #chan4 } proc test {nick host handle chan args} {    global family    set fam [split [string trim $family] "\n"]    set pubchan [lindex [split [string trim [lsearch -inline $fam "*pubchan *"]]] 1]    set famchan [lindex [split [string trim [lsearch -inline $fam "*famchan *"]]] 1]    set capochan [lindex [split [string trim [lsearch -inline $fam "*capochan *"]]] 1]    set topchan [lindex [split [string trim [lsearch -inline $fam "*topchan *"]]] 1]    putserv "PRIVMSG $chan :pubchan is $pubchan, famchan is $famchan, capochan is $capochan, topchan is $topchan" } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Dec 21, 2013 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2013-12-21T12:55:40-04:00</updated>

		<published>2013-12-21T12:55:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102379#p102379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102379#p102379"/>
		<title type="html"><![CDATA[Re: lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102379#p102379"><![CDATA[
<blockquote class="uncited"><div>...<br> How can I get all the values  I want?</div></blockquote><br>Experiment with:<br><div class="codebox"><p>Code: </p><pre><code>set family [list {pubchan #chan1} {famchan #chan2} {capochan #chan3} {topchan #chan4} ]bind pub - "!mrnobody" mrnobodyproc mrnobody {nick host handle chan args} {global family        set pubchan [lindex [lsearch -inline $family "pubchan* *"] 1]        set famchan [lindex [lsearch -inline $family "famchan* *"] 1]        set capochan [lindex [lsearch -inline $family "capochan* *"] 1]        set topchan [lindex [lsearch -inline $family "topchan* *"] 1]        putserv "PRIVMSG $chan :pubchan is $pubchan, famchan is $famchan, capochan is $capochan, topchan is $topchan"     }</code></pre></div>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat Dec 21, 2013 12:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mrNobody]]></name></author>
		<updated>2013-12-21T11:58:15-04:00</updated>

		<published>2013-12-21T11:58:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102378#p102378</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102378#p102378"/>
		<title type="html"><![CDATA[lsearch help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102378#p102378"><![CDATA[
Okay, I'm almost afraid to make yet another topic :$ I used search and couldn't find an answer, so here we go:<br><br>I have this piece of code:<div class="codebox"><p>Code: </p><pre><code>set family {pubchan #chan1famchan #chan2capochan #chan3topchan #chan4}proc test {nick host handle chan args} {global familyset family [split [string trim $family] "\n"]set pubchan [lindex [lsearch -inline $family "pubchan* *"] 1]set famchan [lindex [lsearch -inline $family "famchan* *"] 1]set capochan [lindex [lsearch -inline $family "capochan* *"] 1]set topchan [lindex [lsearch -inline $family "topchan* *"] 1]putserv "PRIVMSG $chan :pubchan is $pubchan, famchan is $famchan, capochan is $capochan, topchan is $topchan"}</code></pre></div>Now that only works for pubchan, everything else returns an empty string. How can I get all the values  I want?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12300">mrNobody</a> — Sat Dec 21, 2013 11:58 am</p><hr />
]]></content>
	</entry>
	</feed>
