Code: Select all
tag when posting logs, code
Code: Select all
!token1 cmd1 --> myfunc()
!token1 cmd2 --> myfunc()
!token1 cmd3 --> myfunc()
!token2 cmd1 --> myfunc()
!token2 cmd2 --> myfunc()
MSGM (stackable)
bind msgm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <text>
Description: matches the entire line of text from a /msg with the mask. This is useful for binding Tcl procs to words or phrases spoken anywhere within a line of text.
---------
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.
---------
FILT (stackable)
bind filt <flags> <mask> <proc>
procname <idx> <text>
Description: party line and file system users have their text sent through filt before being processed. If the proc returns a blank string, the text is considered parsed. Otherwise, the bot will use the text returned from the proc and continue parsing that.
Indeed!OpEn_FiRe wrote:If i understood this right it wouldnt be necessary to modify the eggdrop code just to find out wich bind called that proc...
when a bind is triggered it saves the match used in a variable called lastbind.
So all you need to do is add the lastbind to the global part of your proc and u will have wich bind started that proc... Very simple when u read the documentation that comes with eggdrop actually
Just one line above the changes I applied *doh*Tcl_SetVar(interp, "lastbind", (char *) fullmatch, TCL_GLOBAL_ONLY);
Code: Select all
char* used_bind;
used_bind = Tcl_GetVar(interp, "lastbind", 0);