| View previous topic :: View next topic |
| Author |
Message |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Sun Apr 27, 2008 2:34 pm Post subject: Binds with more than one word and a wildcard.... |
|
|
Is it possible to create a bind with more than one word in it?
And how to create wildcards in a bind?
with that for example the bot only reacts if u say "*" not if you say something else...
help plz! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Tue Apr 29, 2008 3:31 pm Post subject: |
|
|
---can be deleted... ---
Last edited by Nimos on Tue Apr 29, 2008 3:38 pm; edited 1 time in total |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Apr 29, 2008 3:36 pm Post subject: |
|
|
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 |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Tue Apr 29, 2008 3:39 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Apr 30, 2008 10:45 am Post subject: |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Apr 30, 2008 10:51 am Post subject: |
|
|
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 |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Apr 30, 2008 12:15 pm Post subject: |
|
|
can you give an example?
sry, Im a real tcl beginner, and my english isnt very good, too... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Apr 30, 2008 1:41 pm Post subject: |
|
|
'*' 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 |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Apr 30, 2008 2:22 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Apr 30, 2008 3:35 pm Post subject: |
|
|
| 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 |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Apr 30, 2008 6:23 pm Post subject: |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Apr 30, 2008 6:31 pm Post subject: |
|
|
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 |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Apr 30, 2008 6:47 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu May 01, 2008 9:04 am Post subject: |
|
|
It sees the bot, but does it recognize it? (check the handle column). _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|