aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation
Commit message (Expand)AuthorAge
...
* Shunting mode now couples trains on collision.Gabriel Pérez-Cerezo2019-08-11
* Document luaatc decouplingGabriel Pérez-Cerezo2019-08-11
* Add decoupling to luaatcGabriel Pérez-Cerezo2019-08-11
* RWTs can be specified in any form, unify converters, repeating time handlingorwell962019-06-19
* Railway Time: atlatc interface, improve util functionsorwell962019-06-19
* Fix occurences of old lzb_invalidateorwell962019-04-23
* Lift restrictions for date() function in atlatcorwell962019-02-22
* Force LZB Halt settingorwell962019-02-05
* Add getter/setter for routingcode in LuaATCorwell962019-01-15
* Add set_aspect functionorwell962018-11-20
* Add Note regarding pcnaming and interlocking signalsorwell962018-11-20
* Make "Line" property accessible from OBC and gettable via LATC, change subway...orwell962018-11-20
* Allow pcnaming for any signalsorwell962018-11-05
* Fix node database ATC rail bugorwell962018-10-17
* Address H#60, H#17, M#18 and M#7orwell962018-10-17
* Fix H#66 (Hemiptera 66) crash on missing double_conn matchorwell962018-10-17
* Add signal safety control override, restructure control systemorwell962018-10-10
* Add LuaAutomation interface functions for interlocking routesetting and aspec...orwell962018-08-24
* (Note added, merge in next commit)orwell962018-08-24
* Move passive API to the advtrains coreorwell962018-08-16
* Correct some documentationorwell962018-06-14
* Mainly make collisions and coupling workorwell962018-06-14
* Add digiline interface and is_passive function to LuaATCorwell962018-04-25
* Rewrite rail connection system...orwell962017-12-18
* Add missing documentation for set_lineorwell962017-10-25
* Implement multi-occupation in detector.on_node table to finally fix collisionsorwell962017-10-25
* Set wagon line numberGabriel Pérez-Cerezo2017-10-23
* Remove zip release files, move mod to root, exclude assets from Makefile (#92)rubenwardy2017-09-20
lass="hl opt">)) 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 string.find(param, "[^a-zA-Z0-9-_]") then return false, "Invalid name (only common characters)" end if atlatc.envs[param] then return false, "Environment already exists!" end atlatc.envs[param] = atlatc.env_new(param) atlatc.envs[param].subscribers = {name} return true, "Created environment '"..param.."'. Use '/env_setup "..param.."' to define global initialization code, or start building LuaATC components!" end, }) core.register_chatcommand("env_subscribe", { params = "<environment name>", description = "Subscribe to the log of an Advtrains LuaATC environment", privs = {atlatc=true}, func = function(name, param) local env=atlatc.envs[param] if not env then return false,"Invalid environment name!" end for _,pname in ipairs(env.subscribers) do if pname==name then return false, "Already subscribed!" end end table.insert(env.subscribers, name) return true, "Subscribed to environment '"..param.."'." end, }) core.register_chatcommand("env_unsubscribe", { params = "<environment name>", description = "Unubscribe to the log of an Advtrains LuaATC environment", privs = {atlatc=true}, func = function(name, param) local env=atlatc.envs[param] if not env then return false,"Invalid environment name!" end for index,pname in ipairs(env.subscribers) do if pname==name then table.remove(env.subscribers, index) return true, "Successfully unsubscribed!" end end return false, "Not subscribed to environment '"..param.."'." end, }) core.register_chatcommand("env_subscriptions", { params = "[environment name]", description = "List Advtrains LuaATC environments you are subscribed to (no parameters) or subscribers of an environment (giving an env name).", privs = {atlatc=true}, func = function(name, param) if not param or param=="" then local none=true for envname, env in pairs(atlatc.envs) do for _,pname in ipairs(env.subscribers) do if pname==name then none=false minetest.chat_send_player(name, envname) end end end if none then return false, "Not subscribed to any!" end return true end local env=atlatc.envs[param] if not env then return false,"Invalid environment name!" end local none=true for index,pname in ipairs(env.subscribers) do none=false minetest.chat_send_player(name, pname) end if none then return false, "No subscribers!" end return true 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)