| -- advtrains_luaautomation/init.lua
-- Lua automation features for advtrains
-- Uses global table 'atlatc' (AdvTrains_LuaATC)
-- Boilerplate to support localized strings if intllib mod is installed.
if intllib then
atltrans = intllib.Getter()
else
atltrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
end
--Privilege
--Only trusted players should be enabled to build stuff which can break the server.
atlatc = { envs = {}}
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
--assertt helper. error if a variable is not of a type
function assertt(var, typ)
if type(var)~=typ then
error("Assertion failed, variable has to be of type "..typ)
end
end
local mp=minetest.get_modpath("advtrains_luaautomation" |