namespace eval vwarn {
dict set minver mirc {min 7.55 msg "Please update to mIRC 7.55" }
dict set minver weechat {min 3.1 msg "New version 4.0 is better"}
bind join - * ::vwarn::join
proc join {nick uhost handle chan} {
if {[isbotnick $nick]} { return 0 }
putserv "PRIVMSG $nick :\001VERSION\001"
}
bind ctcr - VERSION ::vwarn::check
proc check {nick uhost handle dest kw arg} {
foreach soft [dict keys $::vwarn::minver] {
if {[string match "*${soft}*" [string tolower $arg]]} {
regexp {(\d{1,}\.?\d{1,})} $arg - vnum
if {[package vcompare $vnum [dict get $::vwarn::minver $soft min]]==-1} {
putserv "PRIVMSG $nick :[dict get $::vwarn::minver $soft msg]"
}
}
}
}
}
The important thing is the lines begining with dict set minver, which allows you to add client (in my case mirc and weechat), the minimal version (7.55 and 3.1) and the associated message.
Last edited by CrazyCat on Wed Jul 14, 2021 3:40 am, edited 1 time in total.