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 

bind pub - * doesn't work

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


Joined: 11 Apr 2009
Posts: 14
Location: Germany

PostPosted: Mon Apr 13, 2009 5:10 pm    Post subject: bind pub - * doesn't work Reply with quote

I already have another problem Wink

I want my bot to evaluate any string that is written to the channel with a procedure...
i used
Code:
bind pub - * procedure
or
bind pub - "*" procedure


but he binds the string "*" to procedure and not the wildcard *

What's my mistake?
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Mon Apr 13, 2009 6:10 pm    Post subject: Reply with quote

use pubm for that

Quote:

(6) 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. Also, if a line triggers a PUB bind, it will not
trigger a PUBM bind.
Module: irc
Back to top
View user's profile Send private message
Fill
Halfop


Joined: 18 Jan 2009
Posts: 80

PostPosted: Mon Apr 13, 2009 6:10 pm    Post subject: Reply with quote

Well I don't like using pub, so I'd suggest you to use pubm (public text matching)

If you want to bind all channels, you'd have this:

Code:

bind pubm "* *" proc1


If you only want to bind in a specific chan, you must do it like this:

Code:

bind pubm "#channel1 *" proc1


proc1 will hava to be called with the arguments nick uhost hand chan text
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Apr 16, 2009 3:39 pm    Post subject: Reply with quote

A suggestion when creating more complex patterns, use the % wildcard to match any channel instead of *.
The reason for this is that * matches 0 or more characters, including whitespaces, while % will match 1 word. The advantage of this usage becomes apparent when dealing with more complex patterns such as this:
Code:
#We try to catch anything that starts with !hello world
bind pub "* !hello world*" pubm:hello
#Looks good eh? until we realize it will also trigger on "Blah !hello world", which we did not want!

bind pub "% !hello world*" pubm:hello
#Now, this works as intended. It'll only trigger when the text starts with "!hello world", not whenever it's anywhere in the text.


This could also be extended to only trigger in local channels (&channel) by using "&% !hello world*", and so on...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
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