mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-16 23:48:05 +11:00
19 lines
452 B
Lua
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
|