systox

Untitled

Apr 28th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local serverID = 0 -- change to the id of the computer that sends the message
  2. local sSide = "back" -- change to the side of the monitor
  3. local sKey = "WRITE_THE_TEXT" -- change to whatever you want the keyword message to be
  4. local sText = "" -- write here the text you want on the monitor
  5.  
  6. rednet.open("top")
  7.  
  8. local mon = peripheral.wrap(sSide)
  9. if not mon then
  10. print("No monitor on ", sSide)
  11. return
  12. end
  13.  
  14. term.redirect(mon)
  15. while true do
  16. local id, msg = rednet.receive()
  17. if id == serverID then
  18. if msg == sKey then
  19. term.clear()
  20. term.setCursorPos(1, 1)
  21. print(sText)
  22. end
  23. end
  24. end
Add Comment
Please, Sign In to add comment