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