Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- 2013 (c) psychedelixx
- Minecraft Turtle: Stairs (Robust)
- 2013-05-21
- Digs a simple stair and places missing ground blocks and torches (every 4th horizontal block).
- Usage:
- - use turtle and type "label set <name>"
- (to give your turtle an unique name so it remembers its programs)
- - type "pastebin get hT1hG700 stairs"
- - place solid blocks in slot 16 (lower right corner)
- - place torches in slot 15 (left of slot 16)
- - type "stairs <height> [<limit>]"
- β’ where <height> represents the height of the hallway (3-5 seems good)
- β’ and <limit> (optional) represents the Y coordinates digged down
- (if you're at y64 and type in 10, it will dig until it's at y54)
- --]]
- local args = { ... }
- if #args < 1 then
- print( "Usage: stairs <height> [<limit>]" )
- error()
- end
- height = tonumber(args[1])
- limit = 256
- if #args == 2 then
- limit = tonumber(args[2])
- end
- if height < 2 then
- print( "The height must be >= 2." )
- error()
- end
- print("======== 2013 (c) psychedelixx ========")
- print("Let's go!")
- while limit > 0 do
- if turtle.getFuelLevel() < height*2 then
- turtle.refuel()
- end
- if turtle.getFuelLevel() < height*2 then
- print("Fuel is almost empty!")
- end
- print("")
- print("Remaining: " .. limit)
- print("Next torch in: " .. limit%4 .. "m")
- for var = 0, height-3 do
- t.digUp()
- if var < height-3 then
- t.up()
- end
- if var == 0 and limit%4 == 0 then
- t.right()
- t.dig()
- turtle.select(15)
- turtle.place()
- t.left()
- end
- end
- for var = 0, height-4 do turtle.down() end
- t.digDown()
- t.down()
- if not turtle.detectDown() then
- turtle.select(16)
- turtle.placeDown()
- end
- t.dig()
- turtle.forward()
- limit = limit-1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement