Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gps = require("turtle_gps")
- length = 32
- width = 32
- height = 1
- -- direction = "DOWN"
- function digNow()
- while turtle.detect() do
- turtle.dig()
- --sleep(0.5)
- end
- end
- function refuel_now()
- -- refuel
- turtle.select(15)
- while turtle.getFuelLevel() < 200 do
- -- print("Not enough fuel: "..turtle.getFuelLevel().." / 200")
- -- print("place fuel in slot 16 and Press ENTER to continue...")
- -- read()
- turtle.refuel()
- end
- end
- function main()
- print("How many blocks forward: ")
- length = tonumber(read(), integer)
- print("How many blocks right: ")
- width = tonumber(read(), integer)
- -- print("Mining direction? (UP/DOWN)")
- -- direciton = string.upper(read())
- print("Mining height: ")
- height = tonumber(read(), integer)
- term.clear()
- term.setCursorPos(1, 1)
- refuel_now()
- print("Excavating...")
- for h = 1, height do
- for i = 1, width do
- if i % 2 == 0 then
- turnToDirection(Directions.Backwards)
- else
- turnToDirection(Directions.Forward)
- end
- for j = 1, length - 1 do
- moveForward()
- end
- if i < width then
- if Direction == Directions.Forward then
- turnToDirection(Directions.Right)
- moveForward()
- turnToDirection(Directions.Backwards)
- else
- turnToDirection(Directions.Right)
- moveForward()
- turnToDirection(Directions.Forward)
- end
- end
- end
- moveTo(0,0,Local_z,"zyx")
- moveDown()
- turnToDirection(Directions.Forward)
- refuel_now()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement