Ok so after reading
http://www.eggheads.org/support/egghtml ... mands.html 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?
I thought maybe I could escape the characters but that didnt work.
I tried to use a string match but it also interprets the * as a wildcard.
EDIT:
string match ?-nocase? pattern string
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:
*
Matches any sequence of characters in string, including a null string.
?
Matches any single character in string.
[chars]
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).
\x
Matches the single character x. This provides a way of avoiding the special interpretation of the characters *?[]\ in pattern.
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.
Code: Select all
bind pubm - * funkicker
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
}
This should have made it recognize **test** but it is not instead it is recognizing just plain old "test" all by itself.
(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!)