diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index 181aa19..6039266 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -1349,7 +1349,7 @@ techage.manual_DE.aText = { " - Über 'stacks = $read_data(\\, \"stacks\")' kann der Inhalt der Kiste ausgelesen werden. Siehe dazu: https://github.com/joe7575/techage/blob/master/manuals/ta4_lua_controller_EN.md#sensor-chest\n".. " - Über '$send_cmnd(\\, \"text\"\\, \"press both buttons andnput something into the chest\")' kann der Text im Menü der Sensor Kiste gesetzt werden.\n".. "\n".. - "Über die Checkbox \"Erlaube öffentlichen Zugriff\" kann eingestellt werden\\, ob die Kiste von jedem genutzt werden darf\\, oder nur vom Spielern die hier Zugriffsrechte haben.\n".. + "Über die Checkbox \"Erlaube öffentlichen Zugriff\" kann eingestellt werden\\, ob die Kiste von jedem genutzt werden darf\\, oder nur von Spielern die hier Zugriffsrechte haben.\n".. "\n".. "\n".. "\n", diff --git a/lua_controller/controller.lua b/lua_controller/controller.lua index c1f9b34..9673a3f 100644 --- a/lua_controller/controller.lua +++ b/lua_controller/controller.lua @@ -120,10 +120,18 @@ techage.lua_ctlr.register_function("get_ms_time", { cmnd = function(self) return math.floor(minetest.get_us_time() / 1000) end, - help = "$get_ms_time()\n".. + help = " ms = $get_ms_time()\n".. " returns time with millisecond precision." }) +techage.lua_ctlr.register_function("get_gametime", { + cmnd = function(self) + return minetest.get_gametime() + end, + help = " t = $get_gametime()\n".. + " returns the time, in seconds, since the world was created." +}) + techage.lua_ctlr.register_function("position", { cmnd = function(self, number) local info = techage.get_node_info(number) @@ -132,7 +140,7 @@ techage.lua_ctlr.register_function("position", { end return "(-,-,-)" end, - help = "$position(number)\n".. + help = " pos = $position(number)\n".. " returns the position '(x,y,z)' of the device\n with given number." }) @@ -144,7 +152,7 @@ techage.lua_ctlr.register_action("battery", { local val = (BATTERY_CAPA - math.min(batmeta:get_int("content") or 0, BATTERY_CAPA)) return 100 - math.floor((val * 100.0 / BATTERY_CAPA)) end, - help = " $battery()\n".. + help = " lvl = $battery()\n".. " Get charge level of battery connected to Controller.\n".. " Function returns percent number (0-100) where 100 means full.\n".. " example: battery_percent = $battery()" diff --git a/manuals/ta4_lua_controller_EN.md b/manuals/ta4_lua_controller_EN.md index 297989c..0d21868 100644 --- a/manuals/ta4_lua_controller_EN.md +++ b/manuals/ta4_lua_controller_EN.md @@ -330,7 +330,8 @@ In addition to Lua standard function the Lua Controller provides the following f E.g.: `$print("Hello "..name)` - `$loopcycle(seconds)` - This function allows to change the call frequency of the controller loop() function, witch is per default one second. For more info, see "Cyclic Task" - `$events(bool)` - Enable/disable event handling. For more info, see "Events" -- `$get_ms_time()` - Returns time with millisecond precision +- `$get_ms_time()` - Returns the time with millisecond precision +- `get_gametime()` - Returns the time, in seconds, since the world was created - `$time_as_str()` - Read the time of day (ingame) as text string in 24h format, like "18:45" - `$time_as_num()` - Read the time of day (ingame) as integer number in 24h format, like 1845 - `$get_input(num)` - Read an input value provided by an external block with the given number _num_. The block has to be configured with the number of the controller to be able to send status messages (on/off commands) to the controller. _num_ is the number of the remote block, like "1234". diff --git a/manuals/ta4_lua_controller_EN.pdf b/manuals/ta4_lua_controller_EN.pdf index 1273eb1..eeb974f 100644 Binary files a/manuals/ta4_lua_controller_EN.pdf and b/manuals/ta4_lua_controller_EN.pdf differ