on *:sockopen:amec_update1: {
.sockwrite -n amec_update GET /updates/amec.txt HTTP/1.1
.sockwrite -n amec_update Host: westor.ucoz.com
.sockwrite -n amec_update $crlf
did -a amec_update 13 Checking for updates, please wait!
}
on *:sockread:amec_update1: {
if ($sockerr) { did -a amec_update 13 Update manager: connection problem | halt }
var %v
sockread %v
tokenize 32 %v
if ($1 == v) {
set -e %amec_update_ver $2
set -e %amec_update_link $6
did -a amec_update 9 $2
if ($2 > $amec_ver) {
did -e amec_update 11
did -b amec_update 10
did -a amec_update 13 NEW VERSION IS AVAILABLE FOR DOWNLOAD
if ($4 == BETA) { did -a amec_update 13 The version V $+ $2 $3 ( $+ $5 $+ ) is available for download.. | did -ra amec_update 9 $2 $+ b }
elseif ($4 == NOBETA) { did -a amec_update 13 The version V $+ $2 ( $+ $5 $+ ) is available for download.. }
.timer[amec_update_run_fail*] off
echo -s ok
halt
}
else {
.timer[amec_update_run_fail*] off
did -a amec_update 13 Not any updates are available!
if (BETA !isin $2) { did -ra amec_update 9 $2 }
elseif (BETA isin $2) { did -ra amec_update 9 $remove($amec_ver,BETA) $+ b }
}
}
}
alias amec_update {
.sockclose amec_update
.sockopen amec_update www.westor.ucoz.com 80
.timer[amec_update_run_fail] 1 15 did -a amec_update 13 Update manager: Cannot find the file!
did -b amec_update 10
did -ra amec_update 10 Checking..
did -r amec_update 13,9
}