Advertisement
Guest User

sensor

a guest
Jul 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. term.clear()
  2. -- get the targets
  3. while read() do
  4. while true do
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. rednet.broadcast("dGFyZ2V0cw",pass)
  8. --while true do
  9. ID,targets,pro =rednet.receive("b3BzbXNwbG9pdA",5)
  10. if targets~=nil then
  11. term.setCursorPos(1,1)
  12. term.setTextColor(colors.blue)
  13. print("[+]transfer OK")
  14. break
  15. else
  16.  
  17. print("[-]transfer failed")
  18. sleep(2)
  19. end
  20. sleep(1)
  21. end
  22. -- loop through them
  23. i=1
  24. senX=0
  25. senY=0
  26. senZ=0
  27.  
  28.   for name, D in pairs(targets) do
  29.   term.setTextColor(colors.white)
  30. if targets[name].IsPlayer then term.setTextColor(colors.red) end
  31.   -- print their name
  32.   print("Found entity: "..name)
  33.  
  34.   print("POS: "..tostring(math.modf(targets[name].Position.X)+senX).." "..tostring(math.modf(targets[name].Position.Y)+senY).." "..tostring(math.modf(targets[name].Position.Z)+senZ))
  35.  
  36.   print("------")
  37. i=i+1
  38. end
  39. --targets=nil
  40. sleep(1)
  41. targets=nil
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement