Jump to content

Updating .mrc Files


Silo

Recommended Posts

Hi all. Heaven knows why I'm doing this since I never realease anything, though I was wondering if I had my script look at my web server for new updates (probably just updated .mrc files instead of the complete script) when it starts up, would I need to make so if you click on, say an update button, it will automatically download the file. How would I (A) make it actually download to the folder where all the files are kept (B) Overwrite the old files and reload the new ones?

 

I know Travis (and I believe TGK) have the option where you can choose which files to install but that is a bit beyone me atm. I'd just like it so as soon as you decide to do the update it just installs all of the new files.

 

Any help or advice is, as usual, greatly appreciated :)

Link to comment
Share on other sites

Guest X-Fusion

The way I did it was have a version number on the first line of my .mrc file. I'd use a socket to connect and if the first lines matched, it would ignore.

Link to comment
Share on other sites

I've got an addon out where you just put in the url to a website containing files. It will show the file names, the creation dates of each file, and the size of each file. It is called, Download'M, and you can get it from here if you want to take a look at the coding.

 

Basically you can find the creation date in $gettok($gettok($bvar(&bvar,1-).text,7,34),2-3,32) in the sockread event. Then, you can compare that to the same filename you have by using $asctime($file($nofile($mircexe) $+ script0.txt).ctime,dd-mmm-yyyy hh:nn). If the file on the website is greater than the one you already have then just have download, and install the new file. :)

Link to comment
Share on other sites

Thanks, Warrior. I'll have a looksee at it tonight. Is there an option to auto install/overwrite the file?

 

*EDIT* Man, how do you think of these things...

Edited by Silo
Link to comment
Share on other sites

YOu certainly have ben a great help to me, as well as an inspiration. I only hope I can be as good as you guys one day :)

Link to comment
Share on other sites

Guest Travis

You open a socket to the file and the server will start sending you the file one line at a time.

 

 

You just /write this to the file name. /write -c file..mrc first. When it is all finished /load the file.

 

mIRC stores each file in memory on start so you could actually delete the physical file while mIRC is still running and not see a difference until you restarted mirc. Because of this you can /write -c a file in use, then /write each line. Once it is done, /load will force mIRC to reload the file (updated) into memory.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...