1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-16 15:38:05 +11:00
OC-KittenOS/apps/memusage.lua
gamemanj 2ae3f9a93a Initial commit
Currently eeprog pirate-speak language is unsupported, but... oh well.
2016-10-23 13:27:16 +01:00

19 lines
452 B
Lua

local math, stat = A.request("math", "stat")
local app = {}
app.key = function(ka, kc, down)
if ka == ("C"):byte() and down then
A.die()
end
end
local strs = {"", "Shift-C to quit."}
app.update = function ()
local tm = stat.totalMemory()
local um = math.floor((tm - stat.freeMemory()) / 1024)
strs[1] = um .. ":" .. math.floor(tm / 1024)
A.timer(1)
return true
end
app.get_ch = function (x, y)
return (strs[y]):sub(x, x)
end
return app, 16, 2