Skip to content

Commit 2ffaa40

Browse files
authored
1.6.3 (#5)
- read lab inventories and research progress
1 parent f636ead commit 2ffaa40

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
License:
1+
Copyright (c) 2018 Optera
22

33
This software is provided without warranty and the author/license holder cannot be held liable.
44

changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.6.3
2+
- read lab inventories and research progress
3+
14
1.6.2
25
- read artillery turret and artillery wagon inventories
36

control.lua

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local SENSOR = "item-sensor"
33

44
local ASSEMBLER = "assembling-machine"
55
local FURNACE = "furnace"
6+
local LAB = "lab"
67
local REACTOR = "reactor"
78
local ROBOPORT = "roboport"
89
local SILO = "rocket-silo"
@@ -19,6 +20,7 @@ local TANK = "tank"
1920
local SupportedTypes = {
2021
[ASSEMBLER] = true,
2122
[FURNACE] = true,
23+
[LAB] = true,
2224
[REACTOR] = true,
2325
[ROBOPORT] = true,
2426
[SILO] = true,
@@ -298,6 +300,13 @@ function UpdateSensor(itemSensor)
298300
signalIndex = signalIndex+1
299301
end
300302

303+
elseif connectedEntity.type == LAB then
304+
local progress = connectedEntity.force.research_progress
305+
if progress then
306+
signals[signalIndex] = {index = signalIndex, signal = {type = "virtual",name = "inv-sensor-progress"},count = floor(progress*100)}
307+
signalIndex = signalIndex+1
308+
end
309+
301310
elseif connectedEntity.type == SILO then
302311
-- rocket inventory is nil when no rocket is ready so we have to constantly grab all possible inventories.
303312
SetInventories(itemSensor, connectedEntity)

info.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "Inventory Sensor",
3-
"version": "1.6.2",
3+
"version": "1.6.3",
44
"title": "Inventory Sensor",
55
"author": "Optera",
66
"contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729",
77
"homepage": "https://forums.factorio.com/viewtopic.php?f=97&t=30454",
88
"description": "Adds a combinator that reads inventories of locomotives, wagons, cars, furnaces, assemblers, roboports, rocket silos and reactors.",
99
"factorio_version": "0.16",
10-
"dependencies": ["base >= 0.16.6"]
10+
"dependencies": ["base >= 0.16.16"]
1111
}

0 commit comments

Comments
 (0)