Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Make a 7x7 tower (5x5 inside)
- -- Slots
- -- 1: Fuel
- -- 2: Wall and stair materials
- -- 3: Floor material
- -- 4: Torches
- function forward(steps)
- local i
- if steps > 0 then
- for i=1,steps,1 do
- turtle.forward()
- end
- end
- end
- function back(steps)
- local i
- if steps > 0 then
- for i=1,steps,1 do
- turtle.back()
- end
- end
- end
- function restock(slot, amount)
- while turtle.getItemCount(slot) < amount+1 do
- for i=5,16,1 do
- turtle.select(i)
- if turtle.compareTo(slot) then
- turtle.transferTo(slot)
- break
- end
- end
- end
- turtle.select(slot)
- end
- function wall(stair) -- Build the walls
- local w, i
- while turtle.getFuelLevel() < 40 do
- turtle.select(1)
- turtle.refuel(1)
- end
- restock(2,25)
- turtle.up()
- for w=1,4,1 do
- for i=1,6,1 do
- turtle.forward()
- turtle.placeDown()
- if w == 1 and i == stair+1 then
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.back()
- turtle.turnLeft()
- end
- end
- turtle.turnRight()
- end
- end
- function placeLine() -- Place a five long line
- local i
- for i=1,4,1 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.placeDown()
- turtle.forward()
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.placeDown()
- end
- function floor() -- Build the floor
- local i
- while turtle.getFuelLevel() < 35 do
- turtle.select(1)
- turtle.refuel(1)
- end
- restock(3,20)
- turtle.turnRight()
- turtle.forward() -- The Wall
- turtle.forward() -- Stairs
- turtle.turnLeft()
- turtle.forward()
- placeLine()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- placeLine()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- placeLine()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- placeLine()
- turtle.forward()
- turtle.turnRight()
- for i=1,5,1 do
- turtle.forward()
- end
- turtle.turnRight()
- end
- function torchIt(slot)
- forward(3)
- turtle.turnRight()
- forward(3)
- turtle.up()
- turtle.select(4)
- turtle.placeDown()
- back(3)
- turtle.turnLeft()
- forward(3)
- turtle.turnRight()
- turtle.down()
- end
- function section()
- wall(1)
- wall(2)
- wall(3)
- wall(4)
- for i=1,6,1 do
- turtle.forward()
- end
- turtle.turnRight()
- wall(1)
- wall(2)
- wall(3)
- wall(4)
- floor()
- torchIt()
- end
- section()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement