aboutsummaryrefslogtreecommitdiff
path: root/interest.lua
blob: b8f8d0c843f997e87d1b614235b6b43e8c35c7d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- adapted from the income.lua file from the currency mod.
local timer = 0
minetest.register_globalstep(function(dtime)
    timer = timer + dtime;
    if timer >= 3000 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] * 1.05)
	  end
       end
       atm.saveaccounts()
    end
end)