This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheat_command.txt
46 lines (46 loc) · 2.11 KB
/
cheat_command.txt
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
/c
local EOL = "\n"
local recipe_delimiter = "^°*#+=~-._.-~=+#*°^"
local recipes_dump = ""
local can_be_researched = {}
for _, tech in pairs(game.technology_prototypes) do
for i, effect in ipairs(tech.effects) do
if effect.type == "unlock-recipe" then
can_be_researched[effect.recipe] = true
end
end
end
for _, recipe in pairs(game.player.force.recipes) do
local recipe_prototype = recipe.prototype
local recipe_str = ""
.. "name: " .. recipe_prototype.name .. EOL
.. "enabled: " .. tostring(recipe.enabled) .. EOL
.. "category: " .. recipe_prototype.category .. EOL
.. "order: " .. recipe_prototype.order .. EOL
.. "energy: " .. recipe_prototype.energy .. EOL
.. "group_name: " .. recipe_prototype.group.name .. EOL
.. "group_order: " .. recipe_prototype.group.order .. EOL
.. "subgroup_name: " .. recipe_prototype.subgroup.name .. EOL
.. "subgroup_order: " .. recipe_prototype.subgroup.order .. EOL
.. "request_paste_multiplier: " .. recipe_prototype.request_paste_multiplier .. EOL
if can_be_researched[recipe_prototype.name] then
recipe_str = recipe_str .. "can_be_researched: true" .. EOL
else
recipe_str = recipe_str .. "can_be_researched: false" .. EOL
end
if recipe_prototype.main_product then
recipe_str = recipe_str
.. "main_product: " .. recipe_prototype.main_product.name .. EOL
if game.item_prototypes[recipe_prototype.main_product.name] then
recipe_str = recipe_str
.. "main_product_stack_size: " .. game.item_prototypes[recipe_prototype.main_product.name].stack_size .. EOL
end
end
for _, ing in pairs(recipe_prototype.ingredients) do
if game.item_prototypes[ing.name] then
recipe_str = recipe_str .. "item_ingredient_name: " .. ing.amount .. " " .. ing.name .. " " .. game.item_prototypes[ing.name].stack_size .. EOL
end
end
recipes_dump = recipes_dump .. recipe_str .. EOL .. recipe_delimiter .. EOL .. EOL
end
game.write_file("recipes_dump.txt", recipes_dump)