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

	<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>2011-03-09T06:03:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-09T06:03:55-04:00</updated>

		<published>2011-03-09T06:03:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96416#p96416</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96416#p96416"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96416#p96416"><![CDATA[
Add the following line:<div class="codebox"><p>Code: </p><pre><code>utimer 5 [list putserv "PRIVMSG $chan :something"]</code></pre></div>that delays the sending of the message with 5 seconds to allow it to join it first after<div class="codebox"><p>Code: </p><pre><code>channel add $chan </code></pre></div>If you wish to trigger multiple actions after this 5 seconds delay then create this proc outside the dcc:mul one:<div class="codebox"><p>Code: </p><pre><code>proc timed:message {chan} {putserv "PRIVMSG $chan :something"# and any other things you wish}</code></pre></div>and replace the utimer line with:<div class="codebox"><p>Code: </p><pre><code>utimer 5 [list timed:message $chan]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Mar 09, 2011 6:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kennycheung21]]></name></author>
		<updated>2011-03-09T03:50:43-04:00</updated>

		<published>2011-03-09T03:50:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96414#p96414</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96414#p96414"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96414#p96414"><![CDATA[
Oh, I see.<br>But I'm wondering if I'd like to let the bot do something in the new channel after receiving this command, say print out a sentence, where I should put the statement in this script? <br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11583">kennycheung21</a> — Wed Mar 09, 2011 3:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-08T14:32:49-04:00</updated>

		<published>2011-03-08T14:32:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96404#p96404</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96404#p96404"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96404#p96404"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[scan $text %s chan] != 1} { </code></pre></div>This line dose two things:<br>1. it grabs the text from user's input and creates a variable chan<br>2. checks if the variable $chan isn't empty, meaning the user didn't specified a channel<br><br>All you have to do now is to '.mul #channel' from party line with the bot and it will try to join that channel if isn't there already. <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> — Tue Mar 08, 2011 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kennycheung21]]></name></author>
		<updated>2011-03-08T13:45:58-04:00</updated>

		<published>2011-03-08T13:45:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96403#p96403</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96403#p96403"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96403#p96403"><![CDATA[
Thanks Caesar,<br><br>From your code, I'm still not sure how to make the bot join the new channel the user specified ($chan). <br><br>Maybe there is something I don't quite understand, pls correct me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11583">kennycheung21</a> — Tue Mar 08, 2011 1:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-08T06:33:13-04:00</updated>

		<published>2011-03-08T06:33:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96391#p96391</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96391#p96391"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96391#p96391"><![CDATA[
The dcc bind expects only 3 arguments: &lt;handle&gt; &lt;idx&gt; &lt;text&gt;<br><div class="codebox"><p>Code: </p><pre><code>bind dcc * mul dcc:mulproc dcc:mul {hand idx text} {# grab the channel from user's input in $chan variable and warn if no channel is specifiedif {[scan $text %s chan] != 1} {putdcc $idx "Syntax: .mul #channel"return}# check if channel is validif {[validchan $chan]} {# continue with checking if bot is on the channelif {![botonchan $chan]} {# check is the channel is set to +inactiveif {[channel get $chan inactive]} {putdcc $idx "Channel $chan is set to +inactive"} else {putdcc $idx "I'm not on $chan channel due to one of the following reasons: I'm banned, channel is set to invite only or need a key to join"}}} else {# we add the new channelchannel add $chan}}</code></pre></div>If you really need the reason the bot can't join the specified channel this can be "complicated" a bit by adding a bind need for that specific channel, wait to grab exactly what it needs to join it and then remove the bind.<br><br>Haven't tested this but should work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Mar 08, 2011 6:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kennycheung21]]></name></author>
		<updated>2011-03-08T04:10:40-04:00</updated>

		<published>2011-03-08T04:10:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96389#p96389</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96389#p96389"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96389#p96389"><![CDATA[
Hi,<br><br>I've try this:<br><div class="codebox"><p>Code: </p><pre><code>bind dcc -|- mul dcc:mulproc dcc:mul {hand idx arg chan} {#to join channel c1 specified in $chanif {[string equal -nocase "#c1" $chan]} {if {[validchan "#c1"]}{if {[botonchan]}{#do sth else if the bot is already on this channel}else{if {[channel get $chan inactive]}{#join c1 channelJOIN $chan}}}}}</code></pre></div>I'm not sure what's wrong, could you help me to correct it? <br>PS: I want this command (.mul) to be a DCC command. I'm not sure how to let the bot join another channel specified in the chanfile.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11583">kennycheung21</a> — Tue Mar 08, 2011 4:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-05T04:55:50-04:00</updated>

		<published>2011-03-05T04:55:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96311#p96311</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96311#p96311"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96311#p96311"><![CDATA[
Sure. Have you tried out something, got stuck at some command I mentioned above or this topic just turned from a "help me out" to "do this for me instead"? <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> — Sat Mar 05, 2011 4:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kennycheung21]]></name></author>
		<updated>2011-03-04T03:37:51-04:00</updated>

		<published>2011-03-04T03:37:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96291#p96291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96291#p96291"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96291#p96291"><![CDATA[
Thanks Caesar,<br><br>Could you provide some details?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11583">kennycheung21</a> — Fri Mar 04, 2011 3:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-03-03T15:59:04-04:00</updated>

		<published>2011-03-03T15:59:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96288#p96288</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96288#p96288"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96288#p96288"><![CDATA[
With a combination of a few commands you can get quite a nice script serving this purpose. To add a channel use 'channel add'. Consult the tcl-commands.doc file for instructions.<br><br>The commands I'm referring to are:<br>1. 'string equal -nocase' to compare the current channel with the channel the user specified and stop any other checks<br><br>2. 'validchan' - that checks if the bot has a channel record for the specified channel. Note that this does not necessarily mean that the bot is ON the channel, meaning the channel can be set as +inactive. To detect this we check the status of this setting at step #3.<br><br>3. 'botonchan' - a check that return 1 if the bot is on the specified channel and 0 otherwise.<br><br>4. 'channel get #channel inactive' - to check if the specified (in this example #channel) channel is set to +inactive.<br><br>5. if you want to complicate things a bit you can throw in a "bind need - "#channel *" need:all" to detect exactly what it needs to join that specific channel. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>If you want me to elaborate more on things just drop a message.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Mar 03, 2011 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kennycheung21]]></name></author>
		<updated>2011-03-03T03:26:08-04:00</updated>

		<published>2011-03-03T03:26:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96283#p96283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96283#p96283"/>
		<title type="html"><![CDATA[change channel dynamic]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96283#p96283"><![CDATA[
Hi please help me,<br><br>I would like to implement a feature which will allow the bot create a new channel and talk in it after receive a specific command.<br>For example,<br><br>Bot#1 is on channel #t1, and then user send out a command, Bot#1 create a channel #t2, and join it before notifying the user.<br><br>Is this possible? I have no idea how to start?<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11583">kennycheung21</a> — Thu Mar 03, 2011 3:26 am</p><hr />
]]></content>
	</entry>
	</feed>
