request_filters
- class RequestFiltersMixin(name: str, similar_entities: list[str], **kwargs: dict)
Used to allow Logistics Containers to request items from the Logistic network.
- set_request_filter(index: int, item: str, count: int | None = None) None
Sets the request filter at a particular index to request an amount of a certain item. Factorio imposes that an Entity can only have 1000 active requests at the same time.
- Parameters:
index – The index of the item request.
item – The item name to request, or
None
.count – The amount to request. If set to
None
, it defaults to the stack size ofitem
.
- Raises:
TypeError – If
index
is not anint
,item
is not astr
orNone
, orcount
is not anint
.InvalidItemError – If
item
is not a valid item name.IndexError – If
index
is not in the range[0, 1000)
.
- set_request_filters(filters: list) None
Sets all the request filters of the Entity, where filters is of the format:
[(item_1, count_1), (item_2, count_2), ...]
where
item_x
is astr
name andcount_x
is a positive integer.- Parameters:
filters – The request filters to set.
- Raises:
DataFormatError – If
filters
does not match the format specified above.InvalidItemError – If
item_x
is not a valid item name.