formatting
This commit is contained in:
parent
3b799b28b8
commit
1b6bba748d
@ -44,7 +44,7 @@ local function getState()
|
||||
turtleState["script"] = "main/programs/turtle-miner-fibo.lua"
|
||||
turtleState["info"] = ""
|
||||
turtleState["fuelLevel"] = turtle.getFuelLevel()
|
||||
turtle["dataCurrentFibo"] = 2
|
||||
turtleState["dataCurrentFibo"] = 2
|
||||
turtleState["dataGoalRows"] = 0
|
||||
turtleState["dataGoalPathProgress"] = 0
|
||||
turtleState["dataCurrentRow"] = 0
|
||||
@ -62,7 +62,7 @@ end
|
||||
local function clearInventory()
|
||||
for i=1, 16 do
|
||||
turtle.select(i)
|
||||
item_datail = turtle.getItemDetail()
|
||||
itemDetail = turtle.getItemDetail()
|
||||
|
||||
for j=0, #throwAwayList do
|
||||
itemDetail = turtle.getItemDetail()
|
||||
@ -132,9 +132,9 @@ local function checkInventory()
|
||||
end
|
||||
|
||||
|
||||
local function isOre(block_data)
|
||||
for i=0, #ore_list do
|
||||
if block_data["name"] == ore_list[i] then
|
||||
local function isOre(blockData)
|
||||
for i=0, #oreList do
|
||||
if blockData["name"] == oreList[i] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
@ -144,8 +144,8 @@ end
|
||||
local function recursiveOreMining()
|
||||
for i=0, 3 do
|
||||
turtle.turnLeft()
|
||||
block_found, block_data = turtle.inspect()
|
||||
if isOre(block_data) then
|
||||
flockFound, blockData = turtle.inspect()
|
||||
if isOre(blockData) then
|
||||
turtle.dig()
|
||||
turtle.forward()
|
||||
recursiveOreMining()
|
||||
@ -153,16 +153,16 @@ local function recursiveOreMining()
|
||||
end
|
||||
end
|
||||
|
||||
block_found, block_data = turtle.inspectUp()
|
||||
if isOre(block_data) then
|
||||
flockFound, blockData = turtle.inspectUp()
|
||||
if isOre(blockData) then
|
||||
turtle.digUp()
|
||||
turtle.up()
|
||||
recursiveOreMining()
|
||||
turtle.down()
|
||||
end
|
||||
|
||||
block_found, block_data = turtle.inspectDown()
|
||||
if isOre(block_data) then
|
||||
flockFound, blockData = turtle.inspectDown()
|
||||
if isOre(blockData) then
|
||||
turtle.digDown()
|
||||
turtle.down()
|
||||
recursiveOreMining()
|
||||
@ -206,11 +206,11 @@ local function mineChunk()
|
||||
state["dataGoalRows"] = state["dataCurrentFibo"]
|
||||
state["dataGoalPathProgress"] = 3*(state["dataCurrentFibo"]-1)+1
|
||||
|
||||
for i=state["dataCurrentRow"], state[dataGoalRows]-1 do
|
||||
for i=state["dataCurrentRow"], state["dataGoalRows"]-1 do
|
||||
mineRow(state["dataGoalPathProgress"])
|
||||
|
||||
--turn back and return to start of row if not last row
|
||||
if i<state[dataGoalRows]-1 then
|
||||
if i<state["dataGoalRows"]-1 then
|
||||
while not turtle.detect() do
|
||||
turtle.forward()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user