MUSHclient, check for new version

Posted by Nick Gammon on Thu 17 Apr 2003 09:57 PM — 11 posts, 34,584 views.

Australia Forum Administrator #0
The intended method of finding out about new versions is to subscribe to the forum section where announcements about new versions of MUSHclient appear.

Because this section is only used to announce new versions, then you should automatically get an email within minutes of the new version being released.
USA #1
Ah.. Then he could set it to look at that forum for the new version. ;)

One suggestion Krenath. You could probably execute a call of some sort to auto-download it as well. Just pass the filename and ftp address to a IE windows or maybe if the person has something like Getright installed you could pass the link direct to the download manager. lol But yes, you should do an http: read of the forum to see if a new version is there, since the one uploaded may not be a 'final' version until specifically announced. ;) This is especially true if you later try to use the same technique with an ftp or http server that won't let you read the directory list.

Of course if Nick really doesn't want us doing this...
Australia Forum Administrator #2
New versions tend to get released in bursts - first a major upgrade, then a few tweaks and bug fixes, and then nothing for a few months.

So, I would prefer to use the forum notification method.

Imagine, if you will, 1000 MUSHclient users checking for a new version every day, that is somewhat increased network bandwidth, for no real gain.

If it was done once a week it probably isn't a big problem. :)
USA #3
Well, the intended design was for the subroutine to only be called when the script is processed on startup of MUSHclient. Since I leave MUSHclient open and connected for extremely long periods of time, I, personally, wouldn't be hitting the FTP server very often at all.

Additionally, the subroutine does nothing other than open a connection, list the directory, and immediately disconnect, so the load is intended to be minimal.

Additionally, I simply wanted to see how easy it would be to accomplish such a thing. In the future, an automated FTP download could be used to handle fetching files from other locations, such as automatic download of pictures or sound files.

That, and the parsing of XML... I have plans for creating some code to dump information in XML format from the MUSH to the client so the client can pass it to graphical user interface code.

For ease of catching such information with triggers, the MUSH could send a 'start of XML' header, preface each line with an XML> prefix, and send an 'end of xml' footer after all the lines have been captured and it's time to process the data.
Australia Forum Administrator #4
Krenath,

Unfortunately, your code, which was interesting, seems to have disappeared in a database glitch, see top of this page.

If you want to repost it, I think others would be interested.
USA #5
Here's the original subroutine. It depends on downloading and installing ASP/ActiveX components which are freely downloadable from http://www.chilkatsoft.com/. The necessary components are their FTP component and their ASP XML component.

If you use this code, please use it on a timer that's scheduled to fire no more often than once a day. We do not need to pound the MUSHClient FTP server into oblivion.

Quote:

Sub FTPCheck
	Dim NewVersion
	Dim FTP
	Dim Listing
	SET FTP=CreateObject("ChilkatFTP.ChilkatFTP") 
	Set XML = CreateObject("AspXml.AspXml")
	FTP.Hostname = "ftp.gammon.com.au"
	FTP.Connect()
	If Ftp.IsConnected then
		FTP.ChangeRemoteDir "mushclient"
		XML.LoadXML FTP.GetCurrentDirListing("mushclient*.exe")		
		Set rowNode = XML.FirstChild()
		while (Not (rowNode Is Nothing))
			Set colNode = rowNode.FirstChild()			
			FileName =colNode.Content
			FileVersion = replace(""&Replace(""&filename,"mushclient",""),".exe","")
			If cint("0"&FileVersion) > (100*world.version) then
				NewVersion = True
				world.note "There is a new MUSHclient version (" & cint("0"&Fileversion)/100 & ") Available!"	
			end if				
			Set rowNode = rowNode.NextSibling()
		wend
		FTP.Disconnect()
	else
		world.note "Failure connecting to MUSHclient FTP server."		
	end if
End Sub
Greece #6
Oh, interesting... How did you create the control in order to reference it?
Greece #7
Also, can I respond to events with that method?
USA #8
I download the controls in question from http://www.chilkatsoft.com/. They're freeware.

But if you use something like Visual Basic or Visual C++, it's fairly simple to create your own activeX controls. I won't really go into it here, however. It takes a little bit of explaining, longer than it takes to make a sample control, actually.
Greece #9
Yes, making an ActiveX control is really simple (I have made a few), but what I'm asking is whether one can link to them via VBScript or another language, and work with them like in VB. I don't see how you could intercept their events, but even only calling functions would be enough in some cases...
Does anyone have more info on the subject?
USA #10
No, you wouldn't be able to intercept their events, but that's normal for Active Server Pages web development, so ActiveX components designed for use in ASP pretty much take this into account. What you're limited to is accessing functions, properties, and methods of the component.

To create a reference to a component under VBscript in MUSHclient, you just use the CreateObject("<component.name>") function to return a reference to the component and make use of it from there.