diff --git a/config-miner.lua b/config-miner.lua new file mode 100644 index 0000000..d5a0248 --- /dev/null +++ b/config-miner.lua @@ -0,0 +1,6 @@ +return { + startY = 101, + targetY = 101, + height = 1, + size = 2 -- should not be odd +} \ No newline at end of file diff --git a/install.lua b/install.lua index c9f8c08..a0cdea2 100644 --- a/install.lua +++ b/install.lua @@ -4,6 +4,11 @@ local LIST_FILES = { 'miner.lua' }; +local LIST_CONFIG_FILES = { + 'config-miner.lua' +} + + local REPO_PREFIX = 'https://git.trapcloud.fr/guillaumearm/minecraft-cc-tools/raw/branch/master/' local previousDir = shell.dir() @@ -13,4 +18,11 @@ for _, filePath in pairs(LIST_FILES) do shell.execute('wget', REPO_PREFIX .. filePath, filePath) end +-- do not override existing config files +for _, filePath in pairs(LIST_CONFIG_FILES) do + if not fs.exists(filePath) then + shell.execute('wget', REPO_PREFIX .. filePath, filePath) + end +end + shell.setDir(previousDir) diff --git a/miner.lua b/miner.lua index 7dfa477..1f37c1a 100644 --- a/miner.lua +++ b/miner.lua @@ -1,12 +1,6 @@ local robotApi = require('robot') local turtleUtils = require('turtle-utils') - -local config = { - startY = 109, - targetY = 109, - height = 4, - size = 16 -} +local config = require('config-miner') local LOWER_SIZE_LIMIT = 2; local HIGHER_SIZE_LIMIT = 128; @@ -20,7 +14,6 @@ local MAX_X = TARGET_X local MAX_Y = INITIAL_TARGET_Y + (config.height - 1) local MAX_Z = TARGET_Z - local robot = robotApi.create() local MAX_INVENTORY_BLOCKS = 16 * 64