From 159379980ec8c79608b1adada4b66b1d8c016e4a Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 10 May 2018 15:26:27 +0200 Subject: lua: expose async commands Might be useful for some. --- DOCS/man/lua.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'DOCS') diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index c0c4f9b00a..0dbd7d3c0a 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -115,6 +115,15 @@ The ``mp`` module is preloaded, although it can be loaded manually with error. ``def`` is the second parameter provided to the function, and is nil if it's missing. +``mp.command_native_async(table [,fn])`` + Like ``mp.command_native()``, but the command is ran asynchronously (as far + as possible), and upon completion, fn is called. fn has two arguments: + ``fn(success, result, error)``. ``success`` is always a Boolean and is true + if the command was successful, otherwise false. The second parameter is + the result value (can be nil) in case of success, nil otherwise (as returned + by ``mp.command_native()``). The third parameter is the error string in case + of an error, nil otherwise. + ``mp.get_property(name [,def])`` Return the value of the given property as string. These are the same properties as used in input.conf. See `Properties`_ for a list of -- cgit v1.2.3