Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- 2013 (c) psychedelixx
- Minecraft Turtle: Pyramid
- 2013-06-14
- desc
- Usage:
- - use turtle and type "label set <name>"
- (to give your turtle an unique name so it remembers its programs)
- - type "pastebin get <code> pyramid"
- - type "pyramid <length>" (32 for full 4x4x64 chest)
- --]]
- slot = 0
- function move()
- if turtle.getFuelLevel() < 5 then
- turtle.refuel()
- end
- if turtle.getItemCount(slot%16+1)==0 then
- slot = slot+1
- turtle.select(slot%16+1)
- end
- turtle.placeDown()
- turtle.forward()
- end
- local args = { ... }
- if #args < 1 then
- print( "Usage: pyramid <length> [32 for full 4x4x64 chest]" )
- error()
- end
- x = tonumber(args[1])
- odd = x%2==1
- if turtle.getFuelLevel() == 0 then
- turtle.refuel()
- end
- if turtle.getFuelLevel() == 0 then
- print("I need fuel!")
- else
- print("======== 2013 (c) psychedelixx ========")
- print("Let's go!")
- start = true
- dir = 1
- turtle.up()
- repeat
- if dir%4 == 1 and not start then
- move()
- turtle.up()
- end
- block = 1
- if odd and x==1 then
- move()
- x=x-1
- else repeat
- move()
- block = block+1
- until block >= x end
- turtle.turnRight()
- dir = dir+1
- if dir%4 == 1 or dir%4 == 0 then x = x-1 end
- if start then start = false end
- until x<=0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement