uepyon

curposx.lua

Apr 6th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | Gaming | 0 0
  1. rednet.open("left")
  2. myid = os.getComputerID()
  3. fuel = turtle.getFuelLevel()
  4.  
  5. pos0 = vector.new(gps.locate())
  6. turtle.forward()
  7. pos1 = vector.new(gps.locate())
  8. dist = pos1 - pos0
  9. turtle.back()
  10. face = ""
  11. if dist.x > 0 then
  12.   face = "west"
  13. elseif dist.x < 0 then
  14.   face = "east"
  15. elseif dist.z > 0 then
  16.   face = "north"
  17. else
  18.   face = "south"
  19. end
  20.  
  21. print("id:"..os.getComputerID())
  22. print("fuel:"..fuel)
  23. print("pos:"..tostring(pos0))
  24. print("faceTo:"..face)
  25.  
  26.  
Tags: ccTweaked
Add Comment
Please, Sign In to add comment