aboutsummaryrefslogtreecommitdiff
path: root/advtrains/advtrains_luaautomation/operation_panel.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-02-02 16:40:51 +0100
committerorwell96 <mono96.mml@gmail.com>2017-02-02 17:17:39 +0100
commitb19033b224f4f8ec33f10ba40327f1d811c04fbb (patch)
treef1d6340ef9aab4f93a2e355f544fa0a9ebb65130 /advtrains/advtrains_luaautomation/operation_panel.lua
parenta8f9e3d43e1a256e73e1a40c261a7145d3652f5b (diff)
downloadadvtrains-b19033b224f4f8ec33f10ba40327f1d811c04fbb.tar.gz
advtrains-b19033b224f4f8ec33f10ba40327f1d811c04fbb.tar.bz2
advtrains-b19033b224f4f8ec33f10ba40327f1d811c04fbb.zip
LuaAutomation - Basic component implementation
Implements the base code for LuaAutomation, an ATC rail and a punch-operated 'operation panel' as well as interface for passive components. Changes in advtrains code where neccessary. Supported passive components are light signals, switches and mesecon switches
Diffstat (limited to 'advtrains/advtrains_luaautomation/operation_panel.lua')
-rw-r--r--advtrains/advtrains_luaautomation/operation_panel.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/advtrains/advtrains_luaautomation/operation_panel.lua b/advtrains/advtrains_luaautomation/operation_panel.lua
new file mode 100644
index 0000000..1d585f7
--- /dev/null
+++ b/advtrains/advtrains_luaautomation/operation_panel.lua
@@ -0,0 +1,23 @@
+
+local function on_punch(pos, player)
+ atlatc.interrupt.add(0, pos, {type="punch", punch=true})
+end
+
+
+minetest.register_node("advtrains_luaautomation:oppanel", {
+ drawtype = "normal",
+ tiles={"atlatc_oppanel.png"},
+ description = "LuaAutomation operation panel",
+ groups = {
+ choppy = 1,
+ save_in_nodedb=1,
+ },
+ after_place_node = atlatc.active.after_place_node,
+ after_dig_node = atlatc.active.after_dig_node,
+ on_receive_fields = atlatc.active.on_receive_fields,
+ on_punch = on_punch,
+ luaautomation = {
+ fire_event=atlatc.active.run_in_env
+ }
+
+})