Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("buildSupport.lua")
- os.loadAPI("userInput.lua")
- -- make the turtle go down until it can't
- function goDown()
- local blocksDown = 0
- while turtle.down() do
- blocksDown = blocksDown + 1
- end
- turtle.up()
- return blocksDown
- end
- -- make the turtle go up a certain number of blocks
- function goUp(blocks)
- slot = 2
- for i = 1, blocks do
- turtle.up()
- while not turtle.placeDown() and slot ~= 17 do
- turtle.select(slot)
- slot = slot + 1
- end
- if slot == 17 then
- return 1
- end
- end
- return 0
- end
- function fillY(height)
- goDown()
- if goUp(height) == 1 then
- return 1
- else
- return 0
- end
- end
- width = tonumber(userInput.getUserInput("Please Enter a Length: "))
- length = tonumber(userInput.getUserInput("Please Enter a Width: "))
- height = tonumber(userInput.getUserInput("Please Enter a Height: "))
- print("Fuel And Blocks Cannot be Predicted")
- print("Fuel")
- print("currently: " .. turtle.getFuelLevel() .. " out of " .. turtle.getFuelLimit())
- print("or " .. (turtle.getFuelLevel()/turtle.getFuelLimit()) * 100 .. "%")
- userInput.getUserInput("Press anything to continue: ")
- turtle.forward()
- turtle.select(1)
- for i = 1, length do
- for j = 1, width do
- if fillY(height) == 1 then
- os.exit(1)
- end
- if j < width then
- turtle.forward()
- end
- end
- if i < length then
- if i % 2 == 0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment