quick and dirty
Uses debug command with hidden window and custom identifier to parse ctcp requests instead of timer. should ignore all ctcps with /ignore -t !@* for best results
shows request in active window in normal ctcp fashion
replies to version and ping as of now should be obvious how to add more.
alias dscan {
var %dscan.line = $1-
tokenize 32 %dscan.line
if ($3 == PRIVMSG) && ($mid($5,2,1) == ) && ($right(%dscan.line,1) == ) {
var %dscan.request = $remove($5,,:)
var %dscan.nick = $mid($2,2,$calc($pos($2,!,1) -2))
if (%dscan.request == ACTION) || ($numtok(%dscan.nick,46) > 1) return
echo -a $chr(3) $+ $timestamp $+ $+ $color(ctcp) $+($chr(91),%dscan.nick,$chr(32),%dscan.request,$chr(93))
if (%dscan.request == VERSION) .ctcpreply %dscan.nick VERSION irssi 0.8.12
if (%dscan.request == PING) .ctcpreply %dscan.nick PING $ctime
return
}
return
}
alias chgver {
.debug -pi @vchg $+ $network $+($chr(36),dscan,$chr(40),$chr(36),1,-,$chr(41))
window -h @vchg $+ $network
}
on 1:CONNECT: {
if (!$window(@vchg $+ $network)) chgver
}
ah the ol' /debug version spoof. the first time i saw this i was convinced it was witchcraft :P
just a couple of things about your /debug command: you can prevent mIRC from both opening a window and writing to a file by specifying an invalid/reserved Windows filename as the target. in mIRC scripting circles, it is common to use 'NUL', but other reserved names such as 'AUX', 'CON', 'PRN', etc. are just as effective (or, indeed, ineffective).
also, with /debug -i, it is easier to understand and remember that the arguments you pass as [identifier] (plural since the value for [identifier] may contain spaces) are simply enclosed in '$' and '($1-)', and the result is evaluated in a context where $1 is the raw message.
thus when you use:
.debug -pi @vchg $+ $network $+($chr(36),dscan,$chr(40),$chr(36),1,-,$chr(41))
the value for [identifier] is '$dscan($1-)' which mIRC then transforms into:
$$dscan($1-)($1-)
it still works as needed, since extraneous characters at the end of an $identifier() are ignored, but knowing exactly what mIRC is doing and taking advantage of its interpreter wherever possible can be interesting and rewarding.
given the above facts, it follows that /debug -i NUL dscan is enough to create the desired outcome