Added event viewer to CC to help debugging

This commit is contained in:
LemADEC 2017-05-12 20:38:50 +02:00
parent 501174201e
commit 51418e87de

View file

@ -0,0 +1,40 @@
local abort = false
term.setBackgroundColor(colors.black)
Colors = {
colors.lime,
colors.yellow,
colors.white,
colors.white,
colors.white,
colors.white,
colors.white
}
repeat
params = { os.pullEventRaw() }
eventName = params[1]
side = params[2]
if side == nil then side = "none" end
print("")
term.setTextColor(colors.red)
term.write("Event")
local index = 1
for key, value in pairs(params) do
term.setTextColor(Colors[index])
index = index + 1
if (type(value) == "boolean") then
if value then
term.write(" true")
else
term.write(" false")
end
else
term.write(" " .. value)
end
end
term.write(".")
if eventName == "terminate" then
abort = true
end
until abort
print("")