Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SAFE_SLOTS = 1
- LAST_FILLER_SLOT = 8
- SLOT_COUNT = 16
- function selectFiller()
- for slot = SAFE_SLOTS + 1, SLOT_COUNT do
- turtle.select(slot)
- if turtle.compareTo(2) and turtle.getItemCount() > 1 then
- return
- end
- end
- end
- function placeFiller(direction)
- if direction == nil then
- direction = ''
- end
- while turtle['detect' .. direction]() do
- turtle['dig' .. direction]()
- end
- selectFiller()
- turtle['place' .. direction]()
- end
- function clear(direction)
- if direction == nil then
- direction = ''
- end
- while turtle['detect' .. direction]() do
- selectFiller()
- turtle['place' .. direction]()
- turtle['dig' .. direction]()
- end
- end
- function move(direction)
- clear(direction)
- if direction == nil or direction == '' then
- turtle.forward()
- elseif direction == 'Up' then
- turtle.up()
- else
- turtle.down()
- end
- end
- function dropNonFuel()
- for slot = LAST_FILLER_SLOT + 1, SLOT_COUNT do
- turtle.select(slot)
- if not turtle.refuel() then
- turtle.drop()
- end
- end
- end
- function buildLayer(width, height)
- direction = 'Right'
- for x = 1, width do
- for y = 1, height - 1 do
- clear('Down')
- move()
- end
- clear('Down')
- turtle['turn' .. direction]()
- move()
- turtle['turn' .. direction]()
- if direction == 'Right' then
- direction = 'Left'
- else
- direction = 'Right'
- end
- end
- if direction == 'Left' then
- turtle.turnRight()
- move()
- turtle.turnLeft()
- else
- turtle.turnLeft()
- move()
- turtle.turnRight()
- end
- move('Down')
- dropNonFuel()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,45 do
- buildLayer(5, 5)
- end
Add Comment
Please, Sign In to add comment