egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pubm

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
topdawg_b
Voice


Joined: 07 Dec 2008
Posts: 32

PostPosted: Sun Dec 07, 2008 11:42 pm    Post subject: pubm Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Dec 08, 2008 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
topdawg_b
Voice


Joined: 07 Dec 2008
Posts: 32

PostPosted: Tue Dec 09, 2008 12:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 09, 2008 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber