Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BlockCounter = 0
- InvCounter = 0
- once = true
- xTotal = g_x - gps_x
- zTotal = g_z - gps_z
- yTotal = g_y - gps_y
- g_x = -7
- g_z = 1
- g_y = 72
- --^put go cords^--
- h_x = -3
- h_z = 1
- h_y = 76
- --^Home cords^--
- ----user friendly-----
- ---make it--
- -----------------------
- while true do
- gps.location = gps.locate()
- gps_x = gps_location[0]
- gps_z = gps_location[1]
- gps_y = gps_location[2]
- --Y direction--
- if gps_y > g_y - 1 or gps_y < g_y - 1 then
- --Digging down--
- if g_y < 0 then
- turtle.digDown()
- turtle.down()
- turtle.placeUp()
- --Digging up--
- else
- turtle.digUp()
- turtle.up()
- turtle.placeDown()
- end
- --X direction--
- elseif gps_x > g_x or gps_x < g_x then
- if g_x - gps_x > xTotal then
- turtle.turnRight()
- turtlr.turnRight()
- end
- turtle.dig()
- turtle.forward()
- InvCounter = turtle.getItemCount(1)
- if InvCounter > 0 then
- BlockCounter = BlockCounter + 1
- end
- if BlockCounter == 1 then
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtl.turnRight()
- Turtl.turnRight()
- else
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- end
- --Z direction--
- else
- if gps_z > g_z or gps_z < g_z then
- if once == true then
- if g_z < 0 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- once = false
- end
- if g_z - gps_z > zTotal then
- turtle.turnRight()
- turtlr.turnRight()
- end
- turtle.dig()
- turtle.forward()
- InvCounter = turtle.getItemCount(1)
- if InvCounter > 0 then
- BlockCounter = BlockCounter + 1
- end
- if BlockCounter == 1 then
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtl.turnRight()
- Turtl.turnRight()
- else
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement