/assets/interlocking.html.LyXconv/

ss="hl opt">("env_setup", { params = "<environment name>", description = "Set up and modify AdvTrains LuaAutomation environment", privs = {atlatc=true}, func = function(name, param) local env=atlatc.envs[param] if not env then return false,"Invalid environment name!" end minetest.show_formspec(name, "atlatc_envsetup_"..param, get_init_form(env, name)) return true end, }) core.register_chatcommand("env_create", { params = "<environment name>", description = "Create an AdvTrains LuaAutomation environment", privs = {atlatc=true}, func = function(name, param) if not param or param=="" then return false, "Name required!" end if atlatc.envs[param] then return false, "Environment already exists!" end atlatc.envs[param] = atlatc.env_new(param) return true, "Created environment '"..param.."'. Use '/env_setup "..param.."' to define global initialization code, or start building LuaATC components!" end, }) minetest.register_on_player_receive_fields(function(player, formname, fields) local pname=player:get_player_name() if not minetest.check_player_privs(pname, {atlatc=true}) then return end local envname=string.match(formname, "^atlatc_delconfirm_(.+)$") if envname and fields.sure=="YES" then atlatc.envs[envname]=nil minetest.chat_send_player(pname, "Environment deleted!") return end envname=string.match(formname, "^atlatc_envsetup_(.+)$") if not envname then return end local env=atlatc.envs[envname] if not env then return end if fields.del then minetest.show_formspec(pname, "atlatc_delconfirm_"..envname, "field[sure;"..minetest.formspec_escape("SURE TO DELETE ENVIRONMENT "..envname.."? Type YES (all uppercase) to continue or just quit form to cancel.")..";]") return end env.init_err=nil if fields.code then env.init_code=fields.code end if fields.run then env:run_initcode() minetest.show_formspec(pname, formname, get_init_form(env, pname)) end end)