wier wrote:Hi,
i am trying to build a bind for a formatted string..
If User writes the following text into the channel, i would like to trigger a proc
<User>
This is a test
i thought this would be it, but it doesn't work
Code: Select all
bind pubm - "\0034\026This is a test" pub_test
proc pub_test {nick mask hand channel args} {
puthelp "PRIVMSG $channel: Test"
}
Because you've chosen to bind on a pubm rather than pub.
Code: Select all
bind pubm - "\0034\026This is a test" pub_test
To make this work, it would need to look like this...
Code: Select all
bind pubm - "\0034\026This is a test*" pub_test
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:
Code: Select all
bind pub - "\0034\026This is a test" pub_test
Also...about "args"...
Code: Select all
proc pub_test {nick mask hand channel args} {
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:
Code: Select all
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} {