|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Hello, I had make this update script from the old year and worked perfect while i do it now it is not working and have an error message can anyone help me?, please - thanks! SCRIPT :>
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 }
}
ERROR MESSAGE :>
error - HTTP/1.1 403 Forbidden
error - Server: uServ/1.5.2
error - Date: Thu, 21 Jan 2010 15:26:26 GMT
error - Content-Type: text/html; charset=UTF-8
error - Content-Length: 795
error - Connection: keep-alive
error - Keep-Alive: timeout=15
error -
error - <html>
error - <head>
error - <meta name="robots" content="noindex,nofollow">
error - <title>HTTP 403 Forbidden</title>
error - <style>
error - body, td {font-family:Tahoma,Arial;font-size:9pt;}
error - a:link {text-decoration:underline; color:#0000FF}
error - a:visited {text-decoration:underline; color:#0000FF}
error - a:hover {text-decoration:underline; color:#FF0000}
error - .copy {font-size:7pt;}
error - </style>
error - </head>
error - <body bgcolor="#FFFFFF">
error - <table height="100%" width="100%" border="0">
error - <tr height="100"><td valign="top" align="center">
error - <h2>You are not allowed to view this page</h2>
error - </td></tr>
error - <tr><td valign="top" align="center">
error - <p>Access to this page using your personal data is forbidden.</p>
error - </td></tr>
error - <tr><td valign="bottom" align="center" class="copy">
error - <a href="http://www.ucoz.com/"><b>uCoz Web Services</b></a><br>
error - </td></tr>
error - </table>
error - </body>
error - </html>
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Basically, you are not sending valid http header information when trying to view the page and/or you cannot view it from your current IP. If you can view the page from your browser, you can try a utility for IE called IEWatch that will display what your browser sends when viewing a page. Include the same in your sockwrite section and it should work.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Feb 2009
Posts: 133
Vogon poet
|
Vogon poet
Joined: Feb 2009
Posts: 133 |
hi look here 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 remove the "echo -s error - %v"
WorldDMT
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
remove the "echo -s error - %v" That isn't the OP's problem. That echo is to show what the OP is getting instead of what should be received.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Mar 2004
Posts: 54
Babel fish
|
Babel fish
Joined: Mar 2004
Posts: 54 |
The server is refusing queries from clients with no (or invalid) User-Agent header.
Add the following line in "on *:sockopen:amec_update:"
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
OH MY GOD.. You save my life... very thanks man i have no words to say thank you.
One question if i try to replace this
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
with this it will be a problem ?
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
thanks
|
|
|
|
Joined: Mar 2004
Posts: 54
Babel fish
|
Babel fish
Joined: Mar 2004
Posts: 54 |
As long as it's a valid user-agent, I don't think you risk being blocked.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
so it won't be a problem?
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Just try it and see. A site won't block a valid user agent, but many will block invalid ones because they don't want bots using their bandwidth.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
OP
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
I try it for me and not any problems but i don't know if an other will try this on an other pc or without have mozilla firefox installed it will be a problem?
Last edited by westor; 22/01/10 04:18 PM.
|
|
|
|
Joined: Mar 2004
Posts: 54
Babel fish
|
Babel fish
Joined: Mar 2004
Posts: 54 |
This is just a "signature". You don't need that specific browser to be installed to make it work.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
As Zed said, it doesn't matter who uses it. The header you are sending is a "fake" header anyhow. The site believes what you send it. You are telling the site that you are using that specific browser to view the page, which you really aren't doing. The site won't know the difference whether you are using it or anyone else uses it.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|