Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Honeycomb Prepare by DennouNeko
- --
- -- Prepares terrain for Honeycomb Build
- -- Requires mining turtle.
- -- Place torches or other light blocks in slot 16 to lit up the floor
- local args = {...}
- local swap = (args[1] == "left")
- local t = turtle
- t.select(16)
- function down(num)
- if num == nil then num = 1 end
- num = tonumber(num)
- for i = 1,num do
- while not t.down() do
- t.digDown()
- end
- end
- end
- function up(num)
- if num == nil then num = 1 end
- for i = 1,num do
- while not t.up() do
- t.digUp()
- end
- end
- end
- function fwd(num)
- if num == nil then num = 1 end
- num = tonumber(num)
- for i = 1,num do
- while not t.forward() do
- t.dig()
- end
- end
- end
- function step()
- if t.detectDown() then t.digDown() end
- if t.detectUp() then t.digUp() end
- end
- function run_n(num, place)
- step()
- for i = 2,num do
- fwd()
- step()
- if place and (i % 5 == 0) then
- t.placeDown()
- end
- end
- end
- function row_up(left)
- if left then
- t.turnLeft()
- fwd()
- t.turnRight()
- fwd()
- else
- t.turnRight()
- fwd()
- t.turnLeft()
- fwd()
- end
- t.turnLeft()
- t.turnLeft()
- step()
- end
- function row_dn(left)
- t.turnRight()
- t.turnRight()
- if left then
- fwd()
- t.turnRight()
- fwd()
- t.turnLeft()
- else
- fwd()
- t.turnLeft()
- fwd()
- t.turnRight()
- end
- step()
- end
- function turn(left)
- if left then
- t.turnLeft()
- fwd()
- t.turnLeft()
- step()
- else
- t.turnRight()
- fwd()
- t.turnRight()
- step()
- end
- for i=1,15 do
- if t.getItemCount(i) > 0 then
- t.select(i)
- t.drop()
- end
- end
- t.select(16)
- end
- function dig_layer(place)
- local len = 14
- for i = 1,6 do
- run_n(len)
- row_up(not swap)
- len = len + 2
- run_n(len, place and i % 2 == 1)
- turn(swap)
- end
- run_n(len)
- turn(not swap)
- run_n(len, place)
- turn(swap)
- for i=1,6 do
- run_n(len)
- row_dn(not swap)
- len = len - 2
- run_n(len, place and i % 2 == 1)
- if i < 6 then
- turn(swap)
- else
- if swap then
- t.turnRight()
- fwd(25)
- t.turnRight()
- else
- t.turnLeft()
- fwd(25)
- t.turnLeft()
- end
- end
- end
- end
- down(3)
- if swap then
- t.turnLeft()
- else
- t.turnRight()
- end
- dig_layer(true)
- up(3)
- dig_layer(false)
- up(3)
- dig_layer(false)
- down(3)
- if swap then
- t.turnRight()
- else
- t.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment