Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- TURTLE HOME POSITION
- local turtle_home_pos =
- vector.new(0,0,2)
- --- DIMENSIONS OF ROOM
- local num_walls = 7
- local wall_depth = 3
- --- ROOM CORNERS
- local corners = {}
- local cr_d = 11+(3*(wall_depth-1))
- corners[1] = vector.new(0,0,0)
- corners[2] = vector.new(0,0,4)
- corners[3] = vector.new(6,0,4)
- corners[4] = vector.new(6,0,16)
- corners[5] = vector.new(cr_d,0,16)
- corners[6] = vector.new(cr_d,0,15)
- corners[7] = vector.new(6,0,15)
- corners[8] = vector.new(6,0,11)
- corners[9] = vector.new(cr_d,0,11)
- corners[10] = vector.new(cr_d,0,10)
- corners[11] = vector.new(6,0,10)
- corners[12] = vector.new(6,0,6)
- corners[13] = vector.new(cr_d,0,6)
- corners[14] = vector.new(cr_d,0,5)
- corners[15] = vector.new(6,0,5)
- corners[16] = vector.new(6,0,1)
- corners[17] = vector.new(cr_d,0,1)
- corners[18] = vector.new(cr_d,0,0)
- --- CHEST POSITIONS
- local chests = {}
- chests[1] = vector.new(0,0,4) -- DUMP
- chests[2] = vector.new(3,0,4) -- SWAP
- local cnt = 3 -- new index
- local wall = 20 -- start val
- local base_depth = 11 -- first depth
- for i=1,num_walls do
- if i%2 == 0 then
- wall = wall - 1
- else
- wall = wall - 4
- end
- for j=1,wall_depth do
- chests[cnt] = vector.new(
- wall,0,base_depth+(3*(j-1)))
- cnt = cnt + 1
- end
- end
- function checkFull()
- for i=1,15 do
- select(i)
- if turtle.getItemCount(i) ~= 0 then
- if i==15 then
- return true
- end
- end
- end
- return false
- end
- function fromDump()
- while checkFull() == false do
- while checkFull() == false do
- -- consolidates part stack first
- for i=1,15 do
- turtle.select(i)
- turtle.suck()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=2,15 do
- turtle.select(i)
- if turtle.compareTo(1) == false then
- turtle.drop()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- turtle.turnLeft()
- end
- function sort()
- turtle.select(16)
- turtle.suck()
- if turtle.compareTo(1) then
- for i=1,16 do
- turtle.select(i)
- turtle.drop()
- end
- end
- end
- -- put the duds back in the dump chest
- function replaceDump()
- for i=1,5 do
- for j=1,16 do
- turtle.select(j)
- turtle.suck()
- end
- turtle.turnRight()
- turtle.turnRight()
- for j=1,16 do
- turtle.select(j)
- turtle.drop()
- end
- end
- end
- function home()
- end
- function fuel()
- end
- function circuit()
- end
- fromDump()
- turtle.turnLeft()
- sort()
- turtle.turnRight()
- replaceDump()
- fromDump()
- turtle.turnLeft()
- sort()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement