aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation
ModeNameSize
-rw-r--r--depends.txt44logplain
-rw-r--r--init.lua965logplain
-rw-r--r--railwaytime.lua7481logplain
-rw-r--r--readme.txt202logplain
-rw-r--r--stoprail.lua7016logplain
d---------textures120logplain
ref='#n105'>105 106 107 108 109 110 111 112 113
-- 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")
if not mp then
	error("Mod name error: Mod folder is not named 'advtrains_luaautomation'!")
end
dofile(mp.."/environment.lua")
dofile(mp.."/interrupt.lua")
dofile(mp.."/active_common.lua")
dofile(mp.."/atc_rail.lua")
dofile(mp.."/operation_panel.lua")
dofile(mp.."/pcnaming.lua")

dofile(mp.."/chatcmds.lua")


local filename=minetest.get_worldpath().."/advtrains_luaautomation"