NoNeed
on *:connect: {
ignore -tw *
debug -i debugoutput fakectcp
fakectcpversion
}
alias fakectcp {
tokenize 32 $1-
if ($1 == <-) && ($3 == PRIVMSG) && (:* iswm $5-) && ($mid($5-,3,-1) == VERSION) {
ctcpreply $mid($gettok($2,1,33),2) $v1 %fakectcpshow
fakectcpversion
}
}
alias fakectcpversion {
var %c $r(1,10)
if (%c = 1) { set %fakectcpshow eggdrop v1.6.19+ctcpfix }
if (%c = 2) { set %fakectcpshow rZNC Version 1.0 [02/01/11] - Built from ZNC. }
if (%c = 3) { set %fakectcpshow xchat 2.8.8 Ubuntu }
if (%c = 4) { set %fakectcpshow http://www.mibbit.com ajax IRC Client .2620 }
if (%c = 5) { set %fakectcpshow Eteria IRC Client }
if (%c = 6) { set %fakectcpshow Snak for Macintosh 4.13 English }
if (%c = 7) { set %fakectcpshow BR .NET Irc Client 1.3.0 }
if (%c = 8) { set %fakectcpshow Black-Cell client version 2.0.1 }
if (%c = 9) { set %fakectcpshow Trillian }
if (%c = 10) { set %fakectcpshow PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190) }
}
var %version = mIRC Version 7.0
hadd -m ctcp version %version
echo -ae $hget(ctcp, version)
Hash tables are easy to use. Perhaps it's something you should look at a bit more in depth. Also, it's not the compiler's full responsibility. As a developer, it's imperative that you understand the language you're developing in. :)
PS: Please excuse my horrible MSL syntax, haven't touched it in awhile.
I'd stick with the global variable /sets, changing them to /set -e (unsets when client is closed), and check if the variable has been initialized yet. Such that a version reply is selected at random the first time you are /ctcp versioned, and the same reply is sent for the entire session of multiple version requests.
Sending a different reply seconds apart will only prove you're faking it.
on *:connect: {
.ignore -tw *
.debug -i debugoutput fakectcp
}
alias fakectcp {
if $regex($1,/^<- :(.+)!\S+ PRIVMSG $me :.VERSION.$/S) {
ctcpreply $regml(1) VERSION $fakectcpversion
}
}
alias fakectcpversion {
goto $r(1,9)
:1 | return Trillian
:2 | return Eteria IRC Client
:3 | return xchat 2.8.8 Ubuntu
:4 | return eggdrop v1.6.19+ctcpfix
:5 | return BR .NET Irc Client 1.3.0
:6 | return Snak for Macintosh 4.13 English
:7 | return Black-Cell client version 2.0.1
:8 | return http://www.mibbit.com ajax IRC Client .2620
:9 | return rZNC Version 1.0 [02/01/11] - Built from ZNC.
}