16 lines
484 B
Lua
16 lines
484 B
Lua
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((os.getenv("PWD") or "").."> ")
|
|
local inp=readln()
|
|
if inp:sub(1,1) == "=" then inp="return "..inp:sub(2) end
|
|
local r={pcall(load(inp))}
|
|
if r[1] == true then table.remove(r,1) end
|
|
print(table.unpack(r))
|
|
end
|
|
end,si)
|
|
end
|