get armor equipment content

Place to get help with not working mods / modding interface.
Post Reply
Natha
Fast Inserter
Fast Inserter
Posts: 185
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

get armor equipment content

Post by Natha »

is there are way to access the content of armor equipment?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13227
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: get armor equipment content

Post by Rseding91 »

Yes:

Code: Select all

local grid = game.players[1].getinventory(defines.inventory.playerarmor)[1].grid
for i,equipment in pairs(grid.equipment) do
game.getplayer(1).print(equipment.name)
end
https://forums.factorio.com/wiki/inde ... uimentGrid
https://forums.factorio.com/wiki/inde ... /Equipment
If you want to get ahold of me I'm almost always on Discord.

Natha
Fast Inserter
Fast Inserter
Posts: 185
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: get armor equipment content

Post by Natha »

Rseding91 wrote:Yes:

Code: Select all

local grid = game.players[1].getinventory(defines.inventory.playerarmor)[1].grid
for i,equipment in pairs(grid.equipment) do
game.getplayer(1).print(equipment.name)
end
https://forums.factorio.com/wiki/inde ... uimentGrid
https://forums.factorio.com/wiki/inde ... /Equipment
Thanks very much!

Post Reply

Return to “Modding help”