1
0
mirror of https://github.com/Wyrrrd/Autofilter.git synced 2026-06-30 10:02:27 +02:00

4 Commits

Author SHA1 Message Date
Wyrrrd 7be1f2f4b0 Added t&t entry for explanation 2021-04-18 12:08:25 +02:00
Wyrrrd 939d9e3cb6 Limited pickup/drop to object-layer and not-decontructing 2021-04-17 09:05:58 +02:00
Wyrrrd ab77cf1de3 Really removed integrations 2021-04-16 20:33:00 +02:00
Wyrrrd ceb17d2949 Update README.md 2021-04-16 20:30:59 +02:00
7 changed files with 60 additions and 10 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ There is only one text field to enter configuration into. This can be done on th
+ **contents** - Checks for filter candidates in the inventory contents at the inserter's pickup position.
+ **filter** - Checks for filter candidates in the inventory's filter settings at the inserter's pickup position.
+ **belt** - Checks for filter candidates in the contents of a belt at the inserter's pickup position.
+ **belt** - Checks for filter candidates in the items on a belt at the inserter's pickup position.
+ **check** - Checks for the current filter candidates, if they could be inserted in the inventory at the inserter's drop position and removes them from the candidate list, if unsuccessful.
+ *anything else* - Gets ignored. If you want to disable all functionality, just write anything.
+5
View File
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.2
Date: 2021-04-18
Changes:
- Added tips&tricks page for ingame info
---------------------------------------------------------------------------------------------------
Version: 1.1.1
Date: 2021-04-16
Features:
+18 -2
View File
@@ -136,8 +136,24 @@ local function on_built_entity(event)
if inserter and inserter.valid and (inserter.type == "inserter") then
if inserter.filter_slot_count then
if is_filter_empty(inserter) and inserter.inserter_filter_mode == "whitelist" then
local pickup = inserter.surface.find_entities_filtered({position = inserter.pickup_position, force = inserter.force, surface = inserter.surface, limit = 1})
local drop = inserter.surface.find_entities_filtered({position = inserter.drop_position, force = inserter.force, surface = inserter.surface, limit = 1})
-- Read pickup and drop position entity
local pickup = inserter.surface.find_entities_filtered({
position = inserter.pickup_position,
force = inserter.force,
surface = inserter.surface,
collision_mask_layer= "object-layer",
to_be_deconstructed = false,
limit = 1
})
local drop = inserter.surface.find_entities_filtered({
position = inserter.drop_position,
force = inserter.force,
surface = inserter.surface,
collision_mask= "object-layer",
to_be_deconstructed = false,
limit = 1
})
if pickup[1] and pickup[1].valid then
-- Prequisites
local inventory_pickup = pickup[1].get_output_inventory()
+20
View File
@@ -0,0 +1,20 @@
--data.lua
data:extend(
{
{
type = "tips-and-tricks-item",
name = "autofilter",
tag = "[entity=filter-inserter]",
category = "inserters",
indent = 1,
order = "g",
trigger =
{
type = "build-entity",
entity = "filter-inserter",
count = 1
},
dependencies = {"inserters"},
},
})
+2 -5
View File
@@ -1,14 +1,11 @@
{
"name": "Autofilter",
"version": "1.1.1",
"version": "1.1.2",
"title": "Autofilter",
"author": "Wyrrrd",
"dependencies": [
"base >= 1.1.0",
"(?) bobinserters >= 0.18.0",
"? Booktorio >= 1.1.0",
"? informatron >= 0.1.5",
"? wiki >= 0.18.01"
"(?) bobinserters >= 0.18.0"
],
"description": "Automatically set inserter filters based on adjacent inventory/belt.",
"factorio_version": "1.1"
+7 -1
View File
@@ -5,4 +5,10 @@ Autofilter=Setzt Greifarmfilter automatisch, basierend auf angrenzenden Inventar
autofilter_mode=Autofilter-Modus
[mod-setting-description]
autofilter_mode=Bestimmt die Reihenfolge der Auslesevorgänge (contents = Inventarinhalt, filter = Inventarfilter, belt = Fließbandinhalt, check = Zielinventarprüfung).
autofilter_mode=Bestimmt die Reihenfolge der Auslesevorgänge (contents = Inventarinhalt, filter = Inventarfilter, belt = Fließbandinhalt, check = Zielinventarprüfung).
[tips-and-tricks-item-name]
autofilter=Autofilter
[tips-and-tricks-item-description]
autofilter=Wenn du einen [entity=filter-inserter] von Hand platzierst, liest er den Inventarinhalt, die Inventarfilter oder den Fließbandinhalt and der Aufnahmeposition aus und setzt seinen Filter auf diese Gegenstände.\n\nFür die Konfiguration dieses Verhaltens gibt es nur ein Textfeld. Dieses kann während des Spiels angepasst werden. Du kannst jedes der folgenden Schlüsselworte in beliebiger Reihenfolge getrennt durch Leerzeichen in das Textfeld eintragen. Sie werden von links nach rechts abgearbeitet.\n\n - contents : Überprüft den Inventarinhalt an der [entity=filter-inserter]-Aufnahmeposition nach Filterkandidaten.\n - filter : Überprüft den Inventarfilter an der [entity=filter-inserter]-Aufnahmeposition nach Filterkandidaten.\n - belt : Überprüft die Gegenstände auf einem [entity=transport-belt] oder [entity=splitter] an der [entity=filter-inserter]-Aufnahmeposition nach Filterkandidaten.\n - check : Überprüft, ob die aktuellen Filterkandidaten in ein Inventar an der [entity=filter-inserter]-Ablageposition gelegt werden können, und entfernt sie aus der Kandidatenliste, wenn nicht.\n - Alles andere wird ignoriert. Wenn du alle Funktionen von Autofilter abschalten willst, schreibe einfach irgendetwas in das Textfeld.\n\nNachdem diese Punkte verarbeitet wurden, entfernt eine Deduplikation alle mehrfachen Vorkommen von Gegenständen aus der Filterkandidatenliste, und dann werden die Kandidaten in den [entity=filter-inserter]-Filter geschrieben, bis er voll ist.
+7 -1
View File
@@ -5,4 +5,10 @@ Autofilter=Automatically set inserter filters based on adjacent inventory/belt.
autofilter_mode=Autofilter mode
[mod-setting-description]
autofilter_mode=Configure the priority of reading sources (contents = inventory contents, filter = inventory filter, belt = belt contents, check = check for insertability at drop position).
autofilter_mode=Configure the priority of reading sources (contents = inventory contents, filter = inventory filter, belt = belt contents, check = check for insertability at drop position).
[tips-and-tricks-item-name]
autofilter=Autofilter
[tips-and-tricks-item-description]
autofilter=When you manually place a [entity=filter-inserter], it reads the inventory contents, inventory filters or belt contents on the pickup side and sets its filter to those items.\n\nThere is only one text field to enter configuration of this behaviour into. This can be done on the fly, while ingame. You can add each of the following keywords into the text field, in any order, separated by spaces. They will be processed left to right.\n\n - contents : Checks for filter candidates in the inventory contents at the pickup position of the [entity=filter-inserter].\n - filter : Checks for filter candidates in the inventory's filter settings at the pickup position of the [entity=filter-inserter].\n - belt : Checks for filter candidates in the items on a [entity=transport-belt] or [entity=splitter] at the pickup position of the [entity=filter-inserter].\n - check : Checks for the current filter candidates, if they could be inserted in the inventory at the drop position of the [entity=filter-inserter] and removes them from the candidate list, if unsuccessful.\n - Anything else gets ignored. If you want to disable all functionality of Autofilter, just write anything into the text field.\n\nAfter those are processed, a deduplication removes all but the first appearance of each item from the filter candidate list, and then the candidates are written to the filter of the [entity=filter-inserter] until it is full.