OC-PsychOS/modules/applications/luash.lua

15 lines
404 B
Lua
Raw Normal View History

2017-07-30 19:12:10 +10:00
function luash(si)
spawn("lua shell",function()
print(_OSVERSION..", "..string.format("%4d",computer.totalMemory()/1024).."K memory")
2017-07-30 19:12:10 +10:00
print(_VERSION)
while true do
2017-07-31 12:10:45 +10:00
write((os.getenv("PWD") or "").."> ")
2017-08-01 16:38:43 +10:00
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))
2017-07-30 19:12:10 +10:00
end
end,si)
end