Module rcon

RCON interface methods for sending rcon commands to running factorio instance

Functions

place_blueprint (player_id, blueprint, position, direction, force_build, only_ghosts, helper_player_ids) places a whole blueprint Sends /silent-command remote.call('place_blueprint', ...)
mine (player_id, name, position, count) Mine a resource with player Sends /silent-command remote.call('actionstartmining', ...)
add_research (technology_name) adds research to queue Sends /silent-command remote.call('addresearch', technologyname)
cheat_technology (technology_name) CHEATs research Sends /silent-command remote.call('cheattechnology', technologyname)
inventory_contents_at (inventories) Craft an item with player Sends /silent-command remote.call('actionstartcrafting', ...)
move (player_id, position, radius) Move a player to a different position Sends /silent-command remote.call('actionstartwalk_waypoints', ...)
print (message) print given message on the server Sends /c print(message)
cheat_all_technologies () CHEATs all research Sends /silent-command remote.call('cheatalltechnologies')
insert_to_inventory (player_id, entity_name, position, inventory_type, item_name, item_count) Inserts an item into an inventory Sends /silent-command remote.call('inserttoinventory', ...)
cheat_item (player_id, name, count) CHEATs given item Sends /silent-command remote.call('cheat_item', ...)
revive_ghost (player_id, name, position) CHEATs a whole blueprint Sends /silent-command remote.call('revive_ghost', ...)
cheat_blueprint (player_id, blueprint, position, direction, force_build) CHEATs a whole blueprint Sends /silent-command remote.call('cheat_blueprint', ...)
place_entity (player_id, name, position, direction) Places an item by a player Sends /silent-command remote.call('place_entity', ...)
remove_from_inventory (player_id, entity_name, position, inventory_type, item_name, item_count) Removes an item from an inventory Sends /silent-command remote.call('removefrominventory', ...)
find_entities_in_radius (search_center, radius[, search_name[, search_type]]) find entities at given position/radius with optional filters Sends /silent-command remote.call('findentitiesfiltered', ...)
craft (player_id, name, count) Craft an item with player Sends /silent-command remote.call('actionstartcrafting', ...)


Functions

place_blueprint (player_id, blueprint, position, direction, force_build, only_ghosts, helper_player_ids)
places a whole blueprint Sends /silent-command remote.call('place_blueprint', ...)

Parameters:

  • player_id int id of player to give the item to
  • blueprint string blueprint string
  • position types.Position
  • direction int rotates the blueprint in given direction
  • force_build bool forces the build even if other entities needs to be removed first
  • only_ghosts bool only places ghost version of entities
  • helper_player_ids {int} array of player ids which may help
mine (player_id, name, position, count)
Mine a resource with player Sends /silent-command remote.call('actionstartmining', ...)

Parameters:

  • player_id int id of player to give the item to
  • name string name of resource to mine
  • position types.Position
  • count int how many to mine
add_research (technology_name)
adds research to queue Sends /silent-command remote.call('addresearch', technologyname)

Parameters:

  • technology_name string name of technology to research
cheat_technology (technology_name)
CHEATs research Sends /silent-command remote.call('cheattechnology', technologyname)

Parameters:

  • technology_name string name of technology to CHEAT
inventory_contents_at (inventories)
Craft an item with player Sends /silent-command remote.call('actionstartcrafting', ...)

Parameters:

Returns:

    {[string]=int,...}
move (player_id, position, radius)
Move a player to a different position Sends /silent-command remote.call('actionstartwalk_waypoints', ...)

Parameters:

  • player_id int id of player to give the item to
  • position types.Position
  • radius int radius
print (message)
print given message on the server Sends /c print(message)

Parameters:

cheat_all_technologies ()
CHEATs all research Sends /silent-command remote.call('cheatalltechnologies')
insert_to_inventory (player_id, entity_name, position, inventory_type, item_name, item_count)
Inserts an item into an inventory Sends /silent-command remote.call('inserttoinventory', ...)

Parameters:

  • player_id int id of plaer
  • entity_name string name entity to insert
  • position types.Position of inventory
  • inventory_type string which type of inventory to place in
  • item_name string which item to insert
  • item_count int how many items to insert
cheat_item (player_id, name, count)
CHEATs given item Sends /silent-command remote.call('cheat_item', ...)

Parameters:

  • player_id int id of player to give the item to
  • name string item name
  • count int how many items to give player
revive_ghost (player_id, name, position)
CHEATs a whole blueprint Sends /silent-command remote.call('revive_ghost', ...)

Parameters:

  • player_id int id of player to give the item to
  • name string name of entity to revive
  • position types.Position
cheat_blueprint (player_id, blueprint, position, direction, force_build)
CHEATs a whole blueprint Sends /silent-command remote.call('cheat_blueprint', ...)

Parameters:

  • player_id int id of player to give the item to
  • blueprint string blueprint string
  • position types.Position
  • direction int rotates the blueprint in given direction
  • force_build bool forces the build even if other entities needs to be removed first
place_entity (player_id, name, position, direction)
Places an item by a player Sends /silent-command remote.call('place_entity', ...)

Parameters:

  • player_id int id of plaer
  • name string name of item to craft
  • position types.Position
  • direction int direction of placed entity

Returns:

    types.FactorioEntity
remove_from_inventory (player_id, entity_name, position, inventory_type, item_name, item_count)
Removes an item from an inventory Sends /silent-command remote.call('removefrominventory', ...)

Parameters:

  • player_id int id of plaer
  • entity_name string name entity to remove
  • position types.Position of inventory
  • inventory_type string which type of inventory to remove from
  • item_name string which item to remove
  • item_count int how many items to remove
find_entities_in_radius (search_center, radius[, search_name[, search_type]])
find entities at given position/radius with optional filters Sends /silent-command remote.call('findentitiesfiltered', ...)

Parameters:

  • search_center types.Position
  • radius int searches in circular radius around search_center
  • search_name string name of entity to find (optional)
  • search_type string type of entity to find (optional)

Returns:

    {types.FactorioEntity}
craft (player_id, name, count)
Craft an item with player Sends /silent-command remote.call('actionstartcrafting', ...)

Parameters:

  • player_id int id of plaer
  • name string name of item to craft
  • count int how many to craft
generated by LDoc 1.4.3 Last updated 2022-06-27 20:24:33