Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --TODO: add return to start
- tArgs = {...}
- color = tArgs[1]
- function select(i)
- turtle.select(i+ (color == "white" and 0 or 6))
- end
- function buildBase()
- select(1)
- for y = 1,5 do
- for x = 1,4 do
- turtle.placeDown()
- turtle.forward()
- end
- if y < 5 then
- if y%2 ~= 0 then
- turtle.turnRight()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- end
- turtle.placeDown()
- end
- function buildMid()
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- for i = 1,5 do
- turtle.up()
- turtle.placeDown()
- end
- if color == "white" then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- turtle.forward()
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.back()
- turtle.up()
- select(3)
- turtle.placeDown()
- turtle.back()
- turtle.down()
- if color ~= "white" then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- turtle.back()
- turtle.back()
- turtle.down()
- if color == "white" then
- rightSide()
- turnCorner()
- front()
- turnCorner()
- turtle.up()
- leftSide()
- turnCorner()
- back()
- else
- leftSide()
- turnCorner()
- back()
- turtle.down()
- turnCorner()
- rightSide()
- turnCorner()
- front()
- end
- end
- function turnCorner()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- end
- function leftSide()
- select(4)
- turtle.place()
- select(5)
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- select(3)
- turtle.place()
- turtle.down()
- turtle.place()
- turtle.down()
- select(2)
- turtle.place()
- turtle.down()
- turtle.down()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- end
- function rightSide()
- select(4)
- turtle.place()
- select(5)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.down()
- select(3)
- turtle.place()
- turtle.down()
- turtle.place()
- turtle.down()
- select(2)
- turtle.place()
- turtle.down()
- turtle.down()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- end
- function front()
- select(2)
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- turtle.up()
- select(4)
- turtle.place()
- turtle.up()
- select(5)
- turtle.place()
- turtle.up()
- select(3)
- turtle.place()
- end
- function back()
- select(2)
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.back()
- turtle.place()
- turtle.up()
- select(2)
- turtle.place()
- turtle.up()
- select(3)
- turtle.place()
- turtle.up()
- select(4)
- turtle.place()
- turtle.up()
- select(5)
- turtle.place()
- turtle.up()
- select(3)
- turtle.forward()
- turtle.place()
- turtle.back()
- end
- function returnToStart()
- if color == "white" then
- for i = 1,6 do
- turtle.down()
- end
- else
- for i = 1,4 do
- turtle.down()
- end
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- end
- buildBase()
- buildMid()
- returnToStart()
Advertisement
Add Comment
Please, Sign In to add comment