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

	<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-04-29T17:40:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cleaner]]></name></author>
		<updated>2009-04-29T17:40:17-04:00</updated>

		<published>2009-04-29T17:40:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88619#p88619</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88619#p88619"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88619#p88619"><![CDATA[
Thanks for explain <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<br><br>You guys are very helpfull!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10597">cleaner</a> — Wed Apr 29, 2009 5:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2009-04-29T14:25:26-04:00</updated>

		<published>2009-04-29T14:25:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88616#p88616</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88616#p88616"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88616#p88616"><![CDATA[
It's not a matter of which is "better" in this case but rather which is faster. [string match] in most cases works faster than [regexp]. In your case, there's no need to use regexp since you're not using it for complex matching (which would be more difficult to implement using other matching methods).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Apr 29, 2009 2:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cleaner]]></name></author>
		<updated>2009-04-29T14:06:49-04:00</updated>

		<published>2009-04-29T14:06:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88615#p88615</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88615#p88615"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88615#p88615"><![CDATA[
Last question,<br><br>What will be better?<br><br>My regexp or your string match?<br><br>||<br>\/<div class="codebox"><p>Code: </p><pre><code>...if {[string match "*word1*" $text] || [string match "*word2*" $text]} {...</code></pre></div>[/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10597">cleaner</a> — Wed Apr 29, 2009 2:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-04-29T13:41:34-04:00</updated>

		<published>2009-04-29T13:41:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88614#p88614</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88614#p88614"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88614#p88614"><![CDATA[
Your regular expression could probably be cleaned up alittle..<br>But as I understand you, your second issue seems identical to the first one?<br><br>If either word1 or word2 is within the string, trigger?<br><br>Edit:<br>Sorry, was thinking off track there...<br>either use a regexp, or something as simple as this:<div class="codebox"><p>Code: </p><pre><code>...if {[string match "*word1*" $text] || [string match "*word2*" $text]} {...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Apr 29, 2009 1:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cleaner]]></name></author>
		<updated>2009-04-29T13:16:17-04:00</updated>

		<published>2009-04-29T13:16:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88613#p88613</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88613#p88613"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88613#p88613"><![CDATA[
<strong class="text-strong">nml375</strong>,<br><br>Thanks for answer and helping.<br><br>This 2nd thing:<br><br>I mean that, when I write in channel:<br>ex:<div class="codebox"><p>Code: </p><pre><code>word1</code></pre></div>and also<div class="codebox"><p>Code: </p><pre><code>worddd1</code></pre></div>Bot will do same command.<br><br>I was trying to fix exec, but i think i have got it:<br><div class="codebox"><p>Code: </p><pre><code>proc pub_do_xyz {nick uhost hand channel txt} {  global ident  if {[regexp {(.*word1.*|.*worddd1.*)} [string trim $txt]]} {putserv "PRIVMSG $channel :$nick: Something to say"  }}</code></pre></div>Then I can write: ddsada<strong class="text-strong">word1czczdsa</strong>   - and its ok.<br>And also: dskjfsl<strong class="text-strong">worddd1</strong>dasdjaks.<br><br>I am right? <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=10597">cleaner</a> — Wed Apr 29, 2009 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-04-29T11:33:42-04:00</updated>

		<published>2009-04-29T11:33:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88612#p88612</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88612#p88612"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88612#p88612"><![CDATA[
Neither is good/better... Use this instead:<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * pubm_do_okproc pubm_do_ok {nick host handle channel text} { if {[string match "${::botnick}*ok1*" [string trim $text]]} {  puthelp "PRIVMSG $channel :ok1" } elseif {[string match "${::botnick}*ok2*" [string trim $text]]} {  puthelp "PRIVMSG $channel :ok2" }}</code></pre></div>I'm not sure what you're asking for with "match string with two variables". Think you could elaborate this a little?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Apr 29, 2009 11:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cleaner]]></name></author>
		<updated>2009-04-29T10:56:38-04:00</updated>

		<published>2009-04-29T10:56:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88611#p88611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88611#p88611"/>
		<title type="html"><![CDATA[HELP! Bind pubm + match two variables !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88611#p88611"><![CDATA[
Hello!<br><br>I have problem with script. I dont know what is better, something like this:<br><br>1)<div class="codebox"><p>Code: </p><pre><code>bind pubm -|- * pub_do_ok1bind pubm -|- * pub_do_ok2proc pub_do_ok1 {nick uhost hand channel txt} {  global botnick  if {[string match "$botnick*ok1*" [string trim $txt]]} {putserv "PRIVMSG $channel :ok1"  }}proc pub_do_ok2 {nick uhost hand channel txt} {  global botnick  if {[string match "$botnick*ok2*" [string trim $txt]]} {putserv "PRIVMSG $channel :ok2"  }}</code></pre></div><br>or this:<br>2)<div class="codebox"><p>Code: </p><pre><code>bind pubm -|- * *proc pub_do_ok1 {nick uhost hand channel txt} {  global botnick  if {[string match "$botnick*ok1*" [string trim $txt]]} {putserv "PRIVMSG $channel :ok1"  }}proc pub_do_ok2 {nick uhost hand channel txt} {  global botnick  if {[string match "$botnick*ok2*" [string trim $txt]]} {putserv "PRIVMSG $channel :ok2"  }}</code></pre></div>What is ok? 1 / 2?<br><br>--------<br><br>Also please tell me how to match string with two variables?<br><br>I want answer for: xxx, yyy<br><br>This isnt working:<div class="codebox"><p>Code: </p><pre><code>proc pub_do_answer {nick uhost hand channel txt} {  global botnick  if {[string match (xxx|yyy) [string trim $txt]]} {putserv "PRIVMSG $channel :entered ok"  }}</code></pre></div>Thanks in advance!<br><br>//EDIT:<br><br>Is this ok?<br><div class="codebox"><p>Code: </p><pre><code>proc pub_do_answer {nick uhost hand channel txt} {  global botnick  if {[regexp (xxx|yyy) [string trim $txt]]} {putserv "PRIVMSG $channel :entered ok"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10597">cleaner</a> — Wed Apr 29, 2009 10:56 am</p><hr />
]]></content>
	</entry>
	</feed>
