You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
miner/mine.lua

38 lines
740 B

local robot = require("robot")
local nav = require("navigator")
local chest = require("chest")
local miner = require("miner")
ORES = {
'minecraft:iron_ore',
'minecraft:gold_ore',
'minecraft:coal',
'minecraft:diamond',
'minecraft:redstone',
}
local rows, row_length = ...
if not rows or not row_length then
print("Usage: mine <rows> <row_length>")
end
print("Will mine " .. rows .. "x" .. row_length .. " rows")
-- mine, starts facing "right"
miner.mine(rows, row_length)
-- ends facing "left"
-- store items
print("Storing ores")
chest.store(ORES)
robot.turnRight()
nav.forward(2)
robot.turnLeft()
print("Storing the rest")
chest.store()
robot.turnLeft()
nav.forward(2)
robot.turnLeft()
-- ends facing "right"