so we are clear and anyone that comes a cross this, this does not work properly in a button script it will work some what as a single line of G code
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G1 X10 Y10 F450")
mc.mcCntlGcodeExecute(inst, "G1 X-10 Y-10 F450")
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G0 X10 Y10 F450")
mc.mcCntlGcodeExecute(inst, "G0 X-10 Y-10 F450")
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G0 X10 Y10\n")
mc.mcCntlGcodeExecute(inst, "G0 X5 Y5\n")
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G1 X10 Y10\n")
mc.mcCntlGcodeExecute(inst, "G1 X5 Y5\n")
this does for more than one G code move in a button
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "G0 X10 Y10\nG0 X5 Y5\n")
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "G1 X10 Y10\nG1 X5 Y5\n")
having it like this wont work ever having G1 does not help it to work or a F
mc.mcCntlGcodeExecute(inst, "G0 X10 Y10")
mc.mcCntlGcodeExecute(inst, "G0 X0 Y0")
or
mc.mcCntlGcodeExecute(inst, "G0 X0 Y0 X10 Y10 ")
the reason is here
http://www.machsupport.com/forum/index.php/topic,28556.40.htmlas I have been informed above is not quite correct
this is
local inst = mc.mcGetInstance()
local code = "G0 X10 Y10\n"
code = code .. string.format("G4 p2\n")
code = code .. string.format("G1 X-10 Y-10\n")
code = code .. string.format("G4 p2\n")
code = code .. string.format("G1 X0 Y0 F150\n")
mc.mcCntlGcodeExecute(inst, tostring(code))