From c1e9e31cf019926947f6b7ca3c4578dc32ea3103 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 12 Jun 2017 14:39:06 +0000 Subject: [PATCH] changed shutil to return strings rather than straight-up print stuff --- modules/applications/shutil.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/applications/shutil.lua b/modules/applications/shutil.lua index e66dce3..7ad4641 100644 --- a/modules/applications/shutil.lua +++ b/modules/applications/shutil.lua @@ -1,12 +1,12 @@ function ps() + local S="" for k,v in pairs(tT) do - write("pid: "..tostring(k).."\tname: "..tostring(v[1]).."\tenv={") - for l,w in pairs(v[3]) do write(tostring(l).." = "..tostring(w)..", ") end - print("}") + S=S..("pid: "..tostring(k).."\tname: "..tostring(v[1]).."\tenv={") + for l,w in pairs(v[3]) do S=S..(tostring(l).." = "..tostring(w)..", ") end + S=S.."}\n" end + return S end function mem() - print("Total:\t"..tostring(computer.totalMemory()/1024).."K") - print("Free:\t"..tostring(computer.freeMemory()/1024).."K") - print("Used:\t"..tostring((computer.totalMemory()-computer.freeMemory())/1024).."K") + return "Total:\t"..tostring(computer.totalMemory()/1024).."K\nFree:\t"..tostring(computer.freeMemory()/1024).."K\nUsed:\t"..tostring((computer.totalMemory()-computer.freeMemory())/1024).."K" end