The process version:reply is called by the bind: bind ctcr - VERSION version:reply
From the eggdrop documentation, eggdrop tcl commands we look up bind ctcr...
Quote:
CTCP (stackable)
bind ctcp <flags> <keyword> <proc>
proc-name <nick> <user@host> <handle> <dest> <keyword> <text>
...and see that any process called by bind ctcr MUST take exactly 6 arguments
and none of them are channel. You will have to pass that to proc version:reply
some other way, maybe in the global cversion variable.
Also: proc version:reply needed some major rework to function at all:).
Watch your variable names, every process can use them differently!
Code:
bind pub - !version check:version
proc check:version {nick uhost hand chan arg} {
global cversion
set cversion([string tolower $arg]) $chan
putserv "PRIVMSG $arg :\001VERSION\001"
utimer 10 [list no:version:reply $nick $uhost $chan $arg]
}
bind ctcr - VERSION version:reply
proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[info exists cversion([string tolower $nick])]} {
putserv "PRIVMSG $cversion([string tolower $nick]) :$nick is using $arg"
unset cversion([string tolower $nick])
}
}
proc no:version:reply {nick uhost chan arg} {
global cversion
if {[info exists cversion([string tolower $arg])] && [onchan $arg $chan]} {
putserv "PRIVMSG $chan :No CTCP version reply from $arg"
unset cversion([string tolower $arg])
}
}
putlog "Version Reply"
NOTE: this replies only the first version reply line from the nick!
Any further script versions are ignored, probably not exactly what you're after.
See how that does and let me know.