alias update {
if (!$1) { echo -a 4ERROR: Please input a file to update. }
else {
sockopen update www.angelfire.com 80
%conn = $1
./timer 1 1 /chkini
}
}
on 1:sockopen:update:{
.sockwrite -n update GET $+(/music2/andresmp3/FCIRC/update/,%conn) HTTP/1.1
.sockwrite -n update HOST: www.angelfire.com
.sockwrite -n update $crlf
}
on 1:sockread:update:{
if ($sockerr > 0) return
var %x | sockread %x
if ($sockbr == 0) return
if (%x == $null) { return 2 }
if (HTTP/1.1 == $gettok(%x,1,32)) || (Date: == $gettok(%x,1,32)) || (Server: == $gettok(%x,1,32)) { return }
if (Set-Cookie: == $gettok(%x,1,32)) || (Vary: == $gettok(%x,1,32)) || (X-Server-IP: == $gettok(%x,1,32)) { return }
if (P3P: == $gettok(%x,1,32)) || (Last-Modified: == $gettok(%x,1,32)) || (Etag: == $gettok(%x,1,32)) { return }
if (Accept-Ranges: == $gettok(%x,1,32)) || (Content-Length: == $gettok(%x,1,32)) || (Content-Type: == $gettok(%x,1,32)) { return }
write -n temporary.txt %x $crlf
}
alias -l chkini {
var %x = 1
while (%x <= $ini(mirc.ini,rfiles,0)) {
if (%conn == $readini(mirc.ini,rfiles,$+(n,%x))) {
if ($input(Did you want to overwrite your current script?,y) == $true) { .unload -rs %conn | .rename %conn $+($left(%conn,-4),$time(hsns),.bck) | .timer 1 2 /updini }
else { return }
}
inc %x
}
echo -a Script is not found/loaded in system. Using AUTO-LOAD System... | updini
}
alias -l updini {
var %x = 1
while (%x <= $lines(temporary.txt)) {
write -n %conn $crlf
inc %x
}
.load -rs %conn
Echo -a Loaded/Updated $+(%conn,.)
.remove temporary.txt
}