Machsupport Forum
Mach Discussion => Mach4 General Discussion => Mach4 Toolbox => Topic started by: DazTheGas on July 09, 2015, 04:58:32 AM
-
well 2522 was out for a while before I new about it so I did this so I could always be up to date. just put it in a button or function somewhere.
local inst = mc.mcGetInstance();
local file = wx.wxFileSystem():OpenFile('http://www.machsupport.com/software/downloads-updates/#tabs-2')
if not file then
wx.wxMessageBox("Update Check is Broken") return
end
local data = file:GetStream()
local text = {}
repeat
local c= data.C
if data:LastRead() ~= 0 then
if c > 0 then text[#text+1]=string.char(c) end
end
until data:LastRead() == 0
local web = table.concat(text)
local vers = string.sub(tostring(mc.mcCntlGetVersion(inst)),-4)
if string.find (web, vers)then
wx.wxMessageBox('Mach4 is upto date');
else
wx.wxMessageBox('Theres a different version of Mach4 to Download')
end
DazTheGas
-
cleaver bugger
-
Sweet :)
-
That is pretty awesome! Thanks for sharing! :)
Brett
-
Wow. Your program is so simple and clean! Fantastic work. If i might ask one question > . . the statement ' local data = file:GetStream() ' is very powerful , is there a reciprocal 'SendStream()' function ? I have studied the WXWidgets Docs but cannot find a way to 'send out' ethernet data from mach4.
Thanks in Advance,
And please consider doing more of your programmer utilities.
-
The wx.wxFileSystem() will only allow the reading of files from any local or external address including an archive.
DazTheGas