mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
please help me to make a update soket for my bot

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

Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
Yes, That what i need

Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
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!
}

 


Joined: Mar 2003
Posts: 49
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2003
Posts: 49
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?

Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
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.

Joined: Dec 2002
Posts: 580
N
Fjord artisan
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

Link Copied to Clipboard