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

	<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-01T17:56:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-11-01T17:04:01-04:00</updated>

		<published>2009-11-01T17:04:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90742#p90742</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90742#p90742"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90742#p90742"><![CDATA[
Upon putting thought into this it dawned on me why this happens. The order in which rss-synd does the foreaching on it's lists doesn't occur in the order required to do this as easily as I thought.<div class="codebox"><p>Code: </p><pre><code>proc ::rss-synd::feed_msg {type msgs targets {nick ""}} {   # check if our target is a nick   if {(($nick != "") &amp;&amp; \        ($targets == "")) || \       ([regexp -- {[23]} $type])} {      set targets $nick   }   foreach msg $msgs {      foreach chan $targets {         if {([catch {botonchan $chan}] == 0) || \             ([regexp -- {^[#&amp;]} $chan] == 0)} {            # is this the first time we set the chan +S ?            if {![info exists did_we_s($chan)]} {              # yes, make note so we don't do it again              # and we can undo it later.              set did_we_s($chan) 0              # set the mode              putserv "MODE $chan +S"            }            foreach line [split $msg "\n"] {               if {($type == 1) || ($type == 3)} {                  putserv "NOTICE $chan :$line"               } else {                  putserv "PRIVMSG $chan :$line"               }            }         }      }   }   # did we make a list of chans to undo +S in?   if {[array exists did_we_s]} {      # yes, iterate them all      foreach c [array names did_we_s] {         # set the mode         putserv "MODE $c -S"      }   }}</code></pre></div>This will do it, and I've commented the sections I've added to explain why they are there. This uses a simple array to keep track of which channels have been set +S. After sending all messages, this array is run through setting all channels -S. Have a fun. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Nov 01, 2009 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-11-01T17:00:22-04:00</updated>

		<published>2009-11-01T17:00:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90741#p90741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90741#p90741"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90741#p90741"><![CDATA[
<blockquote class="uncited"><div>if there is just 1 rss feed, it works fine, but if there is more than 2... we have a problem (the same)]</div></blockquote>Look at my post above, use that code. It does it just fine. Put the mode changes outside the foreach. Use the same queue that the messages inside the foreach are using. This works.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Nov 01, 2009 5:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2009-11-01T16:50:20-04:00</updated>

		<published>2009-11-01T16:50:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90740#p90740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90740#p90740"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90740#p90740"><![CDATA[
<img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_idea.gif" width="15" height="15" alt=":idea:" title="Idea"> <blockquote class="uncited"><div>pushmode &lt;channel&gt; &lt;mode&gt; [arg]<br>Description: sends out a channel mode change (ex: pushmode #lame +o goober) through the bot's queuing system. All the mode changes will be sent out at once (combined into one line as much as possible) after the script finishes, or when 'flushmode' is called.</div></blockquote> sud work out better<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Sun Nov 01, 2009 4:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Conc]]></name></author>
		<updated>2009-11-01T16:10:16-04:00</updated>

		<published>2009-11-01T16:10:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90739#p90739</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90739#p90739"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90739#p90739"><![CDATA[
