| View previous topic :: View next topic |
| Author |
Message |
topdawg_b Voice
Joined: 07 Dec 2008 Posts: 32
|
Posted: Sun Dec 07, 2008 11:42 pm Post subject: pubm |
|
|
i have 3 questions regarding this bind and 1 general question
I'll try to be as short as possible.
the typical example in many docs is
bind pubm - hello pubm:hello
I've tried all kinds of different words and it never triggers on partyline when i do .binds the number is 0
if i use pub instead of pubm works fine. but pub wont work for what I need because it only triggers on 1 word.
after many hours of reading i saw a vaiation of this
bind pubm - "% hello" pubm:hello
I tried that and it worked. so my questions are.
1. what am I doing wrong? why wont it trigger in the normal way.
2. what is the % for what does it do and is there a list of others ? msgm also does not work and the % did not fix it.
3. Id like to use the word that triggered the event $text has the 2nd on but one of my scripts triggers on part of a word and i need to know in the proc what whole word they used to trigger it.
4. is there a doc out there that shows all the binds with al lthe switches and such? I have a tcl-commands.doc btu there is a lot that is not in there.
thanks so much for the help. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Dec 08, 2008 9:25 pm Post subject: |
|
|
From Tcl-commands.doc:
| Quote: | PUBM (stackable)
bind pubm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <text>
Description: just like MSGM, except it's triggered by things said
on a channel instead of things /msg'd to the bot. The mask is
matched against the channel name followed by the text and can
|contain wildcards. If the proc returns 1, Eggdrop will not log
|the message that triggered this bind. PUBM binds are processed
|before PUB binds. If the exclusive-binds setting is enabled,
|PUB binds will not be trigged by text that a PUBM bind has
|already handled. |
"%" matches a single word (no spaces). So, it's usually used to match any channel since the first word in the bind's mask is the channel-name.
MSGM is for private messages with the bot and its bind-mask matches the text.
The last argument in a PUBM procedure is the whole text, you can parse it to extract the needed information (we can help more if you provide more info). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
topdawg_b Voice
Joined: 07 Dec 2008 Posts: 32
|
Posted: Tue Dec 09, 2008 12:06 am Post subject: |
|
|
| I figured out after playing with it for a bit that it returned the whole string. thought it returned just like pub did since i never got it to work. why does it not work without the %?? are u saying that % is a wildcard? and the first word in the string is the channel name? if so and i wasnt going to use the % what would have to use to make it work? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Dec 09, 2008 8:36 am Post subject: |
|
|
Yes, "%" is a wildcard and as I said it matches a single word (which is the channel name in your case). If you just use "*" as the mask, it should normally work the same as "% *" as well but bare in mind that the first word in the PUBM bind-mask is the channel name (in case you wanted to limit a bind to just a single channel).
To make it clearer, take the following example:
| Code: | | bind pubm - "* hello" someproc |
this triggers someproc when someone says "hello" or even "hi all!! hello" or any line that ends with " hello" or simply matches "hello" (* matches 0, 1 or more words). As for this example:
| Code: | | bind pubm - "% hello" someproc |
this will trigger someproc only when someone says "hello" because % matches the channel name, and every thing after it is the text to be matched. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|