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

	<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-05-15T09:48:45-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-05-15T09:48:45-04:00</updated>

		<published>2013-05-15T09:48:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101535#p101535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101535#p101535"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101535#p101535"><![CDATA[
The foreach loop would execute that if statement <strong class="text-strong">n</strong> times (that represents the number of elements in the [channels] result), so this translates into executing that if statement 15 times, when could easily avoid that by those 3 lines that removes the control channel from the list.<br><br>The:<div class="codebox"><p>Code: </p><pre><code>if {$chan != $chn} { ... } </code></pre></div>is a bad idea to compare two strings like that. You should at least make both lower/higher case first, or better use <em class="text-italics">string match -nocase</em> that doesn't care if the two strings are lower/higher case.<em class="text-italics"></em><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed May 15, 2013 9:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-15T05:22:28-04:00</updated>

		<published>2013-05-15T05:22:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101532#p101532</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101532#p101532"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101532#p101532"><![CDATA[
Instead of <br><blockquote class="uncited"><div>   set channels [channels] <br>   set pos [lsearch -nocase $channels $::controlChan] <br>   set channels [lreplace $channels $pos $pos] </div></blockquote>i would really just use (thats why i dont use lsearch that much)<br><div class="codebox"><p>Code: </p><pre><code>if {$chan != $chn} { ... }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Wed May 15, 2013 5:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-05-15T00:53:46-04:00</updated>

		<published>2013-05-15T00:53:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101531#p101531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101531#p101531"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101531#p101531"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set controlChan "#123"bind pub * .all pub:allproc pub:all {nick uhost hand channel text} {   if {![string match -nocase $channel $::controlChan]} returnset channels [channels]set pos [lsearch -nocase $channels $::controlChan]set channels [lreplace $channels $pos $pos]foreach chan $channels {if {![botonchan $chan]} continueputhelp "PRIVMSG $chan :$text"}}</code></pre></div>There. Now it should send that message to all channels except the control one. You should restart the bot as some binds aren't removed by a rehash.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed May 15, 2013 12:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2013-05-14T18:36:34-04:00</updated>

		<published>2013-05-14T18:36:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101529#p101529</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101529#p101529"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101529#p101529"><![CDATA[
<blockquote class="uncited"><div>working fine except.. posting 2 replies.<br><br>i did,<br><br>.all testing final.<br><br><br>reply,<br><br>[03:29:20] &lt;+bot1&gt; test final<br>[03:29:22] &lt;+bot1&gt; final</div></blockquote>You need to .restart your bot. Multiple binds are tiggering now causing that repeat. Both the pub and pubm are surely loaded. The text is being correctly removed from the "pubm" bind, but the "pub" bind is having the first word removed incorrectly. This is evidence that indeed, you have not .restart'ed your bot. <br><div class="codebox"><p>Code: </p><pre><code># main control channelset controlChan "#123"# flags required# global|channelset controlFlags "o|o"# create bind using flags and chanbind pubm $controlFlags "$controlChan .all *" pub:allproc pub:all {nick uhost hand chan text} {   # pubm binds pass entire text, remove .all at front   set text [join [lrange [split $text] 1 end]]   # iterate channels   foreach ch [channels] {      # if bot isn't on channel or channel is control channel, skip      if {![botonchan $ch] || [string equal $ch $::controlChan]} continue      # otherwise, issue text to the channel      puthelp "PRIVMSG $ch :$text"   }}</code></pre></div>Use the code as is and it works. Make sure to .restart before you do so to "clean" the binds out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Tue May 14, 2013 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-14T18:33:17-04:00</updated>

		<published>2013-05-14T18:33:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101528#p101528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101528#p101528"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101528#p101528"><![CDATA[
I was just reparing the bracelet missing... to solve that remove following line<br><br>Set text [join ......]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Tue May 14, 2013 6:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T18:30:32-04:00</updated>

		<published>2013-05-14T18:30:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101527#p101527</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101527#p101527"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101527#p101527"><![CDATA[
