this repository is work in progress...
factorio-automation
is a powerful mod that provides a set of remote interfaces that can be used to create Factorio agents. This library allows users to control player actions, manage resources, and automate complex processes through simple function calls.
To use these remote interfaces, call them using the remote.call function in Factorio:
remote.call("factorio_tasks", "command_name", arg1, arg2, ...)
-
walk_to_entity(entity_type, entity_name, search_radius)
Walk to the nearest specified entity within range. -
mine_entity(entity_type, entity_name)
Mine the nearest specified entity. -
place_entity(entity_name)
Place the specified entity at current position.
-
place_item_in_chest(item_name, count)
Put items into a nearby chest. -
auto_insert_nearby(item_name, entity_type, max_count)
Insert items into nearby entities, up to a limit. -
pick_up_item(item_name, count, container_type)
Collect items from nearby containers.
-
craft_item(item_name, count)
Craft a number of specified items. -
research_technology(technology_name)
Start researching a technology.
attack_nearest_enemy(search_radius)
Attack the closest enemy within range.
log_player_info(player_id)
Record detailed player information.
This example, collects 5 stone, crafts a stone furnace, places a stone furnace, collects iron and coal and then places them in the stone furnace.
-- Place a stone furnace
/c remote.call("factorio_tasks", "place_entity", "stone-furnace")
-- Walk to and mine coal
/c remote.call("factorio_tasks", "walk_to_entity", "resource", "coal", 500)
/c remote.call("factorio_tasks", "mine_entity", "resource", "coal")
/c remote.call("factorio_tasks", "mine_entity", "resource", "coal")
/c remote.call("factorio_tasks", "mine_entity", "resource", "coal")
/c remote.call("factorio_tasks", "mine_entity", "resource", "coal")
/c remote.call("factorio_tasks", "mine_entity", "resource", "coal")
-- Walk to and mine iron ore
/c remote.call("factorio_tasks", "walk_to_entity", "resource", "iron-ore", 500)
/c remote.call("factorio_tasks", "mine_entity", "resource", "iron-ore")
/c remote.call("factorio_tasks", "mine_entity", "resource", "iron-ore")
/c remote.call("factorio_tasks", "mine_entity", "resource", "iron-ore")
/c remote.call("factorio_tasks", "mine_entity", "resource", "iron-ore")
/c remote.call("factorio_tasks", "mine_entity", "resource", "iron-ore")
-- Walk to the nearest furnace
/c remote.call("factorio_tasks", "walk_to_entity", "furnace", "stone-furnace", 50)
-- Put coal into the furnace
/c remote.call("factorio_tasks", "auto_insert_nearby", "coal", "furnace", 5)
-- Put iron ore into the furnace
/c remote.call("factorio_tasks", "auto_insert_nearby", "iron-ore", "furnace", 5)
Contributions to Automate Factorio are welcome! Please feel free to submit pull requests, create issues or spread the word.