refactor: add config-miner file
This commit is contained in:
parent
772d94693d
commit
1e30be3223
6
config-miner.lua
Normal file
6
config-miner.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
startY = 101,
|
||||
targetY = 101,
|
||||
height = 1,
|
||||
size = 2 -- should not be odd
|
||||
}
|
||||
12
install.lua
12
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)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user