mods that hopefully work for a TechAge-based pack

This commit is contained in:
2026-09-09 06:27:51 -06:00
parent 4e6b08d194
commit c27db2a537
6234 changed files with 375578 additions and 0 deletions
@@ -0,0 +1,44 @@
--[[
TechAge
=======
Copyright (C) 2019-2025 Joachim Stolberg
AGPL v3
See LICENSE.txt for more information
Credit-based CPU time distributing
]]--
local Credits = {}
local TimeSpent = {}
local S = techage.S
techage.credits = {}
function techage.credits.before_action(playername)
local t = minetest.get_us_time()
local dt = math.floor(minetest.get_us_time() - t)
TimeSpent[playername] = (TimeSpent[playername] or 0) + dt
return res
end
function techage.credits.after_action(playername)
local t = minetest.get_us_time()
local dt = math.floor(minetest.get_us_time() - t)
TimeSpent[playername] = (TimeSpent[playername] or 0) + dt
return res
end
local function evaluation()
Credits = {}
for playername, time in pairs(TimeSpent) do
Credits[playername] = time / 1000000 -- convert to seconds
end
TimeSpent = {}
minetest.after(1, evaluation)
end
minetest.after(1, evaluation)