working fine except.. posting 2 replies.<br><br>i did,<br><br>.all testing final.<br><br><br>reply,<br><br>[03:29:20] &lt;+bot1&gt; test final<br>[03:29:22] &lt;+bot1&gt; final<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 6:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-14T17:59:19-04:00</updated>

		<published>2013-05-14T17:59:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101526#p101526</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101526#p101526"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101526#p101526"><![CDATA[
Try this<br><div class="codebox"><p>Code: </p><pre><code># main control channelset controlChan "#123"# flags required# global|channelset controlFlags "o|o"# create bind using flags and chanbind pubm $controlFlags "$controlChan .all *" pub:allproc pub:all {nick uhost hand chan text} {# pubm binds pass entire text, remove .all at frontset text [join [lrange [split $text] 1 end]]# iterate channelsforeach ch [channels] {# if bot isn't on channel or channel is control channel, skipif {![botonchan $ch] || [string equal $ch $::controlChan]} continue# otherwise, issue text to the channelputhelp "PRIVMSG $ch :$text"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Tue May 14, 2013 5:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T17:33:00-04:00</updated>

		<published>2013-05-14T17:33:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101525#p101525</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101525#p101525"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101525#p101525"><![CDATA[
Tcl error [pub:all]: missing close-bracket<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 5:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2013-05-14T16:03:13-04:00</updated>

		<published>2013-05-14T16:03:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101524#p101524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101524#p101524"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101524#p101524"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># main control channelset controlChan "#123"# flags required# global|channelset controlFlags "o|o"# create bind using flags and chanbind pubm $controlFlags "$controlChan .all *" pub:allproc pub:all {nick uhost hand chan text} {   # pubm binds pass entire text, remove .all at front   set text [join [lrange [split $text] 1 end]]   # iterate channels   foreach ch [channels] {      # if bot isn't on channel or channel is control channel, skip      if {![botonchan $ch] || [string equal $ch $::controlChan} continue      # otherwise, issue text to the channel      puthelp "PRIVMSG $ch :$text"   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Tue May 14, 2013 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T15:15:38-04:00</updated>

		<published>2013-05-14T15:15:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101523#p101523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101523#p101523"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101523#p101523"><![CDATA[
its replying on all channel! including the 'main channel' twice!<br><br>and it has no o|o status so anyone can use it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 3:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2013-05-14T14:48:10-04:00</updated>

		<published>2013-05-14T14:48:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101521#p101521</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101521#p101521"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101521#p101521"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set controlChan "#123"bind pub * .all pub:allproc pub:all {nick uhost hand channel text} {   if {![string match -nocase $channel $::controlChan]} return   foreach chan [channels] {      if {![botonchan $chan]} continue      puthelp "PRIVMSG $chan :$text"   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue May 14, 2013 2:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T12:53:48-04:00</updated>

		<published>2013-05-14T12:53:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101520#p101520</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101520#p101520"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101520#p101520"><![CDATA[
Tcl error [pub:all]: can't read "chn": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 12:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T12:27:08-04:00</updated>

		<published>2013-05-14T12:27:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101519#p101519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101519#p101519"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101519#p101519"><![CDATA[
same! + the both lines above are same to.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 12:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-05-14T12:15:53-04:00</updated>

		<published>2013-05-14T12:15:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101518#p101518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101518#p101518"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101518#p101518"><![CDATA[
Modify <br><div class="codebox"><p>Code: </p><pre><code>puthelp "PRIVMSG $chan :$text" </code></pre></div>with <br><div class="codebox"><p>Code: </p><pre><code>puthelp "PRIVMSG $chn :$text" </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Tue May 14, 2013 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[true_life]]></name></author>
		<updated>2013-05-14T12:06:48-04:00</updated>

		<published>2013-05-14T12:06:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101517#p101517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101517#p101517"/>
		<title type="html"><![CDATA[one command all channels]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101517#p101517"><![CDATA[
instead of replying to other channels, it is replying to the same channel.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12234">true_life</a> — Tue May 14, 2013 12:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
