not sure exactly what you are looking for, but this will get you started.
function m311()
inst=mc.mcGetInstance()
local hReg = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
local rc = mc.mcSignalSetState(hReg, true)
end
if (mc.mcInEditor() == 1) then
m311()
end
I started you off by putting the above code in a text file and changed the extension to .mcs (attached) and which you can put it in your profile's "macro" folder.
it will turn on output5 when you call M311
You can than refer to the "Scripting Manual" in your Mach4 Docs folder to edit and refine the script to do what you want it to.
enjoy!