Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y, z = gps.locate(5)
- function getLoc()
- x, y, z = gps.locate(5)
- end
- function getDirec()
- getLoc()
- local xHold = x
- local yHold = y
- local zHold = z
- turtle.forward()
- getLoc()
- if x > xHold then
- rednet.send(1, "I am facing east.")
- return("east")
- elseif x < xHold then
- rednet.send(1, "I am facing west.")
- return("west")
- elseif z > zHold then
- rednet.send(1, "I am facing south.")
- return("south")
- elseif z < zHold then
- rednet.send(1, "I am facing north.")
- return("north")
- end
- turtle.back()
- end
- getDirec()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement