Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Programet är skrivet av metarmask
- termX, termY = term.getSize()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- term.clear()
- function writeOwner()
- term.setCursorPos(termX/2-#"Skrivet av metarmask", termY)
- write("Skrivet av ")
- term.setTextColor(colors.green)
- write("metarmask")
- term.setTextColor(colors.red)
- end
- writeOwner()
- term.setCursorPos(termX/2-14,termY/2)
- write("Startar: ")
- term.setBackgroundColor(colors.red)
- textutils.slowWrite(string.rep(" ", 10), 4)
- term.setBackgroundColor(colors.white)
- write(" Klar! ")
- sleep(0.5)
- term.clear()
- writeOwner()
- a1dot = "å"
- a2dots = "ä"
- o2dots = "ö"
- mon1 = peripheral.wrap("left")
- mon2 = peripheral.wrap("bottom")
- sModemSide = nil
- for n,sSide in ipairs( rs.getSides() ) do
- if peripheral.getType( sSide ) == "modem" then
- sModemSide = sSide
- break
- end
- end
- if sModemSide == nil then
- else
- rednet.open(sModemSide)
- end
- mon1.setTextColor(colors.black)
- mon1.setBackgroundColor(colors.yellow)
- mon1.clear()
- mon2.clear()
- mon1.setCursorPos(1,1)
- mon2.setCursorPos(2,2)
- mon1.setTextScale(2)
- mon2.setTextScale(1.5)
- mon1.write("Weekly news!")
- meddelanden = {}
- ids = {}
- while true do
- id, meddelande = rednet.receive()
- term.clear()
- messageLenght = #meddelande
- idLenght = #tostring(id)
- totalLenght1 = messageLenght + 5
- totalLenght2 = idLenght + 22
- term.setCursorPos(1,termY/2)
- print("Tog emot \""..meddelande.."\" fr"..a1dot.."n dator "..id..".")
- print("Antal meddelanden "..a2dots.."r nu "..#meddelanden + 1)
- table.insert(ids, id)
- table.insert(meddelanden, meddelande)
- count = #meddelanden
- for i=1,#meddelanden do
- posY, posX = mon2.getCursorPos()
- mon2.clearLine()
- mon2.write(ids[count].." "..meddelanden[count])
- mon2.setCursorPos(2,posX+2)
- count = count - 1
- end
- mon2.setCursorPos(2,2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement