mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-22 15:23:43 +01:00
command position added
This commit is contained in:
parent
df9d252f61
commit
031dd0f975
@ -12,6 +12,10 @@
|
||||
|
||||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local M = minetest.get_meta
|
||||
|
||||
local sHELP = [[SaferLua Controller
|
||||
|
||||
This controller is used to control and monitor
|
||||
@ -114,6 +118,18 @@ sl_controller.register_function("get_ms_time", {
|
||||
" returns time with millisecond precision."
|
||||
})
|
||||
|
||||
sl_controller.register_function("position", {
|
||||
cmnd = function(self, number)
|
||||
local info = tubelib.get_node_info(number)
|
||||
if info then
|
||||
return S(info.pos)
|
||||
end
|
||||
return "(-,-,-)"
|
||||
end,
|
||||
help = "$position(number)\n"..
|
||||
" returns the position '(x,y,z)' of the device\n with given number."
|
||||
})
|
||||
|
||||
|
||||
local function formspec0(meta)
|
||||
local state = meta:get_int("state") == tubelib.RUNNING
|
||||
|
Loading…
Reference in New Issue
Block a user