mIRC Home    About    Download    Register    News    Help

Print Thread
#173600 26/03/07 04:00 PM
D
DarkBoi
DarkBoi
D
Hey what I'm trying to do is get a script that i'm in the process of making to check back to a main location and make sure it has the newest script, if it does it just continues if it doesn't it downloads the new script and reloads the script to the newest version. Can this be done? can someone point me in the right direction with this?

#173602 26/03/07 05:07 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You will need to use sockets. If you're not familiar with it, google & read some tutorials about them. You can also look at some mIRC update checker snippet/scripts & see how they did it so you may have an idea.

Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
I'll give you the basic idea behind mine.

I have a text file on my server that has each file name and its version number.
When I check for updates I check this file for the versions that are on the script. If any version number is greater or there is something on the server that isnt on my script it says there is an update available.

When you download, I read those .mrc files and overwrite the files in my script. Starting by write -c the file in my script.

This means I need to manually keep that text file on my server up to date. Then in each script.

on *:unload:/remini mirc.ini version $nopath($script)
on *:start:/writeini mirc.ini version $nopath($script) 1

This is where the version information is kept. This shows version 1.

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
I think this reply is for Darkboi. wink

#173618 26/03/07 09:51 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Most of my distributed scripts have an updater. I just have it check the download location for the version number (my pages for each script mention the version number). However, none of my scripts will automatically download/"install" updates. I've always felt that although doing so is easier, it feels to me like I'm forcing it on people. Some people don't want to update, or else don't like the idea of a script doing it automatically without their approval. If you want it to do an automatic update, then you would need to download the script and reload it.

There are various socket script examples on the forum. Do a search in this forum for sockopen and you should find some good examples.

Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
I offer a dialog that shows you the files available to update and they can select which files they want to update and click update.

xDaemon, I think he can figure it out.

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Ok. smile

It looked like it did it all automatically, which is why I commented (plus, it was also in response to the OP's request).


Link Copied to Clipboard