menu channel {
$iif($dialog(ver),$style(7)) mIRC Version Checker: {
dialog -dmo ver ver
}
}
dialog ver {
title "mIRC Version Checker by Andy"
size -1 -1 163 72
option dbu
text "mIRC Version Checker, connects to the mIRC website and simply checks whether or not your mIRC needs to be updated. If your mIRC needs an update it'll take you to the downloads page.", 1, 16 4 131 28, center
edit "", 2, 30 38 94 10, read autohs
button "Check for updates!", 3, 52 53 54 12
}
on 1:dialog:ver:sclick:3: {
if ($did(ver,3).text == Check for updates!) {
ver
}
elseif ($did(ver,3).text == Close!) {
dialog -x ver ver
}
}
alias ver {
.sockopen ver www.mirc.co.uk 80
}
on *:sockopen:ver: {
.sockwrite -n $sockname GET /get.html HTTP/1.0
.sockwrite -n $sockname Host: www.mirc.co.uk $+ $crlf $+ $crlf
}
alias -l html {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}
on 1:sockread:ver: {
if ($sockerr > 0) return
:ver
sockread %ver
if ($sockbr == 0) {
return
}
if (<FONT FACE="ms sans serif,sans-serif,geneva" SIZE="+2"><B>Download mIRC isin %ver) {
if ($gettok($html(%ver),3,32) == $version) && ($dialog(ver)) {
did -a ver 2 Your mIRC is up to date.
did -ra ver 3 Close!
}
elseif ($gettok($html(%ver),3,32) != $version) && ($dialog(ver)) {
did -a ver 2 Need update latest version is ( $+ $gettok($html(%ver),3,32)) $+ )
run http://www.mIRC.co.uk/get.html
did -ra ver 3 Close!
}
}
goto ver
}