mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
alias updatecheck { sockopen VersionCheck.ftpxdcc www.mp3car.com 80 }
on *:START: {
if (%servers.version == $null) {
set %servers.version 1.6
}
if ($c.set(ftpxdcc,start) > 50) {
sockopen VersionCheck.ftpxdcc www.mp3car.com 80
}
}
on *:SOCKOPEN:VersionCheck.ftpxdcc: {
.sockwrite -n $sockname GET /usersites/bombboyer/version.txt HTTP/1.0
.sockwrite -n $sockname Host: www.mp3car.com
.sockwrite -n $sockname Accept: text/plain
.sockwrite -n $sockname User-Agent: User-Agent: ftpxdcc_update/1.0.0.5 (compatible; MSIE 6.0b; WinXP Pro ;ftpxdcc)
.sockwrite -n $sockname Pragma: no-cache
.sockwrite $sockname $crlf
}
on *:SOCKREAD:VersionCheck.ftpxdcc:{
if ($sockerr > 0) return
:nextread
.sockread %version
if ($sockbr == 0) return
var %version.info %version
tokenize 32 %version.info
if (%version.info > %servers.version) {
echo -a New Update Ready
}
if (%version.info == %servers.version) { echo -a You are running the most up-to-date version }
goto nextread
sockclose $sockname
}

the files are where they are spose to be, and everything it set, its deff a syntax error on my part. That it does is whenever i do /updatecheck i get:

New Update Ready
New Update Ready
New Update Ready
New Update Ready
New Update Ready
New Update Ready
New Update Ready

Like that. Why does it do that so many times, and how can I make the script work?



;Check for Life

if (%life == $null) {
goto getlife
}
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Did you try adding an 'echo -a %version' after the sockread line to see what data the socket is recieving,

Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
ok i had the same problem ...... but what i found out fixed it was changing the format of the txt file to something like this

<html><body>
Version: 1.0.0.5 Download_URL:
http://www.SERVERNAME.FOR.NEW.UPDATE
<END FILE></BODY></HTML>

if your interested in checking the one i made out ... PM me and ill give u the url for the code and the exact url for the file it looks up


D3m0nnet.com
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
D3m0n, im not usind the "Download_URL:" at all, so I Took it out. I had it workign for a while, but then it broke again. Is there anyting wrong wite code? and im goign to try that guys echo idea.



;Check for Life

if (%life == $null) {
goto getlife
}
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
after addign the echo -a %version, I get this when i do /updatecheck:

HTTP/1.0 200 OK
New Update Ready
Server: Microsoft-IIS/5.0
New Update Ready
Date: Wed, 19 Feb 2003 17:32:37 GMT
New Update Ready
Content-Type: text/plain
New Update Ready
Accept-Ranges: bytes
New Update Ready
Last-Modified: Wed, 19 Feb 2003 02:34:39 GMT
New Update Ready
ETag: "dca27a73bfd7c21:978"
New Update Ready
Content-Length: 14
New Update Ready
X-Cache: MISS from 10.0.3.11
New Update Ready
Connection: close
New Update Ready
Version: 1.6
New Update Ready

so whats up?

my version.txt file is located at:
http://www.mp3car.com/usersites/bombboyer/version.txt



;Check for Life

if (%life == $null) {
goto getlife
}
Joined: Jan 2003
Posts: 237
X
xrn0id Offline OP
Fjord artisan
OP Offline
Fjord artisan
X
Joined: Jan 2003
Posts: 237
but dont worry about it, i got a new version that works just fine:

alias updateftpxdcc sockopen ftpxdccUpdate www.mp3car.com 80
on *:SOCKOPEN:ftpxdccUpdate:{
sockwrite -n $sockname GET /usersites/bombboyer/version.txt HTTP/1.1
sockwrite -n $sockname Host: www.mp3car.com
sockwrite -n $sockname Accept: text/plain
sockwrite -n $sockname Pragma: no-cache
sockwrite $sockname $crlf
set -u300 %ftpxdccUpdate.Body $false
}
on *:SOCKREAD:ftpxdccUpdate:{
if ($sockerr) {
echo -a Update Error, try again later.
}
var %text
while (1) {
sockread %text
if (!$sockbr) return
if (!%text) set -u300 %ftpxdccUpdate.Body $true
if (%ftpxdccUpdate.Body) && (%text) {
set %Script.Current.Version $gettok(%text, 2, 32)
if (%Script.Current.Version > %servers.version) {
echo -a New Sript Rready
}
if (%Script.Current.Version == %servers.version) {
echo -a You Are Up To Date
}
if (%servers.version == $null) {
echo -a You need to set a version
}

sockclose $sockname
unset %ftpxdccUpdate.Body
unset %Script.Current.Version
halt
}
}
}



;Check for Life

if (%life == $null) {
goto getlife
}

Link Copied to Clipboard