Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bridgeLength = 0
- local slotCount = 16
- local blockSlot = 1
- print("How long would you like your stairs?")
- bridgeLength = tonumber(read())
- if(bridgeLength <= 0) then
- print("Malformed Size Given")
- return
- end
- function CheckFuel()
- if(turtle.getFuelLevel() < 10) then
- for slot = 1, slotCount do
- print("Attempting to refuel on slot " .. slot)
- turtle.select(slot)
- if(turtle.refuel(1)) then
- turtle.select(blockSlot)
- return true
- end
- end
- return false
- end
- return true
- end
- function CheckBlock()
- if(turtle.getItemCount() > 0) then
- if(turtle.placeDown()) then
- return true
- end
- end
- for slot = 1, slotCount do
- turtle.select(slot)
- if(turtle.placeDown()) then
- blockSlot = slot
- return true
- end
- end
- end
- function PlaceBlock()
- if(turtle.placeDown()) then
- return true
- elseif(CheckBlock()) then
- return true
- end
- end
- function moveForwards()
- turtle.forward()
- end
- --Main-----------------------
- for stair = 1, bridgeLength do
- if(CheckFuel()) then
- if (PlaceBlock()) then
- moveForwards()
- else
- print("Out of blocks to use/Land Reached")
- return
- end
- else
- print("No Fuel Detected")
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement