Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs={ ... }
- print("Making a brand new floor for you master..")
- turtle.refuel()
- local total=0
- local selected=16
- print("I've got "..turtle.getItemCount(selected).." blocks for now!")
- local finished=false
- while not finished do
- while not (turtle.detect() or turtle.detectDown()) do
- if turtle.placeDown() then
- total=total+1
- end
- turtle.forward()
- -- if there is no more block on that slot
- if turtle.getItemCount(selected) == 0 then
- -- decrement the slot number (from bottom-right to top-left)
- selected=selected-1
- -- do not consume coal (experimental not tested yet)
- assert(selected ~= 1, "No more blocks left, sorry master")
- -- select the new item slot
- turtle.select(selected)
- print("Switched to slot ".. selected .. " now having ".. turtle.getItemCount(selected) .." for use!")
- end
- end
- if turtle.detectDown() then
- turtle.back()
- turtle.turnRight()
- turtle.forward()
- if turtle.detectDown() then
- finished=true
- print("Floor finished!")
- end
- else
- turtle.turnRight()
- print("Turtle say: bump!")
- end
- end
- print(total .. " blocks have been consumed in the operation.")
Add Comment
Please, Sign In to add comment