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

	<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>2016-05-04T09:05:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-05-04T09:05:12-04:00</updated>

		<published>2016-05-04T09:05:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104970#p104970</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104970#p104970"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104970#p104970"><![CDATA[
<blockquote class="uncited"><div>...<br> i'll definitely check out that link.</div></blockquote>It would have saved you a lot of time.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>I hope it does, on your next project.<br><blockquote class="uncited"><div>...<br>But now I know the difference. <br>...</div></blockquote>Excellent. <br><br><br>From your original post here:<br>bind pubm - ".hugs *" pub_hugs <br><br>and from tcl-commands.doc, for bind pubm:<br>"The mask is matched against the channel name followed by the text and can contain wildcards. "<br><br>So, your original script had it looking for a channel named .hugs   (no leading #)   and triggering on everything said in that channel.  Clearly (now) neither of those is what you really wanted to happen.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Also, know that you already have a copy of tcl-commands.doc . It is in a directory named<br>doc/<br>below your bot's directory.  Something like this, is typical:<br>/home/your_name/eggdrop/doc<br>There are several files in there that are worth perusing.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><br><br>I just find it convenient to keep it open in a tab, in the web browser, when playing with TCL .<br><br>Have you found:<br><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm</a><br>as that is the rest of TCL (version 8.5).   Simply keep it open in a tab too - it is that handy - for reference.<br><br><br>Have fun with your Eggdrop bot(s), and TCL scripts.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed May 04, 2016 9:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Landslyde]]></name></author>
		<updated>2016-05-04T04:25:21-04:00</updated>

		<published>2016-05-04T04:25:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104969#p104969</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104969#p104969"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104969#p104969"><![CDATA[
Thanks for the replies caesar and willyw.<br><br>You two are extremely helpful. Lots of knowledge!<br><br>willyw: i'll definitely check out that link.<br><br>caesar: i'm trying the code now. i'll try them both and see which is best suited.<br><br>Thanks to you both again.<br><br>EDIT: I used the first bit of code and it works to perfection. As to why I used pubm instead of pub, that was from something I read online. But now I know the difference. Thanks for the heads up, guys.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12386">Landslyde</a> — Wed May 04, 2016 4:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-05-04T03:16:32-04:00</updated>

		<published>2016-05-04T03:16:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104968#p104968</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104968#p104968"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104968#p104968"><![CDATA[
I'm up too late, and foggy.  So I'm glad caesar replied to you.<br><br>I will add this:<br><br>Again:<blockquote class="uncited"><div>Go here:<br><a href="http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br>You can text search there for<br>bind pubm<br>and it explains how it works, etc. </div></blockquote>And while there,  text search for<br>bind pub<br>and read about it too.<br>Compare to what you read there about <br>bind pubm<br>and you'll see why caesar directed you to <br>bind pub<br>Read the descriptions carefully.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed May 04, 2016 3:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-05-04T01:31:47-04:00</updated>

		<published>2016-05-04T01:31:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104967#p104967</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104967#p104967"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104967#p104967"><![CDATA[
In this case you should use a <em class="text-italics">pub</em> bind instead of the <em class="text-italics">pubm</em> bind. <br><br>Also, if you want to count the number of members then <em class="text-italics">llength</em> (translation <em class="text-italics">list length</em>) is the correct approach, but if you wanted it to copy/paste that output then should sanitize the user input with a join and split like this:<div class="codebox"><p>Code: </p><pre><code>bind pub - .hugs pub_hugsproc pub_hugs {nick host handle channel text} {puthelp "PRIVMSG $channel :$nick hugs [join [split $text]]"}</code></pre></div>if want to add a syntax for this then <em class="text-italics">llength</em> will come in handy:<div class="codebox"><p>Code: </p><pre><code>bind pub - .hugs pub_hugsproc pub_hugs {nick host handle channel text} {if {![llength $text]} {puthelp "PRIVMSG $channel :Syntax: .hugs &lt;member or members name&gt;"} else {puthelp "PRIVMSG $channel :$nick hugs [join [split $text]]"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed May 04, 2016 1:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Landslyde]]></name></author>
		<updated>2016-05-03T23:17:17-04:00</updated>

		<published>2016-05-03T23:17:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104966#p104966</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104966#p104966"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104966#p104966"><![CDATA[
willyw: <strong class="text-strong">.hugs</strong> is a channel command. example:<div class="codebox"><p>Code: </p><pre><code>&lt;Slyde&gt; .hugs gelay and samantha&lt;bot&gt; Slyde hugs gelay and samantha</code></pre></div>What I need is for all the text after <strong class="text-strong">.hugs</strong> to be added. That's what I'm having a hard time with. I shld have been clearer with what this is suppose to do. My bad for that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12386">Landslyde</a> — Tue May 03, 2016 11:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-05-03T22:57:05-04:00</updated>

		<published>2016-05-03T22:57:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104965#p104965</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104965#p104965"/>
		<title type="html"><![CDATA[Re: I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104965#p104965"><![CDATA[
Right.<br>if you change ".hugs *"   to<div class="codebox"><p>Code: </p><pre><code>"#.hugs *"</code></pre></div>though,  it will do something.<br><br>All channel names begin with a   #  .<br><br>What it will do, is produce an error in the partyline.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>See the line that begins with putquick.   It needs to end with   "   .<br><blockquote class="uncited"><div>...So I'm at a loss how this is really suppose to work.<br>...</div></blockquote>Go here:<br><a href="http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br>You can text search there for  <br>bind pubm<br>and it explains how it works, etc.<br><br>Once you get your script working as-is, I suspect that it won't do what you want. <br>You'll get something like this:<blockquote class="uncited"><div>&lt;@tempnick&gt; this is a test<br>&lt;botnick&gt; tempnick hugs 4</div></blockquote>Also -<br>Here is the reference for llength:<br><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/llength.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/llength.htm</a><br><br>While it is not emphasized there, a very key word there is "list"<blockquote class="uncited"><div>llength - Count the number of elements in a list </div></blockquote>Your little script has:<div class="codebox"><p>Code: </p><pre><code>set who [llength $testes]</code></pre></div>So it is using llength on a string, not a list.<br>You can "get away" with that enough, to fool you into thinking it is working.<br>It can bite you in the butt, someday.<br><br>To convert a string to a list, see:<br><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/split.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/split.htm</a><br><br>Thus, it should be:<div class="codebox"><p>Code: </p><pre><code>set who [llength [split $testes] ]</code></pre></div>Even now, with the proper use of llength on a list, the output to the channel will be kind of weird.   But... I don't know what you really intended.   Yet.<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue May 03, 2016 10:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Landslyde]]></name></author>
		<updated>2016-05-03T20:27:15-04:00</updated>

		<published>2016-05-03T20:27:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104963#p104963</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104963#p104963"/>
		<title type="html"><![CDATA[I need help with pubm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104963#p104963"><![CDATA[
This won't work:<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - ".hugs *" pub_hugsproc pub_hugs {nick host handle channel testes} {   set who [llength $testes]   putquick "PRIVMSG $channel :$nick hugs $who}</code></pre></div>Nothing happens. Befire I came here, I looked and cldn't find a script that uses pubm. So I'm at a loss how this is really suppose to work.<br><br>Thanks in advance for your help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12386">Landslyde</a> — Tue May 03, 2016 8:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
