Module world

Factorio World Internal representation of a Factorio world.

Functions

draw (save_path) draw world and save as image at given path Sends
find_free_resource_rect (ore_name, width, height, near) find non-blocked rectangle with given resource The ...
inventory (player_id, item_name) counts how many of a given item the player has The ...
player (player_id) lookup player by id The player id will start at 1 and increment.
find_entities_in_radius (search_center, radius[, search_name[, search_type]]) find entities at given position/radius with optional filters Sends
recipe (name) lookup recipe by name The name as defined by https://wiki.factorio.com/Materialsandrecipes


Functions

draw (save_path)
draw world and save as image at given path Sends

Parameters:

find_free_resource_rect (ore_name, width, height, near)
find non-blocked rectangle with given resource The ...

Parameters:

  • ore_name string name of item to craft
  • width int name of item to craft
  • height int name of item to craft
  • near types.Position

Returns:

    types.FactorioPlayer
inventory (player_id, item_name)
counts how many of a given item the player has The ...

Parameters:

  • player_id int id of player
  • item_name string name of item

Returns:

    {types.FactorioEntity}
player (player_id)
lookup player by id The player id will start at 1 and increment.

Parameters:

  • player_id int id of player

Returns:

    types.FactorioPlayer
find_entities_in_radius (search_center, radius[, search_name[, search_type]])
find entities at given position/radius with optional filters Sends

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}
recipe (name)
lookup recipe by name The name as defined by https://wiki.factorio.com/Materialsandrecipes

Parameters:

  • name string name of item to craft

Returns:

    types.FactorioRecipe
generated by LDoc 1.4.3 Last updated 2022-06-27 20:24:33