This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Binds with more than one word and a wildcard....

Help for those learning Tcl or writing their own scripts.
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Binds with more than one word and a wildcard....

Post by Nimos »

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

And how to create wildcards in a bind?

Code: Select all

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

help plz!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Read about the pubm bind in Tcl-commands.doc.
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

---can be deleted... ---
Last edited by Nimos on Tue Apr 29, 2008 3:38 pm, edited 1 time in total.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

No reaction? I bet you see a Tcl error in your bot's partyline.
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.
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

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 :D
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

Sorry for double posting my code is this now:

Code: Select all

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...
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

can you give an example?

sry, Im a real tcl beginner, and my english isnt very good, too...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

'*' 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).
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

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...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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>").
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

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!
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

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 :D
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

It sees the bot, but does it recognize it? (check the handle column).
NML_375
Post Reply