Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- posH = 0
- posW = 0
- input = 0
- ready = 0
- line = 0
- function checkFuel()
- local fuel = turtle.getFuelLevel()
- local fuelRequired = input*18
- if fuel <= fuelRequired then
- print('Not enough fuel for this mission')
- end
- if fuel > fuelRequired then
- ready = 1
- end
- end
- function checkInventory()
- turtle.select(15)
- if turtle.getItemCount() > 0 then
- for i = 1, posW do
- turtle.back()
- end
- for j = 1, posH do
- turtle.up()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for k = 1, 16 do
- turtle.select(k)
- turtle.drop()
- end
- turtle.select(1)
- turtle.turnLeft()
- turtle.turnLeft()
- for l = 1, posW do
- turtle.forward()
- end
- for m = 1, posH do
- turtle.down()
- end
- end
- turtle.select(1)
- end
- function mineLine()
- turtle.digDown()
- turtle.down()
- posH = posH + 1
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- end
- print('What height am I standing at?')
- local number = tonumber(io.read())
- if tonumber(number) ~= nil then
- input = number - 1
- end
- checkFuel()
- if ready == 1 then
- repeat
- for n = 1, input do
- mineLine()
- checkInventory()
- end
- for o = 1, posW do
- turtle.back()
- end
- for p = 1, posH do
- turtle.up()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for q = 1, 16 do
- turtle.select(q)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- posH = 0
- if line < 2 then
- for x = 0, line do
- turtle.forward()
- end
- end
- posW = posW + 1
- line = line + 1
- until line == 3
- end
Advertisement
Add Comment
Please, Sign In to add comment