You'd have to query the server for version numbers. Travis and Gwen have both made one for VSIXc (I think), but, I believe they're both in private release. I've also made one, but, it's a full on script updater, so, you can update your script through it. Basic steps:
Connect to a server through a socket and downloading port
Query the server to see if there are similiarities between version numbers.
If your version is less than the one on the server, it updates it.
Loads it by using load -rs %var ..
alias -l MyScript.Version return versionhere
on *:signal:MyScript.Update:{
sockopen MyScript.Update $1 $2
sockmark MyScript.Update $1 $3-
}
on *:sockopen:MyScript.Update:{
sockwrite -n $sockname GET $+(/,$gettok($sock($sockname).mark,2-,32)) HTTP/1.0
sockwrite -n $sockname Host: $gettok($sock($sockname).mark,1,32)
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
sockmark $sockname 0 0
}
on *:sockread:MyScript.Update:{
var %MyScript.Read | sockread %MyScript.Read | tokenize 32 %MyScript.Read
if ($sock($sockname).mark == 0 0) && (!$1) { sockmark $sockname 1 0 }
if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) != $MyScript.Version) { .write -c $+(",$script,") | sockmark $sockname 1 1 }
if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) == $MyScript.Version) { sockclose $sockname }
if ($sock($sockname).mark == 1 1) { .write $+(",$script,") $1- }
}
on *:sockclose:MyScript.Update:{
.load -rs $+(",$script,")
}
Syntax: /signal MyScript.Update <Website URL (No http://)> <Port> <File Name>
It's more complicated then most think if your not used to sockets and the actual downloading process of it.
Edited Feb 15, 2007 8:28 PM by X-Fusion