Hello Guest it is June 21, 2021, 12:45:20 PM

Author Topic: LUA Script will not work after compile  (Read 1338 times)

0 Members and 1 Guest are viewing this topic.

LUA Script will not work after compile
« on: May 22, 2017, 04:30:20 PM »
Hello,

i am trying to write an M6 macro. if i debug the script everything will be fine. But when i compile the script, restart Mach4, the macro will not work.
Ok, i tried the M6 macro from the original mill profile. It works. Now i opened the orignal script with wxLUA, change nothing, only compile it, restart Mach4, do an M6.......nothing.

Is there a trick i dont know?

Mach4 4.2.0.3233
wxLUA 2.8.12.3  -> wxWidgets 3.0.1
Win10 x64 Ver 1607 Build 14393,1198
Re: LUA Script will not work after compile
« Reply #1 on: May 23, 2017, 12:03:25 AM »
Hi,

did you rename your compiled script to extension *.lua?
When you look at the samples from scripting manual then the package path contains only patterns with ?.lua

hth Reinhard
Re: LUA Script will not work after compile
« Reply #2 on: May 23, 2017, 11:59:51 AM »
Hello Reinhard,

i tried it with extension *.lua --> DidnĀ“t work.
I think the extension for the script should be *.mcs and for the compiled script *.mcc. Mach4 need only the mcc-file.

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: LUA Script will not work after compile
« Reply #3 on: May 23, 2017, 02:09:44 PM »
Post your script and someone may be able to help.

Macros are compiled at run time. Might want to close mach, delete the m6.mcc file in the macros folder and any backups of it then launch Mach and see if it works.

BTW, the m6 should be m6 and not M6.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: LUA Script will not work after compile
« Reply #4 on: May 24, 2017, 01:52:05 PM »
Chaoticone, you are my HERO!
The filename was the problem. "M6.mcc" dont work, "m6.mcc" work.  ;D

THANK YOU!

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: LUA Script will not work after compile
« Reply #5 on: May 24, 2017, 02:27:42 PM »
No problem,

The only reason M6 would not work is because the function in the macro is named m6, not M6. But the default naming convention is m6 and is what should be used. Windows will work either way as long as you're consistent when naming the function, calling the function and naming the macro but not all platforms will.  And since lua is case sensitive M6 and m6 are 2 completly different things.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!