mIRC Home    About    Download    Register    News    Help

Print Thread
#217215 05/01/10 03:26 AM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

I have this code for checking for updates, the file is exist into my site but on read there is a problem, can anyone help me? , very thanks

Code:
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
}


Last edited by westor; 05/01/10 03:27 AM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #217264 06/01/10 11:31 AM
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
hi
put a "echo -a" to see if you find what u need

Code:
on *:sockread:amec_update1: {
  if ($sockerr) { did -a amec_update 13 Update manager: connection problem | halt }
  var %v | sockread %v
  echo -a SockRead: %v
}



WorldDMT
chacha #217269 06/01/10 02:51 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
i did it and nothing happens :s


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #217289 07/01/10 09:22 AM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Then echo your sockopen event and check for sockerrors.

DJ_Sol #217360 09/01/10 05:43 AM
Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
also make sure you check $sockbr after a sockread wink


Link Copied to Clipboard