Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- This program will clear out a line with length specified by the user and replace the blocks with the blocks in slot 1
- The length is max 64
- --]]
- --[[
- Functions
- --]]
- local function tunnelFwd()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- --[[
- Main
- --]]
- print("How much in front of me would you like me to build? (max 64)")
- local length = tonumber(read())
- if length > 64 then
- print("I can only build 64 blocks")
- end
- turtle.select(1)
- local count = turtle.getItemCount(1)
- if count < length then
- print("Please provide me with enough blocks in slot 1 to build that.")
- return
- end
- local fuel = turtle.getFuelLevel()
- if fuel < length * 2 then
- print("I only have " .. fuel .. " units of fuel! I need at least " .. length * 2 .. " units for that job")
- return
- end
- for i = 1, length do
- tunnelFwd()
- end
- for i = 1, length do
- turtle.back()
- turtle.place()
- end
- print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement