does the following even work? I added the rc variables to find out where the problem was. mc.mcRegGetHandle returns a -27 which causes mc.mcRegSetValueString to return -27.
#define MERROR_REG_NOT_FOUND -27
function Master.LoadRegister(ini, name)
local val, rc = mc.mcProfileGetString(inst , tostring(ini), name, "0.000")
local hreg, rc = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", name))
rc = mc.mcRegSetValueString(hreg, val)
return tonumber(val)
end
I've been trying to gain access to the scr.* properties. in particular some DRO's I've created for use in the m6() macro.
I added the following to my m6 startup.
if (package.loaded.scr == nil) then
scr = require "screenipc"
scr.scIpcInit("127.0.0.1")
end
scr.GetProperty("droSafeZ", "Value") always returns "" even though I've set it earlier to a value of 0.75 using scr.SetProperty("droSafeZ", "Value", tostring(num))
I have two functions.. I've modified mcMasterModule.lua's LoadRegister function so it returns the numeric value of the register.
function LoadAll()
{
SafeZ = mcp.LoadRegister(N_, "SafeZ", "0.00")
scr.SetProperty("droSafeZ", "Value", tostring(SafeZ))
}
function SaveAll()
{
val = scr.GetProperty("droSafeZ", "Value")
mcp.SaveRegister(N_, "SafeZ", val)
}
if (mc.mcInEditor() == 1) then
LoadAll2016()
SaveAll2016()
end