.
This commit is contained in:
parent
49da7a7a44
commit
116adfc3dc
@ -50,6 +50,23 @@ function splitStringToArray(input_str)
|
||||
return table
|
||||
end
|
||||
|
||||
--secure digging wrappers
|
||||
local function secureDig()
|
||||
while turtle.detect() do
|
||||
turtle.dig()
|
||||
end
|
||||
end
|
||||
local function secureDigUp()
|
||||
while turtle.detectUp() do
|
||||
turtle.digUp()
|
||||
end
|
||||
end
|
||||
local function secureDigDown()
|
||||
while turtle.detectDown() do
|
||||
turtle.digDown()
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
{
|
||||
clearDisplay=clearDisplay,
|
||||
@ -59,4 +76,7 @@ return
|
||||
readFileOneline=readFileOneline,
|
||||
readFileAll=readFileAll,
|
||||
splitStringToArray=splitStringToArray,
|
||||
secureDig=secureDig,
|
||||
secureDigUp=secureDigUp,
|
||||
secureDigDown=secureDigDown,
|
||||
}
|
@ -93,9 +93,9 @@ local function storeItems()
|
||||
if itemDetail ~= nil then
|
||||
if itemDetail.name == "minecraft:chest" then
|
||||
turtle.up()
|
||||
turtle.digUp()
|
||||
basic.secureDigUp()
|
||||
turtle.up()
|
||||
turtle.digUp()
|
||||
basic.secureDigUp()
|
||||
turtle.placeUp()
|
||||
--TODO save in list, where chest is placed
|
||||
chestAvailable = true
|
||||
@ -153,7 +153,7 @@ local function recursiveOreMining()
|
||||
turtle.turnLeft()
|
||||
flockFound, blockData = turtle.inspect()
|
||||
if isOre(blockData) then
|
||||
turtle.dig()
|
||||
basic.secureDig()
|
||||
turtle.forward()
|
||||
recursiveOreMining()
|
||||
turtle.back()
|
||||
@ -162,7 +162,7 @@ local function recursiveOreMining()
|
||||
|
||||
flockFound, blockData = turtle.inspectUp()
|
||||
if isOre(blockData) then
|
||||
turtle.digUp()
|
||||
basic.secureDigUp()
|
||||
turtle.up()
|
||||
recursiveOreMining()
|
||||
turtle.down()
|
||||
@ -170,7 +170,7 @@ local function recursiveOreMining()
|
||||
|
||||
flockFound, blockData = turtle.inspectDown()
|
||||
if isOre(blockData) then
|
||||
turtle.digDown()
|
||||
basic.secureDigDown()
|
||||
turtle.down()
|
||||
recursiveOreMining()
|
||||
turtle.up()
|
||||
@ -182,10 +182,10 @@ local function mineRow()
|
||||
for i=state["dataCurrentPathProgress"], state["dataGoalPathProgress"]-2 do
|
||||
print("row: " .. state["dataCurrentRow"]+1 .. "/" .. state["dataGoalRows"] .. ", pathProgress: " .. state["dataCurrentPathProgress"]+1 .. "/" .. state["dataGoalPathProgress"])
|
||||
|
||||
turtle.dig()
|
||||
basic.secureDig()
|
||||
turtle.forward()
|
||||
turtle.digUp()
|
||||
turtle.digDown()
|
||||
basic.secureDigUp()
|
||||
basic.secureDigDown()
|
||||
|
||||
--check current mining step for ore
|
||||
turtle.up()
|
||||
@ -232,10 +232,10 @@ local function mineChunk()
|
||||
--go to next row
|
||||
turtle.turnLeft()
|
||||
for j=0, 2 do
|
||||
turtle.dig()
|
||||
basic.secureDig()
|
||||
turtle.forward()
|
||||
turtle.digUp()
|
||||
turtle.digDown()
|
||||
basic.secureDigUp()
|
||||
basic.secureDigDown()
|
||||
end
|
||||
turtle.turnLeft()
|
||||
end
|
||||
@ -260,10 +260,10 @@ local function mineFibo()
|
||||
--go to next chunk
|
||||
turtle.turnRight()
|
||||
for j=1, 2 do
|
||||
turtle.dig()
|
||||
basic.secureDig()
|
||||
turtle.forward()
|
||||
turtle.digUp()
|
||||
turtle.digDown()
|
||||
basic.secureDigUp()
|
||||
basic.secureDigDown()
|
||||
end
|
||||
|
||||
--get next fibo number
|
||||
|
@ -56,6 +56,7 @@ local function placeTree()
|
||||
if not blockFound then
|
||||
turtle.up()
|
||||
turtle.forward()
|
||||
turtle.suckDown()
|
||||
for i=0, 3 do
|
||||
turtle.placeDown()
|
||||
turtle.forward()
|
||||
@ -82,7 +83,7 @@ local function emptyInventory()
|
||||
end
|
||||
end
|
||||
|
||||
function brulijam()
|
||||
function main()
|
||||
if fallingTreeModUsed then
|
||||
while true do
|
||||
blockFound, blockData = turtle.inspect()
|
||||
@ -118,4 +119,4 @@ function brulijam()
|
||||
end
|
||||
end
|
||||
|
||||
brulijam()
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user