| View previous topic :: View next topic |
| Author |
Message |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Sun Sep 30, 2007 1:28 pm Post subject: hide CTCP reply PING (Solved) |
|
|
Hi
I make a script to check X's lag and I would like to hide the reply from partyline.
| Code: | | [13:11] CTCP reply PING: 1191172279 from X (cservice@undernet.org) to Botnick |
My code
| Code: |
proc ctcr { nick host hand dest keyword text } {
if {$nick == "X" && [isbotnick $dest]} {
setuser X XTRA ping [expr [unixtime] - $text]
}
}
|
I'm not a TCL Scripter expert. Any help will be appreciate.
Thanks in advance. _________________ DarkRaptor @ irc.undernet.org
Last edited by DarkRaptor on Thu Oct 04, 2007 12:00 pm; edited 3 times in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Sep 30, 2007 4:20 pm Post subject: |
|
|
I guess you could try to add "return 1" at the end of the code to prevent further processing.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Wed Oct 03, 2007 1:28 pm Post subject: |
|
|
Doesn't work. I always get the reply. _________________ DarkRaptor @ irc.undernet.org |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Oct 03, 2007 1:44 pm Post subject: |
|
|
Ahh, true...
Actually, as I recall now, the only thing you could do is to turn off msg-logging in your console, which might not be preferrable; or use raw bindings to catch the notice, and prevent it from being processed further by eggdrop. Using raw bindings could, however, cause your bot to behave in unexpected ways if you are not careful. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Thu Oct 04, 2007 11:38 am Post subject: |
|
|
Thx nml375. It's working now with bind RAW and return 1.
| Code: |
bind RAW - NOTICE FreeOP_ping_reply
proc FreeOP_ping_reply { from keyword text } {
set nick [lindex [split [lindex [split $from] 0] "!"] 0]
set unixtime [regexp -all -inline {[0-9]} [lindex $text 2]]
set unixtime [regsub -all { } "$unixtime" ""]
if {[nick2hand $nick] == "X" && [string match "*PING" [lindex $text 1]]} {
setuser X XTRA ping [expr [unixtime] - $unixtime]
putloglev d * "Ping Reply of [expr [unixtime] - $unixtime] seconds from X"
return 1
}
}
|
_________________ DarkRaptor @ irc.undernet.org |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Oct 04, 2007 11:46 am Post subject: |
|
|
Just a word of advice, don't use lindex directly on $text, as it is a string (from an untrusted source aswell). Considder split:ing it into a list first... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|