From fd4756e34db49696bdeb88ae89bf489a2664df54 Mon Sep 17 00:00:00 2001 From: Gael-de-Sailly Date: Sat, 2 May 2015 21:01:35 +0200 Subject: [PATCH] Add timeofday command --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.lua b/init.lua index 647b1a4..563aa34 100644 --- a/init.lua +++ b/init.lua @@ -133,3 +133,12 @@ irc:register_bot_command("say", { end }) +irc:register_bot_command("timeofday", { + description = "Tell the in-game time of day", + func = function(user, args) + local timeofday = minetest.get_timeofday() + local hours, minutes = math.modf(timeofday * 24) + minutes = math.floor(minutes * 60) + return true, "It's " .. hours .. " h " .. minutes .. " min." + end +})