| View previous topic :: View next topic |
| Author |
Message |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Sun Feb 15, 2009 8:26 pm Post subject: PART bind failing to return part msg |
|
|
I have been coding a script to deal with recent spam on DALnet, including banning users that part a channel where the part message matches one of a preconfigured number of text patterns. The problem is that it sometimes worked and sometimes didn't.
In order to try to identify the problem I used another bot to create a catch-all part bind and echo the arguments passed to the bind proc to an IRC channel. It confirmed that the exact same part message is sometimes returned and sometimes not, as follows :-
----- 1st event -----
IRC client join/part
[23:47] * jinglun has joined #Atlantis
[23:47] * jinglun has left #Atlantis (WWW.TheBestScript.TK .)
part bind proc arguments
[23:47] <@Baal> *-PART-* nick (jinglun), user@host (chrissy@94.159.3.2), handle (*), channel (#Atlantis), message ()
----- 2nd event -----
IRC client join/part
[00:00] * rowatt has joined #Atlantis
[00:00] * rowatt has left #Atlantis (WWW.TheBestScript.TK .)
part bind proc arguments
[00:00] <@Baal> *-PART-* nick (rowatt), user@host (milicent@123.237.8.238), handle (*), channel (#Atlantis), message (WWW.TheBestScript.TK .)
------------------------
So, on both occasions the part message is identical yet it is only sent to the part bind proc on one of the two occasions. Anybody know why?
Is it anything to do with being on the same IRC server as the spammer? |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Feb 17, 2009 12:14 am Post subject: |
|
|
If you haven't read the tcl-commands.doc/html then, this should help | Code: | PART (stackable)
bind part <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <msg>
Description: triggered by someone leaving the channel. The mask is matched against "#channel nick!user@host" and can contain wildcards. If no part message is specified, msg will be set to "".
New Tcl procs should be declared as
proc partproc {nick uhost hand chan {msg ""}} { ... }
for compatibility.
Module: irc | Usually, if you are reciving an error or the script isn't working its down to you not account for this in the script. Just check if there is a part message or not with something like | Code: | | if {$msg != ""} { ..we have a part message } | in your script. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Feb 17, 2009 10:10 pm Post subject: |
|
|
As I recall, not all irc servers do relay the part-reason onto other servers in the network. So yes, I believe this comes down to being on the same irc server as the spammer or not.
It is not related to some improper use of the part binding, obviously as your script triggers in both cases.
You could throw in the suggestion from the tcl-commands.doc, but that'd only be useful if you intend to use your script in both old eggis and more recent. If you're happy with just running it on recent eggies (say 1.6.15+), it'll work just as fine with fixed arguments. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Tue Feb 17, 2009 11:57 pm Post subject: |
|
|
Yes, thanks nml375. I thought as much.
There are times when I forget that what I see in my IRC client is not necessarily what the eggdrop sees. |
|
| Back to top |
|
 |
|
|
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
|
|