aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/atc.lua')
-rw-r--r--advtrains/atc.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua
index 9f909c5..0005093 100644
--- a/advtrains/atc.lua
+++ b/advtrains/atc.lua
@@ -193,7 +193,19 @@ function atc.execute_atc_command(id, train)
end
end
-
+minetest.register_chatcommand("at_get_lua",{
+ params = "<command>",
+ description = "Compile the given ATC command into Lua code and show the given code",
+ privs = {train_admin = true},
+ func = function(name, params)
+ local f, s = advtrains.atcjit.compile(params)
+ if not f then
+ return false, s or ("Unknown compilation error")
+ else
+ return true, s
+ end
+ end,
+})
--move table to desired place
advtrains.atc=atc