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.setCursorPos(1,1)
- mon.clear()
- mon.setTextColor(colors.yellow)
- shift = 0
- function centerText(text, line)
- local x, y = mon.getSize()
- mon.setCursorPos(math.ceil((x / 2) - (text:len() / 2)) + shift, line)
- mon.write(text)
- end
- while true do
- mon.clear()
- centerText("Welcome", 2)
- for name, info in pairs(s.getTargets()) do
- centerText(name, 3)
- end
- shift = shift + 1
- sleep(3.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment