Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Direwolf20's 9x9 House builder")
- print("Slots 1-4 = Walls (32 per slot)")
- print("Slot 5 = Floor (49 blocks)")
- print("Slot 6 = Ceiling (65 blocks)")
- print("Slot 7 = Glass (16 blocks)")
- print("Press any key to start")
- io.read()
- --New Forward to stop turtle getting stuck on blocks--
- function buildForward()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.4)
- end
- turtle.forward()
- end
- --New Place that digs anything below to ensure the right block is placed--
- function buildPlaceDown()
- if turtle.detectDown() == true then
- turtle.digDown()
- turtle.placeDown()
- else
- turtle.placeDown()
- end
- end
- --Build a layer of the room--
- function buildLayer()
- turtle.up()
- turtle.back()
- for i=1, 9, 1 do
- buildForward()
- buildPlaceDown()
- end
- turtle.turnRight()
- for i=1, 8, 1 do
- buildForward()
- buildPlaceDown()
- end
- turtle.turnRight()
- for i=1, 8, 1 do
- buildForward()
- buildPlaceDown()
- end
- turtle.turnRight()
- for i=1, 7, 1 do
- buildForward()
- buildPlaceDown()
- end
- buildForward()
- turtle.turnRight()
- end
- --Build ceiling row--
- function ceilingRow()
- turtle.select(6)
- for i=1, 9, 1 do
- buildPlaceDown()
- buildForward()
- end
- end
- --Build ceiling row with glass--
- function ceilingGlass()
- turtle.select(6)
- for i=1, 2, 1 do
- buildPlaceDown()
- buildForward()
- end
- turtle.select(7)
- for i=1, 2, 1 do
- buildPlaceDown()
- buildForward()
- end
- turtle.select(6)
- buildPlaceDown()
- buildForward()
- turtle.select(7)
- for i=1, 2, 1 do
- buildPlaceDown()
- buildForward()
- end
- turtle.select(6)
- for i=1, 2, 1 do
- buildPlaceDown()
- buildForward()
- end
- end
- --Ceiling turning functions--
- function turnRight()
- turtle.turnRight()
- buildForward()
- turtle.turnRight()
- buildForward()
- end
- function turnLeft()
- turtle.turnLeft()
- buildForward()
- turtle.turnLeft()
- buildForward()
- end
- --Ceiling combined--
- function buildCeiling()
- turtle.up()
- ceilingRow()
- turnRight()
- ceilingRow()
- turnLeft()
- ceilingGlass()
- turnRight()
- ceilingGlass()
- turnLeft()
- ceilingRow()
- turnRight()
- ceilingGlass()
- turnLeft()
- ceilingGlass()
- turnRight()
- ceilingRow()
- turnLeft()
- ceilingRow()
- end
- --Build the floor--
- function buildFloorRow()
- for i=1, 7, 1 do
- buildPlaceDown()
- buildForward()
- end
- end
- function buildFloor()
- turtle.select(5)
- buildFloorRow()
- turnRight()
- buildFloorRow()
- turnLeft()
- buildFloorRow()
- turnRight()
- buildFloorRow()
- turnLeft()
- buildFloorRow()
- turnRight()
- buildFloorRow()
- turnLeft()
- buildFloorRow()
- end
- --All of it together--
- buildForward()
- turtle.turnRight()
- buildForward()
- turtle.turnLeft()
- buildFloor()
- turtle.turnRight()
- buildForward()
- turtle.turnRight()
- turtle.select(1)
- buildLayer()
- turtle.select(2)
- buildLayer()
- turtle.select(3)
- buildLayer()
- turtle.select(4)
- buildLayer()
- buildCeiling()
- print("---9x9 Completed---")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement