I'm really stuck on this one, and I feel like it's something really simple... Here's the context:
I'm using Mach 4. I have some scripts I am working on writing. Two scripts need to access the same value, and a third changes that value.
I create a value in the register, and I wrote two scripts that can access that value no problem. It's the third part I am having trouble with:
I cannot get my third script to change that value no matter what I try. I've read the lua scripting guide and tried the examples several times and they just aren't working. It seems like the examples in that part of the guide are unnecessarily complex.?
To try and figure this out I boiled down the code to the simplest thing I could think of, here's what I'm working with:
local inst = mc.mcGetInstance()
hreg = mc.mcRegGetHandle(inst, "iRegs0/Spoilboard") --You can edit this number in the registry
spoilb = mc.mcRegGetValueString(hreg)
--spoilb = tonumber(spoilb)
wx.wxMessageBox(spoilb)
All this code does is prove I can pull a value. This works.
I've tried this code section:

I can't get that code to work at all. I even have had it so it debugs fine, but in watching the diagnostics for the register values it never actually changes the value.
The "WriteRegister" code seems to be exactly what I want, a dead simple way to change a register value but in this doc it's the only place it's mentioned. I can't find any mention of it in the CoreAPI doc either.
Can anyone shed some light on this?
All I want to do is take that registry value (spoilboard) and change it to another number. Very simple.