if there is just 1 rss feed, it works fine, but if there is more than 2... we have a problem (the same)<br><br>1 rss feed:<blockquote class="uncited"><div>* Egg sets mode -S<br>&lt;Egg&gt; RSS ..... blabla<br>* Egg sets mode +S</div></blockquote>+2 rss feed:<blockquote class="uncited"><div>* Egg sets mode -S<br>&lt;Egg&gt; RSS ..... blabla<br>* Egg sets mode +S<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>(...)</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10932">Conc</a> — Sun Nov 01, 2009 4:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-11-01T17:56:23-04:00</updated>

		<published>2009-11-01T15:31:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90738#p90738</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90738#p90738"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90738#p90738"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>* Egg sets mode -S<br>* Egg sets mode +S<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>(...)</div></blockquote> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"></div></blockquote>Lmfao, I forgot priority's here, using the same queue will work.<div class="codebox"><p>Code: </p><pre><code># the putserv version is here. This is the code you should# be using.. The same queue is used for everything.proc ::rss-synd::feed_msg {type msgs targets {nick ""}} {   # check if our target is a nick   if {(($nick != "") &amp;&amp; \        ($targets == "")) || \       ([regexp -- {[23]} $type])} {      set targets $nick   }   foreach msg $msgs {      foreach chan $targets {         if {([catch {botonchan $chan}] == 0) || \             ([regexp -- {^[#&amp;]} $chan] == 0)} {            putserv "MODE $chan -S"            foreach line [split $msg "\n"] {               if {($type == 1) || ($type == 3)} {                  putserv "NOTICE $chan :$line"               } else {                  putserv "PRIVMSG $chan :$line"               }            }            putserv "MODE $chan +S"         }      }   }}</code></pre></div>That'll work exactly as you want. Sorry for the earlier, um.. mistake. ;D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Nov 01, 2009 3:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Conc]]></name></author>
		<updated>2009-11-01T13:04:10-04:00</updated>

		<published>2009-11-01T13:04:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90736#p90736</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90736#p90736"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90736#p90736"><![CDATA[
<blockquote class="uncited"><div>* Egg sets mode -S<br>* Egg sets mode +S<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>(...)</div></blockquote> <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=10932">Conc</a> — Sun Nov 01, 2009 1:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-11-01T17:55:29-04:00</updated>

		<published>2009-11-01T12:02:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90734#p90734</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90734#p90734"/>
		<title type="html"><![CDATA[Re: Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90734#p90734"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># this code uses putquick, it acheives the same result# as using the pushmode/flushmode code below does.proc ::rss-synd::feed_msg {type msgs targets {nick ""}} {# check if our target is a nickif {(($nick != "") &amp;&amp; \     ($targets == "")) || \    ([regexp -- {[23]} $type])} {set targets $nick}foreach msg $msgs {foreach chan $targets {if {([catch {botonchan $chan}] == 0) || \    ([regexp -- {^[#&amp;]} $chan] == 0)} {putquick "MODE $chan -S"foreach line [split $msg "\n"] {if {($type == 1) || ($type == 3)} {putserv "NOTICE $chan :$line"} else {putserv "PRIVMSG $chan :$line"}}putquick "MODE $chan +S"}}}}</code></pre></div>Did you try putting your mode changes outside of the foreach which spams the rss feed? I did. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Nov 01, 2009 12:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Conc]]></name></author>
		<updated>2009-11-01T05:59:29-04:00</updated>

		<published>2009-11-01T05:59:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90727#p90727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90727#p90727"/>
		<title type="html"><![CDATA[Edit rss.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90727#p90727"><![CDATA[
Hi again.<br><br>I've downloaded a rss.tcl script. I wanted to edit it. For exemple, before the bot start posting rss, it set mode -S (it's easy) and it set mode +S after posting all rss<br><div class="codebox"><p>Code: </p><pre><code>proc ::rss-synd::feed_msg {type msgs targets {nick ""}} {# check if our target is a nickif {(($nick != "") &amp;&amp; \     ($targets == "")) || \    ([regexp -- {[23]} $type])} {set targets $nick}foreach msg $msgs {foreach chan $targets {if {([catch {botonchan $chan}] == 0) || \    ([regexp -- {^[#&amp;]} $chan] == 0)} {foreach line [split $msg "\n"] {if {($type == 1) || ($type == 3)} {putserv "NOTICE $chan :$line"} else {                  putserv "MODE $chan -S"putserv "PRIVMSG $chan :$line"                  putserv "MODE $chan +S"}}}}}}</code></pre></div>Well... with that code, the bot does this:<br><blockquote class="uncited"><div>* Egg sets mode -S<br>&lt;Egg&gt; RSS ..... blabla<br>* Egg sets mode +S<br>&lt;Egg&gt; RSS ..... blabla<br>&lt;Egg&gt; RSS ..... blabla<br>(...)</div></blockquote>Thanks in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10932">Conc</a> — Sun Nov 01, 2009 5:59 am</p><hr />
]]></content>
	</entry>
	</feed>
