Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- s = sensor.wrap("right")
- mon = peripheral.wrap("back")
- mon.setBackgroundColor(colors.black)
- mon.setTextScale(3)
- mon.clear()
- mon.setTextColor(colors.yellow)
- function centerText(text)
- local x,y = mon.getSize()
- local x2,y2 = mon.getCursorPos()
- mon.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- while true do
- for name,info in pairs(s.getTargets()) do
- centerText(name)
- end
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement