Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Construction Definitions ###################################
- -- Profiles (individual collums)
- pro1 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
- pro2 = {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
- pro3 = {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1}
- pro4 = {0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1}
- pro5 = {0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1}
- pro6 = {0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1}
- pro7 = {0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1}
- pro8 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
- -- Planes (sets of collums to create planes)
- pla1 = {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} -- basic platform
- pla2 = {8,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2} -- Open room
- pla3 = {8,2,6,6,6,6,6,6,6,6,6,6,6,6,6,2} -- x-axis split room
- pla4 = {8,2,3,3,3,3,3,3,2,3,3,3,3,3,3,2} -- z-axis split room
- pla5 = {8,2,6,6,6,6,6,6,7,6,6,6,6,6,6,2} -- -z tri-split room
- pla6 = {8,2,3,3,3,4,5,5,3,5,5,4,3,3,3,2} -- ctrl-room layer 1
- pla7 = {8,2,3,3,3,4,5,3,3,3,5,4,3,3,3,2} -- ctrl-room layer 2,3
- pla8 = {8,2,3,3,3,5,5,5,5,5,5,5,3,3,3,2} -- ctrl-room layer 4,5
- -- Rooms (sets of planes)
- roo1 = {1} -- floor
- roo2 = {2,2,2,1} -- basement (3block clearence)
- roo3 = {2,2,2,2,2,1} --
- roo3 = {6,7,7,8,8,1} -- control room (5block clearence)
- roo4 = {2,2,2,2,2,1} -- open room
- roo5 = {3,3,3,3,3,1} -- x-split room
- roo6 = {4,4,4,4,4,1} -- z-split room
- roo7 = {5,5,5,5,5,1} -- -z tri-split room
- -- Initial System Variables ###################
- local elev = 0
- local xPos,zPos = 0,0
- local xDir,zDir = 0,1
- local selSlot = 1
- turtle.select(1)
- local iCount = nil
- -- Movement Functions #########################
- function turnRight()
- turtle.turnRight()
- xDir, zDir = zDir, -xDir
- end
- function turnLeft()
- turtle.turnLeft()
- xDir, zDir = -zDir, xDir
- end
- function goHome()
- if zPos > 0 then
- while zDir ~= -1 do
- turnRight()
- end
- while zPos > 0 do
- advance()
- end
- end
- if xPos > 0 then
- while xDir ~= -1 do
- turnRight()
- end
- while xPos > 0 do
- advance()
- end
- end
- -- elevation handeler -- tba
- while zDir ~= 1 do
- turnRight()
- end
- end
- -- Turtle Maintance functions ##############################
- --function resupply()
- -- local x,y,z,xd,zd = xPos,elev,zPos,xDir,zDir
- -- goTo(0,0,0,0,-1)
- --end
- -- Core construction functions #############################
- function advance()
- turtle.forward()
- xPos = xPos + xDir
- zPos = zPos + zDir
- end
- function buildFwd()
- icount = turtle.getItemCount(selSlot)
- if icount < 1 then
- selSlot = selSlot + 1
- turtle.select(selSlot)
- end
- turtle.placeDown()
- advance()
- end
- function turnAround()
- if zDir == 1 then
- turnRight()
- advance()
- turnRight()
- advance()
- else
- turnLeft()
- advance()
- turnLeft()
- advance()
- end
- end
- -- ############################################
- function advOrBuild(x)
- if x == 1 then
- buildFwd()
- else
- advance()
- end
- end
- function layColumn(num)
- if zDir == 1 then
- b=1
- c=16
- d=1
- elseif zDir == -1 then
- b=16
- c=1
- d=-1
- end
- for a = b, c, d do
- if num == 1 then
- advOrBuild(pro1[a])
- elseif num == 2 then
- advOrBuild(pro2[a])
- elseif num == 3 then
- advOrBuild(pro3[a])
- elseif num == 4 then
- advOrBuild(pro4[a])
- elseif num == 5 then
- advOrBuild(pro5[a])
- elseif num == 6 then
- advOrBuild(pro6[a])
- elseif num == 7 then
- advOrBuild(pro7[a])
- elseif num == 8 then
- advOrBuild(pro8[a])
- end
- end
- end
- function layPlane(num)
- if num == 1 then
- for a = 1, #pla1 do
- layColumn(pla1[a])
- turnAround()
- end
- elseif num == 2 then
- for a = 1, #pla2 do
- layColumn(pla2[a])
- turnAround()
- end
- elseif num == 3 then
- for a = 1, #pla3 do
- layColumn(pla3[a])
- turnAround()
- end
- elseif num == 4 then
- for a = 1, #pla4 do
- layColumn(pla4[a])
- turnAround()
- end
- elseif num == 5 then
- for a = 1, #pla5 do
- layColumn(pla5[a])
- turnAround()
- end
- elseif num == 6 then
- for a = 1, #pla6 do
- layColumn(pla6[a])
- turnAround()
- end
- elseif num == 7 then
- for a = 1, #pla7 do
- layColumn(pla7[a])
- turnAround()
- end
- elseif num == 8 then
- for a = 1, #pla8 do
- layColumn(pla8[a])
- turnAround()
- end
- end
- goHome()
- turtle.up()
- end
- -- Program Proper ##############
- layPlane(1)
- layPlane(2)
- layPlane(2)
- layPlane(2)
- layPlane(1)
- layPlane(6)
- layPlane(7)
- layPlane(7)
- layPlane(8)
- layPlane(8)
- layPlane(1)
Advertisement
Add Comment
Please, Sign In to add comment