2016-06-25 23:22:36 +02:00
|
|
|
-- adapted from the income.lua file from the currency mod.
|
|
|
|
local timer = 0
|
|
|
|
minetest.register_globalstep(function(dtime)
|
2017-12-15 21:07:35 +03:00
|
|
|
timer = timer + dtime;
|
|
|
|
if timer >= 1000 then
|
|
|
|
timer = 0
|
|
|
|
atm.readaccounts()
|
|
|
|
for _,player in ipairs(minetest.get_connected_players()) do
|
|
|
|
local name = player:get_player_name()
|
|
|
|
if not (atm.balance[name] == nil) then
|
|
|
|
atm.balance[name] = math.floor(atm.balance[name] + 5)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
atm.saveaccounts()
|
|
|
|
end
|
2016-06-25 23:22:36 +02:00
|
|
|
end)
|