Added event viewer to CC to help debugging
This commit is contained in:
parent
501174201e
commit
51418e87de
1 changed files with 40 additions and 0 deletions
|
@ -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("")
|
Loading…
Reference in a new issue