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

	<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>2010-10-22T03:00:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[thommey]]></name></author>
		<updated>2010-10-22T03:00:13-04:00</updated>

		<published>2010-10-22T03:00:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94832#p94832</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94832#p94832"/>
		<title type="html"><![CDATA[Bind a formatted string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94832#p94832"><![CDATA[
<blockquote class="uncited"><div>So my first question is, where the mistake is in my code</div></blockquote>Almost everything starting from the second if is syntactically broken, it doesn't follow Tcl syntax. Tcl syntax: <a href="http://wiki.tcl.tk/dodekalogue" class="postlink">http://wiki.tcl.tk/dodekalogue</a> . To see a more fine grained complaint about all your syntax errors (oh, and of course why your braces mismatch - it's easy to see with correct indention + the [] around $flag == 0 is wrong), see: <a href="http://paste.tclhelp.net/?id=83i" class="postlink">http://paste.tclhelp.net/?id=83i</a> . You should also see errors in your partyline - you absolutely need to see them there to test your Tcl scripts.<blockquote class="uncited"><div>and secondly I would like to know, wheather a coloured text would trigger the proc.</div></blockquote>Yes. However, bind pubm does not match against the text only tho, reread the documentation (that's why all pubm binds not being '*' mentioned in this thread never match), <a href="http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html#binda_pubm" class="postlink">http://www.eggheads.org/support/egghtml ... binda_pubm</a> and <a href="http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html#matchchars" class="postlink">http://www.eggheads.org/support/egghtml ... matchchars</a> (the % wildcard is helpful).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9830">thommey</a> — Fri Oct 22, 2010 3:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[wier]]></name></author>
		<updated>2010-10-21T03:15:35-04:00</updated>

		<published>2010-10-21T03:15:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94820#p94820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94820#p94820"/>
		<title type="html"><![CDATA[Bind a formatted string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94820#p94820"><![CDATA[
First of all thanks for your help.<br>Unfortunately it didn't work like wanted it to.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";-)" title="Wink"><br>Thats why, I tried to change the way I am handling the problem.<br><br>The idea is, to allow a bot-command only between two certain commands of another bot..<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * testproc test {nick host hand chan text} {global flagif {[string equal -nocase "!test" $text]} {if {[$flag==0]} {puthelp "NOTICE $nick :This a test" }}}elseif {[string equal -nocase "*startpoint*" $text]} {set flag 1}elseif {[string equal -nocase "*endpoint*" $text]} {set flag 0}} </code></pre></div>but unfortunatly the if/elseif equations are never reached. <br>So my first question is, where the mistake is in my code, and secondly I would like to know, wheather a coloured text would trigger the proc.<br><br>Thanks,<br>wier<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11392">wier</a> — Thu Oct 21, 2010 3:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-10-16T12:11:16-04:00</updated>

		<published>2010-10-16T12:11:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94754#p94754</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94754#p94754"/>
		<title type="html"><![CDATA[Re: Bind a formatted string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94754#p94754"><![CDATA[
<blockquote class="uncited"><div>Hi,<br><br>i am trying to build a bind for a formatted string..<br>If User writes the following text into the channel, i would like to trigger a proc<br><br>&lt;User&gt; <span style="color:red"><span style="text-decoration:underline">This is a test</span></span><br><br>i thought this would be it, but it doesn't work<div class="codebox"><p>Code: </p><pre><code>bind pubm - "\0034\026This is a test" pub_testproc pub_test {nick mask hand channel args} {    puthelp "PRIVMSG $channel: Test"}</code></pre></div></div></blockquote>Because you've chosen to bind on a pubm rather than pub.<div class="codebox"><p>Code: </p><pre><code>bind pubm - "\0034\026This is a test" pub_test</code></pre></div>To make this work, it would need to look like this...<div class="codebox"><p>Code: </p><pre><code>bind pubm - "\0034\026This is a test*" pub_test</code></pre></div>Now it's a mask, notice the wildcard * at the end? To make it work as a regular pub bind, and not one masked, use:<div class="codebox"><p>Code: </p><pre><code>bind pub - "\0034\026This is a test" pub_test</code></pre></div>Also...about "args"...<div class="codebox"><p>Code: </p><pre><code>proc pub_test {nick mask hand channel args} {</code></pre></div>Here it serves no purpose. Your bind will pass a single-argument as the text the user entered. You've chosen to capture this into "args" which will allow multiple arguments. Therefore, your captured text will be conveyed instead as a list, not as a string. So rather than craft ways to convert this list back into a string for processing. Craft your procedure header correctly, like this:<div class="codebox"><p>Code: </p><pre><code>proc pub_test {nick mask hand channel arg} {--or--proc pub_test {nick mask hand channel text} {--or--proc pub_test {nick mask hand channel literally_anything_but_args} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Oct 16, 2010 12:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2010-10-16T12:01:52-04:00</updated>

		<published>2010-10-16T12:01:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94751#p94751</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94751#p94751"/>
		<title type="html"><![CDATA[Bind a formatted string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94751#p94751"><![CDATA[
Try <div class="codebox"><p>Code: </p><pre><code>bind pubm - "\00304\026This is a test" pub_test</code></pre></div> and read this <a href="http://forum.egghelp.org/viewtopic.php?p=80884#80884" class="postlink">http://forum.egghelp.org/viewtopic.php?p=80884#80884</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Sat Oct 16, 2010 12:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[wier]]></name></author>
		<updated>2010-10-16T11:03:39-04:00</updated>

		<published>2010-10-16T11:03:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94748#p94748</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94748#p94748"/>
		<title type="html"><![CDATA[Bind a formatted string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94748#p94748"><![CDATA[
Hi,<br><br>i am trying to build a bind for a formatted string..<br>If User writes the following text into the channel, i would like to trigger a proc<br><br>&lt;User&gt; <span style="color:red"><span style="text-decoration:underline">This is a test</span></span><br><br>i thought this would be it, but it doesn't work<div class="codebox"><p>Code: </p><pre><code>bind pubm - "\0034\026This is a test" pub_testproc pub_test {nick mask hand channel args} {    puthelp "PRIVMSG $channel: Test"}</code></pre></div>and to check, if "User" wrote the text, i can check it with <div class="codebox"><p>Code: </p><pre><code>if($nick ne "User") {...}</code></pre></div>but.. as i said.. it doesn't work like this.. <br>thanks for help <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=11392">wier</a> — Sat Oct 16, 2010 11:03 am</p><hr />
]]></content>
	</entry>
	</feed>
