Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Stair_length = 0
- local slotCount = 16
- local blockSlot = 1
- print("How long would you like your stairs?")
- Stair_length = tonumber(read())
- if(Stair_length <= 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.place()) then
- return true
- end
- end
- for slot = 1, slotCount do
- turtle.select(slot)
- if(turtle.place()) then
- blockSlot = slot
- return true
- end
- end
- end
- function PlaceBlock()
- if(turtle.place()) then
- return true
- elseif(CheckBlock()) then
- return true
- end
- end
- function moveUpStairs()
- turtle.up()
- turtle.forward()
- end
- --Main-----------------------
- for stair = 1, Stair_length do
- if(CheckFuel()) then
- if (PlaceBlock()) then
- moveUpStairs()
- else
- print("Out of blocks to use")
- return
- end
- else
- print("No Fuel Detected")
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement