1
Mach4 General Discussion / Re: need help with script
« on: August 31, 2015, 03:50:18 PM »
Found out that the piece of script from poppabear isn't working as intended. If you only activate one of either inputs the task wil already be executed.
the correct way to do this is.
local Input1 = 0;
local Input10 = 0;
local hSig = 0;
hSig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT1);
Input1 = mc.mcSignalGetState(hSig);
hSig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT10);
Input10 = mc.mcSignalGetState(hSig);
if ((Input1 == 1) and (Input10 ==1)) then
local inst = mc.mcGetInstance();
mc.mcCntlCycleStart(inst);
end
I hope it is to some use.
Marco.
end
the correct way to do this is.
local Input1 = 0;
local Input10 = 0;
local hSig = 0;
hSig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT1);
Input1 = mc.mcSignalGetState(hSig);
hSig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT10);
Input10 = mc.mcSignalGetState(hSig);
if ((Input1 == 1) and (Input10 ==1)) then
local inst = mc.mcGetInstance();
mc.mcCntlCycleStart(inst);
end
I hope it is to some use.
Marco.
end