Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local display = peripheral.find("monitor")
- local screenWidth = display.getSize()
- term.redirect(display)
- rednet.open('top')
- display.setTextScale(0.5)
- local broadcastCat1 = "sorting"
- local broadcastCat2 = "chatting"
- local broadcastCat3 = "colors"
- local header = window.create(display, 1, 1, 100, 1)
- local cat1 = window.create(display, 1, 2, 100, 1)
- local body1 = window.create(display, 1, 3, 100, 10)
- local cat2 = window.create(display, 1, 13, 100, 1)
- local body2 = window.create(display, 1, 14, 100, 10)
- local cat3 = window.create(display, 1, 24, 100, 1)
- local body3 = window.create(display, 1, 25, 100, 10)
- function setHeader(h, m)
- h.clear()
- h.setBackgroundColor(colors.gray)
- h.setTextColor(colors.black)
- h.write(m)
- end
- function setBody(b, m)
- term.redirect(b)
- b.setBackgroundColor(colors.black)
- b.setTextColor(colors.green)
- print(tostring(m))
- end
- function waitCat1()
- local ID, msg = rednet.receive(broadcastCat1)
- setBody(body1, ID .. ':'.. tostring(msg))
- end
- function waitCat2()
- local ID, msg = rednet.receive(broadcastCat2)
- setBody(body2, ID .. ':' .. tostring(msg))
- end
- function waitCat3()
- local ID, msg = rednet.receive(broadcastCat3)
- setBody(body3, ID .. ':' .. tostring(msg))
- end
- print("Debug starting...")
- sleep(5)
- display.clear()
- setHeader(header, "Debug Console")
- setHeader(cat1, "Sorting")
- setHeader(cat2, "Chatting")
- setHeader(cat3, "Text Color")
- setBody(body1, "init")
- setBody(body2, "init")
- setBody(body3, "init")
- while true do parallel.waitForAny(waitCat1, waitCat2, waitCat3) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement