Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- profondeur = 6
- largeur = 3
- hauteur = 2
- function wThrow()
- for s=1,15 do
- turtle.select(s)
- toThrow = turtle.getItemDetail()
- if toThrow then
- if toThrow.name == 'minecraft:cobblestone' then
- turtle.drop()
- end
- if toThrow.name == 'minecraft:dirt' then
- turtle.drop()
- end
- if toThrow.name == 'minecraft:stone' then
- turtle.drop()
- end
- if toThrow.name == 'minecraft:gravel' then
- turtle.drop()
- end
- if toThrow.name == 'chisel:limestone2' then
- turtle.drop()
- end
- if toThrow.name == 'chisel:marble2' then
- turtle.drop()
- end
- if toThrow.name == 'minecraft:sand' then
- turtle.drop()
- end
- if toThrow.name == 'chisel:basalt2' then
- turtle.drop()
- end
- end
- end
- wSort()
- end
- function Fuel()
- if turtle.getFuelLevel() <= 3 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- function wDetectDig()
- turtle.select(1)
- local j = 1
- while j <= 10 do
- if turtle.detectUp() then
- local success, data = turtle.inspectUp()
- if success then
- if data.name ~= 'minecraft:chest' then
- turtle.digUp()
- end
- end
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- if turtle.detect() then
- turtle.dig()
- j = j + 1
- else
- j = 11
- end
- Fuel()
- end
- end
- function wDig()
- turtle.select(1)
- local i = 1
- while i <= profondeur do
- wDetectDig()
- turtle.forward()
- i = i + 1
- end
- Fuel()
- end
- function wTurnLeft()
- turtle.turnLeft()
- wDetectDig()
- turtle.forward()
- turtle.turnLeft()
- wThrow()
- end
- function wTurnRight()
- turtle.turnRight()
- wDetectDig()
- turtle.forward()
- turtle.turnRight()
- wThrow()
- end
- function wForward()
- turtle.forward()
- l = l + 1
- end
- function wGoBack()
- turtle.turnRight()
- while l >= 1 do
- turtle.forward()
- l = l - 1
- end
- turtle.turnLeft()
- t = q
- while q > 0 do
- turtle.up()
- q = q - 1
- end
- q = t
- wDropUp()
- for v=1,p do
- wTurnDown()
- end
- end
- function wDropUp()
- wThrow()
- local success, data = turtle.inspectUp()
- if success then
- if data.name == 'minecraft:chest' then
- for m=1,15 do
- turtle.select(m)
- turtle.dropUp()
- end
- end
- end
- end
- function wTurnDown()
- for n=1,3 do
- turtle.digDown()
- turtle.down()
- end
- wThrow()
- end
- function wTurnUp()
- while q > 0 do
- turtle.up()
- q = q - 1
- end
- end
- function wProcessHorizontal()
- l = 0
- local k = 1
- while k <= largeur do
- wDig()
- wTurnLeft()
- wDig()
- wTurnRight()
- l = l + 2
- k = k + 1
- end
- end
- function wSort()
- for n=1,15 do
- local elItem = turtle.getItemCount(n)
- local elSpace = turtle.getItemSpace(n)
- local elData = turtle.getItemDetail(n)
- if elData then
- if elSpace > 0 then
- for m=1,15 do
- if n ~= m then
- local elData2 = turtle.getItemDetail(m)
- if elData2 then
- if elData.name == elData2.name then
- local elItem2 = turtle.getItemCount(m)
- local elSpace2 = turtle.getItemSpace(m)
- if elSpace2 > 0 then
- turtle.select(m)
- turtle.transferTo(n)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- p = 0
- q = 3
- while p <= hauteur do
- turtle.select(1)
- wProcessHorizontal()
- wGoBack()
- wTurnDown()
- q = q + 3
- p = p + 1
- end
- wTurnUp()
- wThrow()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement