Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Prompt
- term.clear()
- term.setCursorPos(1,1)
- print("+-------------------------------------+")
- print("| Please place fuel in the lower- |")
- print("| right slot. |")
- print("| Place building materials in the |")
- print("| remaining slots. |")
- print("+-------------------------------------+")
- sleep(1)
- print("How big of a square do you want? ")
- sqrSize = read()
- function placeDown()
- if turtle.placeDown() == false then
- checkSlot()
- end
- turtle.placeDown()
- end
- print("How tall (On the inside) do you want it? ")
- sqrTall = read()
- --Functions
- function plcColumn()
- for i = 1, sqrSize do
- placeDown()
- turtle.forward()
- end
- end
- --Even Column Placement
- function aa()
- plcColumn()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- end
- --Odd Column Placement
- function ab()
- plcColumn()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- end
- --Build a square Platform
- function fltSqr()
- if isEven == true then
- for i = 1, sqrSize/2 do
- aa()
- ab()
- end
- else
- for i = 1, sqrSize/2 do
- aa()
- ab()
- end
- aa()
- end
- end
- --Build the walls of the structure
- function bldWall()
- for i = 1, 4 do
- for i = 1, sqrSize do
- placeDown()
- turtle.forward()
- end
- turtle.turnLeft()
- end
- turtle.up()
- end
- --Change slot selection when you run out of materials
- function checkSlot()
- for i = 1, 15 do
- if itemCount == 0 then
- slotNum = slotNum + 1
- turtle.select(slotNum)
- end
- end
- end
- --Variables
- if sqrSize %2 == 0 then
- isEven = true
- else
- isEven = false
- end
- slotNum = 1
- itemCount = turtle.getItemCount(slotNum)
- --Tests for Variables (Comment out to disable)
- print(isEven)
- print(slotNum)
- print(itemCount)
- --The actual build program
- fltSqr()
- turtle.turnRight(2)
- turtle.forward()
- turtle.up()
- for i = 1, sqrTall do
- bldWall()
- end
- fltSqr()
Advertisement
Add Comment
Please, Sign In to add comment