Now I'm getting somewhere. Just need to figure out why it's not running the scripts. My goal here is to create a button that will dock a dust boot and pick it up again. The Signal needs to be setup within the Mach Outputs, and assigned to the function AutoDustBoot. Signal 100 is arbritrary. Button now toggles back and forth and toggles color. I believe that the color's Paul showed were Red and Green and along with everything else was just confusing. There are probably much better ways of doing this. But for now, this works. A register that saves would be ideal, but then it's a whole nother ball of wax. Next I'll work on a probe autoload function.
function UserGUIModule.CreateUserCommands()
local function RunM(code)
-- fire and return immediately; the m-code handles any waiting/prompting
local state = w.GetSignalState(mc.OSIG_OUTPUT100)
if state == 1 then
w.api("mcCntlMdiExecute", inst, "m2222")
else
w.api("mcCntlMdiExecute", inst, "m2223")
end
--- w.api("mcCntlMdiExecute", inst, code)
w.SetSignalState(mc.OSIG_OUTPUT100, not state)
end
w.CreateSimpleCommand("AutoDustBoot") -- this creates the button and names it
w.CreateCommandActionOption("AutoDustBoot", function()RunM("AutoDustBoot") end) -- this gives the button logic
-- w.SetCommandButtonColors("AutoDustBoot", "#FF0000", "#00FF00")
w.SetCommandButtonLabels("AutoDustBoot", "DustBoot on", "DustBoot off")
return true, true, w.FunctionCompleted()
end