Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- x = tonumber(args[1])
- y = tonumber(args[2])
- z = tonumber(args[3])
- target = vector.new(x, y, z)
- rednet.open("left")
- mon = peripheral.wrap("top")
- fuel = turtle.getFuelLevel()
- pos0 = vector.new(gps.locate())
- turtle.forward()
- pos1 = vector.new(gps.locate())
- dist = pos1 - pos0
- turtle.back()
- face = ""
- if dist.x > 0 then
- face = "west"
- elseif dist.x < 0 then
- face = "east"
- elseif dist.z > 0 then
- face = "north"
- else
- face = "south"
- end
- if mon ~= nil then
- mon.setTextScale(1.5)
- mon.clear()
- mon.setCursorPos(1, 1)
- mon.write("id:"..os.getComputerID())
- mon.setCursorPos(1, 2)
- mon.write("fuel:"..fuel)
- mon.setCursorPos(1, 3)
- mon.write("pos:"..tostring(pos0))
- mon.setCursorPos(1, 4)
- mon.write("faceTo:"..face)
- end
- print("pos:"..tostring(pos0))
- print("faceTo:"..face)
- print("dist:"..tostring(target - pos0))
Advertisement
Add Comment
Please, Sign In to add comment