- system.rest()
- system.exec()
- system.shellExec()
- system.getClipboard()
- system.setClipboard()
- system.getActiveCodePage()
- system.setConsoleCodePage()
- system.setPriority()
- system.repollHid()
Put the process to sleep for 'msec' milliseconds. This will "freeze" script execution for this duration.
Generally, it is a bad practice to use this for timing. The exact time it takes for the processor to return from this yield is not precise. It's also a bad idea to have any long pauses in your main loop, so use this function responsibly.
Run the given command and return its output as a string.
While running the command, the script execution is paused until the command finishes. For example, the 'ping' command usually takes a few seconds to finish.
@code() -- Run the ping command, as if you ran it from the console local pingData = system.exec("ping www.google.com"); print(pingData); @endcode @code() Pinging www.google.com [172.217.4.196] with 32 bytes of data: Reply from 172.217.4.196: bytes=32 time=13ms TTL=55 Reply from 172.217.4.196: bytes=32 time=8ms TTL=55 Reply from 172.217.4.196: bytes=32 time=11ms TTL=55 Reply from 172.217.4.196: bytes=32 time=17ms TTL=55 Ping statistics for 172.217.4.196: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 8ms, Maximum = 17ms, Average = 12ms @endcodeExecute a system command or process when given a
'execInfo' should be a
You may use this function to start new programs that run independently of MicroMacro; this will not freeze the script execution at all since it will not wait for any output.
Returns the system clipboard data (What you copied when pressing CTRL+C/right-click copy) as a
Sets the system's clipboard to 'data'. Returns
Returns the system's current code page as an integer.
Returns the console's current code page as an integer.
Change the process's priority. 'priority' should be
Force a repolling of Human Input Devices (keyboard, mouse, gamepads). This refreshes the state for these devices so that any new input can be retrieved.
Typically you should not use this function unless you know what you are doing. Calling this function may result in input-related events not properly being triggered. There generally is no need for it as MicroMacro will repoll HIDs for you with every main loop cycle.
One potential use for this is when you need to get the new keyboard state within a long-running loop.
@code() while(true) do -- Need to force repolling here so that our call to keyboard.pressed() works as expected system.repollHid(); if( keyboard.pressed(key.VK_ENTER) ) then doSomething(); end end @endcodePage last updated at 2021-11-14 12:59:36