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 

Binds with more than one word and a wildcard....
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Sun Apr 27, 2008 2:34 pm    Post subject: Binds with more than one word and a wildcard.... Reply with quote

Is it possible to create a bind with more than one word in it?

And how to create wildcards in a bind?

Code:

bind pub - * proc


with that for example the bot only reacts if u say "*" not if you say something else...

help plz!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 27, 2008 2:42 pm    Post subject: Reply with quote

Read about the pubm bind in Tcl-commands.doc.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Tue Apr 29, 2008 3:31 pm    Post subject: Reply with quote

---can be deleted... ---

Last edited by Nimos on Tue Apr 29, 2008 3:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Apr 29, 2008 3:36 pm    Post subject: Reply with quote

No reaction? I bet you see a Tcl error in your bot's partyline.
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.

Notice the number of arguments a pubm proc has.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Tue Apr 29, 2008 3:39 pm    Post subject: Reply with quote

sry it was a error in the proc, "putserv" gave error messages in the partyline, i used putquick and it works now, but thanks anyway for your support Very Happy
Back to top
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Apr 30, 2008 10:45 am    Post subject: Reply with quote

Sorry for double posting my code is this now:

Code:

bind pubm Q "*Nimos> test"

proc voicetest {nick host chan args} {
putquick "PRIVMSG #germanfunserver :Hallo!"
}


When I use more than one word, the bot dont shows any reaction...
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Apr 30, 2008 10:51 am    Post subject: Reply with quote

Add a trailing * to the mask, as it's matched against the whole message.
Or rather, it matches against "<channel> <text>" and the pattern must match the whole string.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Apr 30, 2008 12:15 pm    Post subject: Reply with quote

can you give an example?

sry, Im a real tcl beginner, and my english isnt very good, too...
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Apr 30, 2008 1:41 pm    Post subject: Reply with quote

'*' matches anything (any number of characters including 0 characters). So when you set a mask like "*word" it will match any line which ends with "word". If you set a mask like "word*" then it will match any line which starts with "word". By now, you probably know that "*word*" matches any line containing "word" (whether at the start, end, or in between).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Apr 30, 2008 2:22 pm    Post subject: Reply with quote

thats not my problem, the binding with "*" works fine, as long it is only one word which is in the bind.

If I try to bind more than one word (e.g. bind pubm - "*hello you!") the bot does not react to "123 bla bla hello you!"

it is only if I put more than one word into a binding...
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Apr 30, 2008 3:35 pm    Post subject: Reply with quote

nml375 wrote:
Add a trailing * to the mask, as it's matched against the whole message.
Or rather, it matches against "<channel> <text>" and the pattern must match the whole string.

Try nml375's suggestion and add an extra trailing * in the mask (i.e. "* <text>" or "% <text>").
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Apr 30, 2008 6:23 pm    Post subject: Reply with quote

hm... scritp seems to work now, but ive got another strange problem now:

For that I have to tell you the situation:

OK: There is a gameserver, and its chat is echoed by a Bot into an IRC channel. The users can talk to the gameserver with !say.
I need to use Channel Commands from the gameserver, without minimizing or ending the game.
The Problem:

The Bot is not seeing the Channelbot!
I used .whois, the last seen was the 25.04.08
I readded the Bot, and now the eggrop says: Seen: Never!

The Name of the echo Bot is longer than 9 letters...I dont have a compiler on my shell, so i cant change the maximum... But the Bot has seen the Echo Bot before, so i think it is not a Name Problem...

Please help me!
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Apr 30, 2008 6:31 pm    Post subject: Reply with quote

Examples of masks:
Given you'd like to match anything starting with "word", use "% word*"
To match anything containing "word", use "*word*"
To match string starting with word1 and ending with word2, use "% word1*word2"
And so on...

Long nicknames should'nt be a problem, only time you'd need to recompile your eggrop is if you'd like to use handles longer than 9 characters (think of htem as usernames within eggdrop). Use the .channel command from dcc-chat to see a channel-members listing from your eggdrop's point of view - usually helps identifying issues with someone not being properly identified.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Apr 30, 2008 6:47 pm    Post subject: Reply with quote

If I use .channel the Eggdrop sees the echo bot, if i use .whois, the bot says "SEEN: Never!"

The Commands work if I used them, but if the echo-bot uses them, the Eggdrop dont hears them....

the masks are no problem anymore Very Happy
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu May 01, 2008 9:04 am    Post subject: Reply with quote

It sees the bot, but does it recognize it? (check the handle column).
_________________
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
Goto page 1, 2  Next
Page 1 of 2

 
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