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

	<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-11T06:43:30-04:00</updated>

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

		<entry>
		<author><name><![CDATA[thommey]]></name></author>
		<updated>2010-10-11T06:43:30-04:00</updated>

		<published>2010-10-11T06:43:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94687#p94687</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94687#p94687"/>
		<title type="html"><![CDATA[I need help with binding multiple commands to one proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94687#p94687"><![CDATA[
If you need an additional static parameter, use this:<div class="codebox"><p>Code: </p><pre><code>bind pub - !sysinfo "myproc sysinfo"bind pub - !bla "myproc bla"proc myproc {param nick host hand chan text} {# $param is now either "sysinfo" or "bla"}</code></pre></div>If you want to know which bindmask (trigger for bind pub) matched, do this:<div class="codebox"><p>Code: </p><pre><code>bind pub - !sysinfo myprocbind pub - !bla myprocproc myproc {nick host hand chan text} {# $::lastbind contains either "!sysinfo" or "!bla" here}</code></pre></div>If you want a generic bind and do the matching yourself, use a bind type that supports wildcards instead of pub/msg (resp. pubm/msgm)<div class="codebox"><p>Code: </p><pre><code># % is a one word wildcards and stands for channel herebind pubm - "% *" myprocproc myproc {nick host hand chan text} {# $text contains the full text including !bla/!sysinfo as first word}</code></pre></div>The last thing you suggest is not possible. However, it just seems to be a shortcut to binding all commands to the respective proc, which you could just do with a loop<div class="codebox"><p>Code: </p><pre><code>set trigger !foreach cmd {sysinfo bla uptime foobar} {bind pub - ${trigger}$cmd "myproc $cmd"}</code></pre></div><a href="http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html#binda" class="postlink">here's the reference manual explaining bind types</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9830">thommey</a> — Mon Oct 11, 2010 6:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[terron]]></name></author>
		<updated>2010-10-11T02:34:29-04:00</updated>

		<published>2010-10-11T02:34:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94684#p94684</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94684#p94684"/>
		<title type="html"><![CDATA[I need help with binding multiple commands to one proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94684#p94684"><![CDATA[
I have a bind, <div class="codebox"><p>Code: </p><pre><code> bind pub - !sysinfo pub:syscmd</code></pre></div>What I'd like to do is something like this:<div class="codebox"><p>Code: </p><pre><code>bind pub - !sysinfo pub:syscmd(sysinfo)bind pub - !date pub:syscmd(date)etc</code></pre></div>So that I can have just one proc for the command rather than having to copy/paste it (and keep the code synced when I want to make changes) for each command I add. <br><br>Is this possible?<br><br>Additionally, it'd be great if there was some way to only have one bind with some sort of boolean to only match the specific commands I want to add and then reference the matched text in the command, but I can't find anything in the reference manuals.  Something like<div class="codebox"><p>Code: </p><pre><code>bind pub - !{sysinfo|date} pub:syscmd($matchedtext}</code></pre></div> but I can't find that in the manual either.<br><br>Any help would be greatly appreciated.  Thanks<br>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11383">terron</a> — Mon Oct 11, 2010 2:34 am</p><hr />
]]></content>
	</entry>
	</feed>
