mIRC Update checker.

By ReQueST on Mar 07, 2005

A basic socket snippets that allows you to check if you need to update your mIRC.exe.
It check your IRC, trough a ctcp message. And the one running the script by simply using the $version command.

on *:TEXT:!mirc:#:{
  msg $chan [mIRC] Looking up latest version, please be patient..
  if ($sock(mIRC)) { msg %mircchan [mIRC] Socket in use. Please be patient. | sockclose mIRC | halt }
  set %mircchan $chan
  .ctcp $nick VERSION
  sockopen mIRC mirc.com 80
}

on *:CTCPREPLY:version*:{ set %yourversion $1- }

ON *:SOCKOPEN:mIRC: {
  sockwrite -n $sockname GET /get.html
  sockwrite -n $sockname Host: www.mirc.com
  sockwrite -n $sockname User-Agent: $version
  sockwrite -n $sockname $crlf
}

on *:SOCKREAD:mIRC: {
  if ($sockerr) { msg %mircchan [mIRC] Socket Error. }
  var %tmp
  sockread %tmp
  if (<B>Download mIRC isin %tmp) {
    set %mirc.version $remove(%tmp,<FONT FACE="ms sans serif,sans-serif,geneva" SIZE="+2"><B>Download mIRC,or the mIRC FAQ.</FONT>,$chr(32),$chr(44))
    set %your.mirc $remove($gettok(%yourversion,3,32),v)
    msg %mircchan [mIRC] Latest mIRC version is; %mirc.version $+ . (I currently run on: $version $+ . Upgrade: $iif(%mirc.version >= $version,$iif(%mirc.version == $version,No,Yes),No) $+ .)
    msg %mircchan [mIRC] You run on: %your.mirc $+ . (You $iif(%mirc.version >= %your.mirc,$iif(%mirc.version == %your.mirc,DON'T,DO),DON'T) need to upgrade.) 
    sockclose mIRC
    unset %mirc.* | unset %your*
    halt
  }
}

Comments

Sign in to comment.
DarthReven   -  Jun 03, 2005

you can change the version reply to get the version number you want sooner by changing set %yourversion $1- to set %version $mid($3,2)

 Respond  
splatted   -  Mar 10, 2005

very nice - but for practicality purpose, you really should make it autocheck once week or month or possibly on startup for self. I do realize however you intended the !mirc command so that other users in channel can check.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.