- macro.init()
- macro.main()
- macro.event()
- macro.fireEvent()
- macro.getVersion()
- macro.is32bit()
- macro.is64bit()
This is an empty function that will be called once at the start of your script's execution. You should replace this with your own function.
The executing script's path and filename plus any arguments passed to the script execution via command line will be also passed to this function.
@code() function macro.init(script, ...) print("Script:", script); for i,v in pairs(unpack2(...)) do print(v); end end @endcode @code() myScript.lua abc 123 "Hello World" @endcode @code() Script: ./scripts/myScript.lua abc 123 Hello World @endcodeThis is an empty function that will be called once per logic cycle (~1,000 times a second). You should replace this with your own function.
The only parameter received is 'deltaTime'; the amount of time (in seconds) that has passed since the last call to this function.
You are expected to return
It is recommended that you do not use any long while loops or blocking functions here; the main update function should execute quickly and constantly to ensure responsiveness.
@code() function macro.init() continue = true; print("This script does nothing, but will terminate if you press the END key"); end function macro.main() if( continue ) then return true; else -- User pressed the END key so the script will shut down now. printf("\n\nAww, okay. Good bye!\n"); return false; end end function macro.event(e, ...) -- Check if the user has pressed the END key if( e == "keypressed" ) then local vk, toggle = ...; if( vk == key.VK_END ) then continue = false; end end end @endcodeThis is an empty function that will be called once for every event that is triggered. You should replace this with your own function.
'eventType' is a
Pushes a custom, user-defined event onto the event queue, though there are limitations.
Only very basic data types are currently supported (
Returns the version as a MAJOR.MINOR.BUILD
Returns whether or not the MicroMacro instance is 32-bit.
Returns whether or not the MicroMacro instance is 64-bit.
Page last updated at 2023-09-04 13:54:04