Here is The version i use, really smaller and easy to understand.
alias vr.chk { tokenize 32 $1 if ($1 == <-) { if ($5 == :VERSION) { ctcpreply $mid($gettok($2,1,33),2) VERSION 12m4IR8C $+(v,$version) SebLemery[at]facebook.com } } } on *:START: { debug -i vrchk vr.chk ignore -tw * }