Advertisement
donovanwest

recieveCoords.lua

Jul 27th, 2022 (edited)
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. rednet.open('top')
  2. mon = peripheral.wrap("right")
  3. coords = "Unplaced"
  4. startTime = os.clock()
  5. while(true) do
  6.     sendId, message, protocol = rednet.receive(10)
  7.     if(sendId ~= nil) then
  8.         coords = message
  9.         startTime = os.clock()
  10.     end
  11.     oldTerm = term.redirect(mon)
  12.     term.clear()
  13.     timeSincePlacement = os.clock() - startTime
  14.     print(coords .. "\nTime since placement: " .. timeSincePlacement)
  15.     term.redirect(oldTerm)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement