Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --16X16 space break and place lights every other block
- local space_x = 16
- local space_y = 16
- local moves = 0
- local fuel_level = 0
- local drops = 0
- local last_turn = 'left' --Based on where turtle starts from
- turtle.select(1) --Fuel
- turtle.refuel()
- fuel_level = turtle.getFuelLevel()
- --Select item to place
- turtle.select(2)
- while true do
- turtle.digDown()
- turtle.placeDown()
- drops = drops + 1
- if drops >= 64 then
- turtle.select(3) -- Select the second slot with lights in it
- --drops = 0
- end
- if drops >= 128 then
- --exit
- os.exit()
- end
- if moves < 16 then
- turtle.forward()
- turtle.forward()
- moves = moves + 2
- end
- --Turn right
- if moves >= 16 and last_turn == 'left' then
- --Move over one row then turn around
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- last_turn = 'right'
- moves = 0
- end
- --Turn left
- if moves >= 16 and last_turn == 'right' then
- --Move over one row then turn around
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- last_turn = 'left'
- moves = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment