egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

hide CTCP reply PING (Solved)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
DarkRaptor
Voice


Joined: 15 Apr 2006
Posts: 36
Location: Trois-Rivières, Qc

PostPosted: Sun Sep 30, 2007 1:28 pm    Post subject: hide CTCP reply PING (Solved) Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Sep 30, 2007 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
DarkRaptor
Voice


Joined: 15 Apr 2006
Posts: 36
Location: Trois-Rivières, Qc

PostPosted: Wed Oct 03, 2007 1:28 pm    Post subject: Reply with quote

Doesn't work. I always get the reply.
_________________
DarkRaptor @ irc.undernet.org
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Oct 03, 2007 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
DarkRaptor
Voice


Joined: 15 Apr 2006
Posts: 36
Location: Trois-Rivières, Qc

PostPosted: Thu Oct 04, 2007 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Oct 04, 2007 11:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber