Setting a value for multiple items in a grid
Posted: Wed May 31, 2017 2:22 pm
How to get to all equipment with the same name in a vehicle grid and read/set their energy?
www.factorio.com
https://forums.factorio.com/
Code: Select all
if vehicle.grid then
for _, eq in pairs vehicle.grid.equipment do
if eq.name == "eq-name" then
eq.energy = 0
end
end
end