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

	<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>2015-02-12T07:49:56-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-02-12T07:49:56-04:00</updated>

		<published>2015-02-12T07:49:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103478#p103478</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103478#p103478"/>
		<title type="html"><![CDATA[Fun Kicking - Match trigger anywhere not just first word...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103478#p103478"><![CDATA[
If you use <em class="text-italics">string match -nocase</em> there's no need for the <em class="text-italics">string tolower</em> as the first will match either way if it's upper, lower or mixed case.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 12, 2015 7:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chadrt]]></name></author>
		<updated>2015-02-11T19:04:00-04:00</updated>

		<published>2015-02-11T19:04:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103477#p103477</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103477#p103477"/>
		<title type="html"><![CDATA[Fun Kicking - Match trigger anywhere not just first word...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103477#p103477"><![CDATA[
Spike,<br><br>I was performing a .die on the PL and then restarting in the shell.  But that was not doing it!  Your idea of double escaping the *'s did the trick, but I had to do it like this adding the additional *'s to each end.<br><div class="codebox"><p>Code: </p><pre><code>proc funkicker {nick host hand chan txt} {  set txt [string tolower $txt]  if {([string match -nocase "*\\*\\*test\\*\\**" $txt])} {  puthelp "PRIVMSG $chan :$nick, this is a test message"  }  return 0}</code></pre></div>Then it all came together!  Thank you for the assistance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7522">chadrt</a> — Wed Feb 11, 2015 7:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2015-02-11T07:46:15-04:00</updated>

		<published>2015-02-11T07:46:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103476#p103476</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103476#p103476"/>
		<title type="html"><![CDATA[Fun Kicking - Match trigger anywhere not just first word...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103476#p103476"><![CDATA[
My guess is you did not restart the bot to remove all of your old binds in the testing before this bind:)<br><br>You must restart the bot to remove all prior binds.<br><br>You might also try this as your pattern:  {\*\*test\*\*}  :or:  "\\*\\*test\\*\\*"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Feb 11, 2015 7:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chadrt]]></name></author>
		<updated>2015-02-11T06:51:11-04:00</updated>

		<published>2015-02-11T06:51:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103475#p103475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103475#p103475"/>
		<title type="html"><![CDATA[Fun Kicking - Match trigger anywhere not just first word...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103475#p103475"><![CDATA[
Ok so after reading <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> I have found that using "pubm" will look for the word to provide the proc but it is interpreting the * as a wildcard and not as a character is there a way to stop this? <br><br>I thought maybe I could escape the characters but that didnt work.<br><br>I tried to use a string match but it also interprets the * as a wildcard.<br><br>EDIT:<blockquote class="uncited"><div>string match ?-nocase? pattern string<br>    See if pattern matches string; return 1 if it does, 0 if it does not. If -nocase is specified, then the pattern attempts to match against the string in a case insensitive manner. For the two strings to match, their contents must be identical except that the following special sequences may appear in pattern:<br><br>    *<br>        Matches any sequence of characters in string, including a null string.<br><br>    ?<br>        Matches any single character in string.<br><br>    [chars]<br>        Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match. When used with -nocase, the end points of the range are converted to lower case first. Whereas {[A-z]} matches “_” when matching case-sensitively (since “_” falls between the “Z” and “a”), with -nocase this is considered like {[A-Za-z]} (and probably what was meant in the first place).<br><br>    \x<br>        Matches the single character x. This provides a way of avoiding the special interpretation of the characters *?[]\ in pattern. </div></blockquote>So according to this from the TCL manual I should be able to escape the * in the string match.  But even this is not working.  Here is my code that I have been testing with.<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * funkickerproc funkicker {nick host hand chan txt} {  set txt [string tolower $txt]  if {([string match -nocase "\*\*test\*\*" $txt])} {  puthelp "PRIVMSG $chan :$nick, this is a test message"  }  return 0} </code></pre></div>This should have made it recognize **test** but it is not instead it is recognizing just plain old "test" all by itself.<br><br>(Sorry for my rambling I just want you all to see I am trying to read and do my homework before blindly asking you to complete my idea for me!)  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7522">chadrt</a> — Wed Feb 11, 2015 6:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chadrt]]></name></author>
		<updated>2015-02-11T05:40:39-04:00</updated>

		<published>2015-02-11T05:40:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103473#p103473</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103473#p103473"/>
		<title type="html"><![CDATA[Fun Kicking - Match trigger anywhere not just first word...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103473#p103473"><![CDATA[
I have this script that provides some fun kicking in the chat room that I built but I would like it to match the trigger word anywhere in the text.  Right now it only works if it is the first word in the line from the user.<br><div class="codebox"><p>Code: </p><pre><code>#### TEST TO PROVIDE FUN KICKS IN CHAT ####bind pub - **goodnight** fun1bind pub - **poof** fun2bind pub - **badboy** fun3bind pub - **badgirl** fun3proc fun1 {nick host hand chan text} {putserv "KICK $chan $nick :Goodnight and sweet dreams!"}proc fun2 {nick host hand chan text} {putserv "KICK $chan $nick :With a wave of the Magic Wand you disappear!"}proc fun3 {nick host hand chan text} {putserv "KICK $chan $nick :You have been very very bad!!!!!"</code></pre></div>If a user types this then it works:<br>**goodnight** everyone I am tired<br><br>Want it to work like this too:<br>Oh my gosh I am so tired **goodnight** everyone!<br><br>So that no matter where in the text it would pick it up!  Any ideas on this little modification?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7522">chadrt</a> — Wed Feb 11, 2015 5:40 am</p><hr />
]]></content>
	</entry>
	</feed>
