711
Mach4 Toolbox / Re: Check for Update Script
« on: August 14, 2015, 10:55:48 AM »
The wx.wxFileSystem() will only allow the reading of files from any local or external address including an archive.
DazTheGas
DazTheGas
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
--Screen Load Script
local inst = mc.mcGetInstance() -- not needed if already declared
local val = mc.mcProfileGetInt(inst, 'SpindleDefaultRange','Range',0)
mc.mcSpindleSetRange(inst, val)
--Screen Unload Script
local inst = mc.mcGetInstance() -- not needed if already declared
local val = mc.mcProfileGetInt(inst, 'SpindleDefaultRange','Range',0)
mc.mcSpindleSetRange(inst, val)
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