Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeTop()
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1, 1)
- term.clearLine()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.red)
- write("Turtledurtle 3")
- end
- function fillScreen(color)
- term.setCursorPos(1, 1)
- term.setBackgroundColor(color)
- term.clear()
- makeTop()
- end
- sizeX, sizeY = term.getSize()
- n = 0
- state = 0 -- 0 = empty, 1 = alert
- if (not rednet.isOpen("back")) then
- rednet.open("back")
- end
- fillScreen(colors.lightBlue)
- term.setCursorPos(1, 1)
- while true do
- local id, message = rednet.receive(3)
- if (message == nil) then
- message = " "
- end
- local continue = true
- if (message == " ") then
- if (state ~= 0) then
- state = 0
- fillScreen(colors.lime)
- end
- continue = false
- else
- if (state ~= 1) then
- state = 1
- fillScreen(colors.yellow)
- term.setCursorPos(1, 3)
- end
- end
- if (continue) then
- --n = n + 1
- --term.setCursorPos(1, cY + 1)
- term.setBackgroundColor(colors.yellow)
- term.setTextColor(colors.gray)
- print(message)
- term.scroll(1)
- local cX, cY = term.getCursorPos()
- makeTop()
- term.setCursorPos(1, cY)
- --[[if cY >= sizeY then
- cY = cY - 1
- --n = 15
- --term.scroll(1)
- makeTop()
- term.setCursorPos(1, cY)
- end--]]
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment