Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function printUsage()
- print( "Usage:" )
- print( "'Ender2 1' for first time use." )
- print( "'Ender2 2' for 2nd time etc..." )
- print( "'Ender2 #(f.e. 3) top' for last layer" )
- end
- tArgs = { ... }
- if #tArgs > 2 or #tArgs < 1 then
- printUsage()
- return
- elseif tonumber(tArgs[1]) == nil then
- printUsage()
- return
- elseif #tArgs == 2 and tostring(tArgs[2]) ~= "top" then
- printUsage()
- return
- end
- slot = 1
- progress = tonumber(tArgs[1])
- height = 32 + 16 * progress
- print("'Turtle should (still) be in the bottom left corner on the ground'")
- print("'4 layers at a time:'")
- print("'slot 1-2 = pistons 1stack+40'")
- print("'slot 3 = slabs 1stack'")
- print("'slot 4-5 = string 1stack+40'")
- print("'slot 6 = tripwire hooks 16'")
- print("'slot 7-8 = redstone 1stack+56'")
- print("'slot 9-13- = blocks 4stacks+16'")
- print("Type anything to proceed")
- io.read()
- if tArgs[2] == "top" then
- print("'top detected!'")
- print("'Add 26 slabs to slot 16!'")
- else
- print("'Remember: add top for the last layer'")
- print("'For example: Ender2 5 top'")
- end
- print("'turtle backing up, made room?'")
- io.read()
- function place()
- inventory()
- turtle.place()
- end
- function placeUp()
- inventory()
- turtle.placeUp()
- end
- function placeDown()
- inventory()
- turtle.placeDown()
- end
- function inventory()
- while turtle.getItemCount(slot) == 0 do
- slot = slot + 1
- end
- turtle.select(slot)
- end
- --program begins here
- turtle.back()
- for x=1, height do
- turtle.up()
- end
- turtle.forward()
- function piston()
- slot = 1
- place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- function redstone()
- slot = 9
- placeDown()
- turtle.back()
- slot = 7
- place()
- end
- function hook()
- slot = 9
- place()
- turtle.up()
- slot = 3
- place()
- turtle.down()
- turtle.back()
- slot = 6
- place()
- end
- function layer() --layer starts here
- slot = 9
- placeUp() --block
- for x=1, 4 do
- turtle.forward()
- slot = 3
- placeUp() --slabs
- end
- turtle.forward()
- slot = 9
- placeUp() --block
- turtle.back()
- turtle.turnRight()
- for x=1, 14 do --move other side
- turtle.forward()
- end
- turtle.turnRight()
- turtle.back()
- slot = 9
- placeUp() --block
- turtle.forward()
- for x=1, 4 do
- slot = 3
- placeUp() --slabs
- turtle.forward()
- end
- slot = 9
- placeUp() --block
- turtle.forward()
- turtle.turnRight()
- for x=1, 13 do
- turtle.forward() --move to start pistons
- end
- turtle.turnRight()
- turtle.up()
- for x=1, 13 do
- piston() --pistons
- end
- turtle.up()
- turtle.up()
- turtle.forward()
- slot = 7
- placeDown() --place 1 redstone for the hook
- turtle.turnRight()
- turtle.back()
- for x=1, 13 do
- redstone() --place blocks and redstone
- end
- slot = 7
- placeDown() --place 1 redstone for the hook
- turtle.turnRight()
- for x=1, 5 do
- turtle.back() --move to other side
- end
- slot = 7
- placeDown() --place 1 redstone for the hook
- turtle.turnRight()
- turtle.back()
- for x=1, 13 do
- redstone() --place blocks and redstone
- end
- slot = 7
- placeDown() --place 1 redstone for the hook
- turtle.turnLeft()
- turtle.back()
- turtle.down()
- turtle.down()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- for x=1, 13 do
- piston() --pistons
- end
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.forward()
- slot = 3
- placeDown() --place slab1
- turtle.turnLeft()
- for x=1, 14 do
- turtle.forward()
- end
- turtle.turnRight()
- slot = 3
- placeDown() --place slab2
- for x=1, 5 do
- turtle.forward()
- end
- turtle.turnRight()
- slot = 3
- placeDown() --place slab3
- for x=1, 14 do
- turtle.forward()
- end
- turtle.turnRight()
- slot = 3
- placeDown() --place slab4
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- turtle.down()
- hook()
- for x=1, 13 do
- turtle.back()
- end
- turtle.turnRight()
- turtle.turnRight()
- hook()
- turtle.turnLeft()
- for x=1, 3 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- hook()
- for x=1, 13 do
- turtle.back()
- end
- turtle.turnRight()
- turtle.turnRight()
- hook()
- for x=1, 12 do
- turtle.back()
- slot = 4
- place()
- end
- turtle.turnRight()
- turtle.back()
- slot = 4
- place()
- for x=1, 3 do
- turtle.back()
- end
- turtle.turnRight()
- for x=1, 12 do
- turtle.back()
- slot = 4
- place()
- end
- turtle.turnRight()
- turtle.back()
- slot = 4
- place()
- turtle.up()
- turtle.up()
- for x=1, 3 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- end
- function spawn()
- for x=1, 4 do
- turtle.forward()
- slot = 9
- placeDown()
- end
- turtle.turnRight()
- for x=1, 14 do
- turtle.forward()
- slot = 9
- placeDown()
- end
- turtle.turnRight()
- for x=1, 3 do
- turtle.forward()
- slot = 9
- placeDown()
- end
- turtle.turnRight()
- for x=1, 13 do
- turtle.forward()
- slot = 9
- placeDown()
- end
- turtle.forward()
- turtle.turnRight()
- turtle.back()
- end
- for x=1, 4 do
- spawn()
- layer()
- end
- if tostring(tArgs[2]) == "top" then
- turtle.turnRight()
- turtle.up()
- for x=1, 13 do
- turtle.forward()
- slot = 16
- placeDown()
- end
- turtle.turnLeft()
- for x=1, 5 do
- turtle.forward()
- end
- turtle.turnLeft()
- for x=1, 13 do
- slot = 16
- placeDown()
- turtle.forward()
- end
- turtle.turnLeft()
- for x=1, 5 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.down()
- end
- turtle.back()
- height = height + 16
- for x=1, height do
- turtle.down()
- end
- turtle.forward()
- print("'Ender2 is done!'")
- if tostring(tArgs[2]) == "top" then
- print("Finished building, enjoy!")
- else
- print("'Ready to go again!'")
- end
Advertisement
Add Comment
Please, Sign In to add comment