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.

ctcp time reply question

Old posts that have not been replied to for several years.
Locked
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

ctcp time reply question

Post by droolin »

I need to develope a script that interpits a ctcp time reply from a nick that the script initiates. My question is what would I use for the script to bind to the reply event? I thought it would be a raw numeric, but I do not see no numerics for the ctcp time reply. I wouldnt think it would be a notice, because that just isnt a notice.
Any sugestions would be greatly appriceated.
Thank you in advance.

droolin
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Code: Select all

bind ctcr - PING your:proc
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

this maybe?

Post by droolin »

Code: Select all

bind	raw	-	CTCP
and then figure it out from there??


droolin
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Here's an simple example just to give you an idea on how it works

Code: Select all

bind pub - !ping pub:ping
bind ctcr - PING ping:reply

proc pub:ping {nick uhost hand chan text} {
 putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
}

proc ping:reply {nick uhost hand dest keyword text} {
 putserv "NOTICE $nick :[expr ([clock clicks -milliseconds] - $text) / 1000.0] seconds" 
}
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

gb wrote:[expr ([clock clicks -milliseconds] - $text) / 1000.0]
That's a perfect example of how NOT to do it :) $text will be evaluated allowing people to execute what ever tcl commands they want.
Add a couple of braces around the expression to prevent this. ([expr {...}]) Ideally you should also make sure that $text is a number before doing the expr.
Have you ever read "The Manual"?
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

hmmmm

Post by droolin »

What I have to do is a ctcp time against another nick. Specific clients(bots) hide under version information of other clients, but when you to the ctcp time against them. The returned time format is not the same as the client version they are faking. But, what I think I need which I beleive was answered was the following for me to bind to the event that I can use to make the determination as to if it is a bot or not.

Code: Select all

putserv "PRIVMSG $nick :\001TIME
bind ctcr - TIME TIME:reply 
Thank you for the help, its very much appriceated.

droolin
Locked