From 1f4fc5ab4b9b8e022036e540f228a3cea50cd3a9 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Wed, 23 Sep 2015 14:09:20 +0200 Subject: [PATCH] Update sPhone.lua --- src/sPhone.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sPhone.lua b/src/sPhone.lua index b42447f..0451ce3 100644 --- a/src/sPhone.lua +++ b/src/sPhone.lua @@ -46,7 +46,11 @@ local function kernel() fs.makeDir("/.sPhone/autorun") end + term.setBackgroundColor(colors.white) + term.clear() + for k, v in pairs(fs.list("/.sPhone/autorun")) do + term.setTextColor(colors.black) if not fs.isDir("/.sPhone/autorun/"..v) then local f = fs.open("/.sPhone/autorun/"..v,"r") local script = f.readAll() @@ -55,9 +59,11 @@ local function kernel() sleep(0) local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end) if not ok then - printError("Script error: "..v..": "..err) + term.setTextColor(colors.red) + print("Script error: "..v..": "..err) fs.move("/.sPhone/autorun/"..v, "/.sPhone/autorun/disabled/"..v) - printError(v.." disabled to prevent errors") + term.setTextColor(colors.blue) + print(v.." disabled to prevent errors") sleep(0.5) end