diff --git a/miner.lua b/miner.lua index 093e7ef..43079f9 100644 --- a/miner.lua +++ b/miner.lua @@ -30,7 +30,7 @@ local function mine_n(count, place_torches) -- place a torch every 11 blocks to keep the tunnel lit if i % 11 == 0 and place_torches then - torch.place_torch(sides.west) + torch.place_torch(sides.right) end end return mined @@ -67,7 +67,7 @@ local function mine(scan_depth) -- place a torch every 11 blocks to keep the tunnel lit if moved_rows % 11 == 0 then - torch.place_torch(sides.north) + torch.place_torch(sides.left) end if mine_n(1, false) ~= 1 then @@ -75,7 +75,6 @@ local function mine(scan_depth) break end moved_rows = moved_rows + 1 - end -- go back to start diff --git a/torch.lua b/torch.lua index 29f4cd7..dce1e8f 100644 --- a/torch.lua +++ b/torch.lua @@ -10,7 +10,9 @@ local function place_torch(side) if stack.name == "minecraft:torch" then robot.select(1) - robot.placeUp(side) + if not robot.placeUp(side) then + print('Failed to place torch') + end else print('Out of torches') end