Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findAndWrap(devType)
- local devices = peripheral.getNames()
- for id, devName in pairs(devices) do
- if peripheral.getType(devName) == devType then
- return peripheral.wrap(devName)
- end
- end
- end
- glass = findAndWrap("openperipheral_bridge")
- rednet.open("right")
- function addBox()
- glass.addBox(1,1,200,100,0xFFFFFF,0.2)
- end
- function timeDis(message)
- -- time = textutils.formatTime(os.time(), false)
- local msg=table.concat(split(message, ","),"\n")
- glass.addText(5,100, msg, 0xFF0000)
- end
- function start()
- print("watching rednet messages")
- while true do
- local senderId, message, protocal = rednet.receive()
- glass.clear()
- -- addBox()
- timeDis(message)
- glass.sync()
- sleep(0.1)
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement