From 76f3138dbe24af7a2c029229acb6fb77288c5b83 Mon Sep 17 00:00:00 2001 From: cron Date: Sat, 7 Nov 2020 19:26:43 +0000 Subject: [PATCH] turtle: improve state execution and interaction --- clientmods/turtle/init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/clientmods/turtle/init.lua b/clientmods/turtle/init.lua index b120aa25a..08628c3df 100644 --- a/clientmods/turtle/init.lua +++ b/clientmods/turtle/init.lua @@ -350,8 +350,17 @@ minetest.register_chatcommand("tlang", { end }) -minetest.register_chatcommand("tkill", { - description = "Kill tlang task.", +minetest.register_chatcommand("tl_list", { + description = "List running tlang states.", + func = function() + for i, v in ipairs(turtle.states) do + minetest.display_chat_message(tostring(i) .. " " .. v.name) + end + end +}) + +minetest.register_chatcommand("tl_kill", { + description = "Kill a tlang task.", params = "", func = turtle.kill_symbolic })