Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variablen
- wModul = "top"
- monitor = "left"
- -- Code
- rednet.open(wModul)
- local monitor = peripheral.wrap(monitor)
- monitor.setTextScale(1)
- function saubermachen()
- monitor.setCursorPos(1,1)
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- end
- function externesBild()
- maxX, maxY = monitor.getSize()
- saubermachen()
- local text = "Externes Geb\195\164ude"
- monitor.setCursorPos(math.floor((maxX - string.len(text)) / 2 + 1), 1) --Berechnung vom Mittelpunkt der ersten Zeile
- monitor.setTextColor(colors.red)
- monitor.write(text)
- local text = "von Minni1704"
- monitor.setCursorPos(math.floor((maxX - string.len(text)) / 2 + 1), 2) --Berechnung vom Mittelpunkt der zweiten Zeile
- monitor.setTextColor(colors.lime)
- monitor.write(text)
- monitor.setTextColor(colors.white)
- monitor.setCursorPos(1, 5)
- monitor.write("Besitzer: ")
- local besitzer = BesitzerCheck()
- if besitzer == "Online" then
- monitor.setTextColor(colors.green)
- monitor.write(besitzer)
- else
- monitor.setTextColor(colors.red)
- monitor.write(besitzer)
- end
- print("User ist " .. besitzer)
- monitor.setCursorPos(1, 6)
- monitor.write(os.time())
- end
- function BesitzerCheck()
- rednet.broadcast("status?", "1900Player")
- local senderId, message, protocol = rednet.receive("1900Player",10)
- if (message == "Online" or message == "Offline") then
- return message
- end
- end
- externesBild()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement