dialog amec_update {
title "ameC - Update manager v1.1"
size -1 -1 163 118
option dbu
box "Update manager", 5, 3 3 158 42
text "Your ameC version is:", 6, 7 12 75 10
edit "", 7, 84 12 23 10, disable
text "Latest ameC version is:", 8, 7 30 75 10
edit "", 9, 84 30 23 10, disable
button "Check now..", 10, 114 12 43 10
button "Download", 11, 114 30 43 10
button "Close this window", 12, 35 104 88 12, default
list 13, 4 50 155 50, size
}
on *:sockopen:amec_update: {
.sockwrite -n amec_update GET /updates/amec_update.txt HTTP/1.1
.sockwrite -n amec_update Host: westor.ucoz.com
.sockwrite -n amec_update $crlf
did -b amec_update 10
did -a amec_update 13 Making scan for new versions, Wait..
}
on *:sockread:amec_update: {
if ($sockerr) { did -a amec_update 13 Update manager: Connection error | halt }
;if ($sockbr == 0) { echo -s the sockbr is null | halt }
var %v
sockread %v
tokenize 32 %v
echo -s error - %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 ONE NEW VERSION IS AVAILABLE
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.. }
did -a amec_update 13 Make click to the "Download" button for download!
did -a amec_update 13 -
did -a amec_update 13 Thank you for using the $amec_ver version!
.timer[amec_update_run_fail*] off
halt
}
else {
.timer[amec_update_run_fail*] off
did -a amec_update 13 Not any updates are available!
did -a amec_update 13 You have the latest version of ameC!
if (BETA !isin $2) { did -ra amec_update 9 $2 }
elseif (BETA isin $2) { did -ra amec_update 9 $remove($amec_ver,BETA) $+ b }
}
}
}
on *:DIALOG:amec_update:*:*: {
if ($devent == init) {
did -f $dname 10
did -b $dname 11
if (BETA !isin $amec_ver) { did -ra $dname 7 $amec_ver }
elseif (BETA isin $amec_ver) { .did -ra $dname 7 $remove($amec_ver,BETA) $+ b }
}
elseif ($devent == sclick) {
if ($did == 10) {
.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: There is not any update file!
did -b amec_update 10
did -ra amec_update 10 Checking..
did -r amec_update 13,9
}
elseif ($did == 12) {
.sockclose amec_update
.timer[amec_update_run*] off
dialog -x amec_update
}
elseif ($did == 11) {
if (!%amec_update_download) { did -a $dname 13 Update Manager: Make a check first! | halt }
elseif (%amec_update_download) { did -b amec_update 11 | did -ra amec_update 11 Downloading.. | .timer[amec_update_use] 1 10 did -ra amec_update 11 Download | .timer[amec_update_use1] 1 10 did -e amec_update 10 | .timer[amec_update_use2] 1 10 did -ra amec_update 10 Check again! | .run %amec_update_download }
}
}
elseif ($devent == close) { .sockclose amec_update | .timer[amec_update_run*] off }
}