-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.lua
57 lines (48 loc) · 1.67 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
config =
{
-- make construction bots not go to the quickbar, default on
fix_bots = true,
-- make construction bots unminable, default on
unminable_bots = true,
-- make logistic bots unminable, default off
unminable_logistic_bots = false,
-- mining bots returns the materials, default off
mine_bot_materials = false,
-- Changes how many items are requested when copying from assembler to requester chest
-- (default is 2 times the amount of the ingredients), default off
fix_requester_paste_multiplier = false,
requester_paste_multiplier = 5,
--add larger radar, default off
radar_mk2 = false
}
if config.unminable_bots then
config.mine_bot_materials = false
end
function copyPrototype(type, name, newName)
if not data.raw[type][name] then error("type "..type.." "..name.." doesn't exist", 2) end
local p = table.deepcopy(data.raw[type][name])
p.name = newName
if p.minable and p.minable.result then
p.minable.result = newName
end
if p.place_result then
p.place_result = newName
end
if p.result then
p.result = newName
end
return p
end
function addRecipeUnlock(tech, recipe)
if not data.raw["technology"][tech] then error("technology "..tech.." doesn't exist", 2) end
if not data.raw["recipe"][recipe] then error("recipe "..recipe.." doesn't exist", 2) end
if not type(data.raw["technology"][tech].effects) == "table" then
data.raw["technology"][tech].effects = {}
end
table.insert(data.raw["technology"][tech].effects,
{
type="unlock-recipe",
recipe = recipe
})
end
return config, copyPrototype, addRecipeUnlock