NindyBun

Reciever

Dec 16th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. --[[
  2.     Notes:
  3.         - Put in the port at which the robot and the reciever will communicate through.
  4.         - This program should be ran on it's own server/computer
  5.         - Make sure to run the program before using the quarry
  6.         - The reciever should have a wireless network card
  7. --]]
  8.  
  9. local component = require("component")
  10. local event     = require("event")
  11. local computer  = require("computer")
  12. local port      = --Port
  13.  
  14. if (not(component.modem.isOpen(port))) then
  15.     component.modem.open(port)
  16. end
  17.  
  18. repeat
  19.     local _, _, _, _, _, message = event.pull("modem_message")
  20.     print("Seconds: " .. computer.uptime() .. " Message: " .. message)
  21. until message == "Quarry is finished"
  22.  
  23. component.modem.close(port)
Advertisement
Add Comment
Please, Sign In to add comment