Here is the first version of the patch (its against trunk Rev 388)
zSHARE - chdk-lua.patch.zipI bound all functions that where available in uBASIC to Lua, except md_detect_motion. It is implemented in some special way I didn't bother to analyse. But if someone beats me to it...
I actually only tested shoot/sleep/get_prop/press/release/click because that are the only functions I need in my scripts. But the other ones are mostly very simple and should work out-of-the-box.
I could use some help in testing all functions. For half of them I don't even know what they are supposted to do.
Note that some function have now boolean parameters or results. This includes is_key,set_autostart,get_autostart,usb_power. Please inform me if some other functions should accept or return booleans instead of numbers.
What is still missing are parameters. I concentrated on providing all functions first.
I think I'll get to parameters in the next 2 or 3 days. Don't have much time weekdays.
With the patch it should be possible to run both Lua und Basic scripts. If the script file ends with .lua or .LUA it will be run as Lua script.
A new thing that some will experience is that you can now hang the camera with an improper script. Lua scripts are run until you interrupt them with shoot/sleep/press/release/click or wait_click. If you wait for an event make sure to sleep at least once in your loop.
Errors will be shown in the script console window. Sometimes this window disappears very fast after the script stops. Don't know what to do about it.
Have fun and report back how its working out!