mIRC Home    About    Download    Register    News    Help

Print Thread
How I can make a update socket? #25650
23/05/03 04:37 PM
23/05/03 04:37 PM
Joined: Mar 2003
Posts: 49
Israel,Ashkelon
S
SnakeRulez Offline OP
Ameglian cow
SnakeRulez  Offline OP
Ameglian cow
S

Joined: Mar 2003
Posts: 49
Israel,Ashkelon
please help me to make a update soket for my bot

Re: How I can make a update socket? #25651
23/05/03 05:37 PM
23/05/03 05:37 PM
Joined: Jan 2003
Posts: 148
Norway
K
Knappen Offline
Vogon poet
Knappen  Offline
Vogon poet
K

Joined: Jan 2003
Posts: 148
Norway
What exactly do you want? An update checker or an update dowloader? I can provide you with both if you want! smile

Re: How I can make a update socket? #25652
23/05/03 05:40 PM
23/05/03 05:40 PM
Joined: Mar 2003
Posts: 49
Israel,Ashkelon
S
SnakeRulez Offline OP
Ameglian cow
SnakeRulez  Offline OP
Ameglian cow
S

Joined: Mar 2003
Posts: 49
Israel,Ashkelon
Yes, That what i need

Re: How I can make a update socket? #25653
24/05/03 01:01 PM
24/05/03 01:01 PM
Joined: Jan 2003
Posts: 148
Norway
K
Knappen Offline
Vogon poet
Knappen  Offline
Vogon poet
K

Joined: Jan 2003
Posts: 148
Norway
OK...

First of all you have to have a version checker to check if there is a new update..

Code:
 

alias update.check
  sockclose script.updatecheck
  sockopen script.updatecheck www.geocities.com 80
}

on *:sockopen:script.updatecheck:{
  if ($sockerr) { echo -a Cannot resolve server | halt }
  sockwrite -n $sockname GET /botsnake/index.htm HTTP/1.1
  sockwrite -n $sockname Host: www.geocities.com
  sockwrite -n $sockname $crlf
}

on *:sockread:script.updatecheck:{  
var %version = your current version
  var %ver
  :loop 
  sockread -f %ver 
  if (!$sockbr) return  
  if (!%ver) %ver = -  
if (Version * iswm %ver) { %ver = $gettok(%ver,2,32) }
  if (%ver == %version) { echo -a There is no updates }
  if (%ver > %version) { echo -a A new update!  | $download.update }  
  goto loop
}



If there is an new update, the script will execute the following commands..

Code:
 

alias -l download.update {
sockopen download.update www.geocities.com 80
}

on *:sockopen:download.update:{
  sockwrite -n $sockname GET /botsnake/Bot.exe 
echo -a Downloading...
}

on *:sockread:download.update:{
  sockread &temp   
  if (!$sockbr) return   
  bwrite Bot.exe -1 &temp       
}

on *:sockclose:download.update:{
echo -a Download complete!
}

 


Re: How I can make a update socket? #25654
24/05/03 01:57 PM
24/05/03 01:57 PM
Joined: Mar 2003
Posts: 49
Israel,Ashkelon
S
SnakeRulez Offline OP
Ameglian cow
SnakeRulez  Offline OP
Ameglian cow
S

Joined: Mar 2003
Posts: 49
Israel,Ashkelon
1. What i need to replace? - I don't know sockets..
The site that be for downloading the bot is www.geocities.com/botsnake/Bot.exe
and the page that be writing there the new versions is
www.geocities.com/botsnake/index.htm

So what i need to change?

Re: How I can make a update socket? #25655
24/05/03 02:44 PM
24/05/03 02:44 PM
Joined: Jan 2003
Posts: 148
Norway
K
Knappen Offline
Vogon poet
Knappen  Offline
Vogon poet
K

Joined: Jan 2003
Posts: 148
Norway
I have editet the code for you so you can copy it clean and paste it in to your remote.

!!!!!! The only thing you have to change is where it says
var %version = your current version
replace the blue text with whatever version your script is.

Re: How I can make a update socket? #25656
26/05/03 03:57 PM
26/05/03 03:57 PM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
NaquadaServ  Offline
Fjord artisan
N

Joined: Dec 2002
Posts: 580
I have some good upgrading code in my Qserve scripts...

The script automates producing upgrades and automates upgrading on the user end. The upgrade is installed without shutting down mirc. Upgrades are downloaded via http and uploaded via FTP. It also supports upgrading it's self.

Goto www.qserve.org and download, look at the following files...

Code:
- system\Remotes\other.ini (Upgrade the Upgrade Module)
   * on *:SIGNAL:UPGRADE_START
   * alias webget.f
   * alias install.upgrade.upgrade
   * on 1:sockopen:webfile2
   * on 1:sockread:webfile2
   * on 1:sockclose:webfile2
   * on *:SIGNAL:UPGRADE_COMPLETE (Remove run.once from here)
'
- system\Remotes\Upgrades.ini (Primary upgrade code)
   * Look at the whole file
   * %FTP.Site 80.80.80.80
   * %FTP.Port 21
   * %FTP.Login loginname 
   * %FTP.Pass password
   * %FTP.PostUpload $true
   * %FTP.RemoteFolder /Qserve-Update/
'
- gzip.exe
   * Used for compression

%FTP.Login and %FTP.Pass are not in the scripts, they are variables only needed on the producers end and should be set manulally...

- You will need to create a "version.txt" file as a template of what files to include in the upgrade. Put it in $mircdir.
Code:
MASTER_LIST (Dummy line, not used...)
fileserver.ini
ftp_addon.ini


Also I use a global variable called "%Version". It is increment by 0.001 every time /make.upgrade is done.


NaquadaBomb
www.mirc-dll.com