Hi Craig,
I'm a newcomer to LUA myself and like you really struggled initially. While by no means fluent I'm getting there. Having got over
the hump I now find LUA to be superb.
API=Application Program Interface
mc.=Mach Core
LUA like all computer languages have variables which you can manipulate in any number of ways. For LUA to be useful to us we
need to be able to make it do things to our machine. Mach provides a whole bunch of functions which allow you to do that, collectively
called the API. On the 'Program Run' page with 'File Ops' in the lower notebook with Mach enabled there is a 'Help Docs?' button and in
there 'Mach4CoreAPI.chm' provides the complete list, aside from other manuals and lists. Its quite daunting to look at to start with.
Take a simple one to start with:
inst=mc.mcGetInstance()
The mc. means 'a function within Mach Core' and the function is mcGetInstance. Sometimes the mc. is referred to as a namespace
There are others and some I have a lot of trouble with for instance wx. It refers to wxWidgets functions which are graphical windows,
message boxes, dialogues and that sort of thing. Another one which crops up a lot is scr. It addresses screen elements like buttons and LEDs.
While the Mach Core API is well documented some of the others are not, scr. for instance. wx. on the other hand is superbly documented
because it is so widely used by so many different languages, the downside is its so complete I can't usually make much sense of it, it takes
some serious 'nerdiness' to read.
I've found particularly with wx. I copy/edit examples of whats already been written, setting up frames, panels and event handlers from scratch
is not easy.
For basic LUA stuff I often have
https://www.lua.org/pil/contents.htmlopen on the desktop so I can dip into it at need.
The good news tho is that unless you have a particular need for something that you probably don't really need to write any code to convert
a machine, Mach4 is pretty complete for milling machines. Additionally if you do want something the chances are that someone has probably
got something pretty close you can copy/edit. There are some regular contributors, Daz-The-Gaz especially who is VERY well versed in LUA and
really goes out of his way to help newcomers.
Craig