1
0
의 미러 https://github.com/sys4-fr/server-nalc.git synced 2025-12-30 20:55:28 +01:00

Add time IRC command

This commit is contained in:
Gael-de-Sailly
2015-05-02 16:42:35 +02:00
부모 41a4945ff2
커밋 d9785c5476

파일 보기

@@ -163,3 +163,12 @@ irc:register_bot_command("players", {
end 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
})