a bit of cleaning

This commit is contained in:
Izaya 2017-07-31 09:26:58 +10:00
parent 333cac223a
commit 5a6018ad5e
6 changed files with 12 additions and 8 deletions

View File

@ -1,2 +1,4 @@
#!/bin/bash
echo "_OSVERSION=\"PsychOS $(git rev-parse HEAD | head -c 8)\""
echo "_BD=\"$(date '+%Y/%m/%d %H:%M %z')\""
cat modules/debug/log.lua modules/base/header.lua modules/drivers/tty.lua modules/lib/print.lua modules/drivers/kbd.lua modules/drivers/net.lua modules/lib/readline.lua modules/applications/luash.lua modules/setup.lua modules/base/footer.lua

View File

@ -1,5 +1,7 @@
function luash(si)
spawn("lua shell",function()
coroutine.yield()
print(_OSVERSION..", "..string.format("%4d",computer.totalMemory()/1024).."K memory, "..string.format("%4d",computer.freeMemory()/1024).."K free")
print(_VERSION)
while true do
write("> ")

View File

@ -1,12 +1,12 @@
if component then
_G.Log = ""
function log(...)
if component.list("ocemu")() then
for k,v in ipairs({...}) do
component.invoke(component.list("ocemu")(),"log",v)
if component.list("ocemu")() then
component.invoke(component.list("ocemu")(),"log",v)
end
Log=Log..tostring(v).."\n"
end
end
Log=Log..tostring(v).."\n"
end
print=log
else log = print

View File

@ -0,0 +1,3 @@
function _G.computer.usedMemory()
return computer.totalMemory()-computer.freeMemory()
end

View File

@ -4,3 +4,4 @@ local ka = component.list("keyboard")()
kbd(ka)
end))
luash()
computer.beep()

View File

@ -23,10 +23,6 @@ replacements={
{" %* ","*"},
{" \n","\n"},
{"%-%-.-\n",""},
{"coroutine%.","C."},
{"table%.","T."},
{"tostring","TS"},
{"tonumber","TN"},
}
for k,v in ipairs(replacements) do
while ss:find(v[1]) ~= nil do