Page 1 of 1
Locate specific items "missing the material for construction " on the map
Posted: Sat Jul 17, 2021 1:40 am
by Annihilannic
I often have this situation where I have a few items that are missing the material for construction:
The mines are intentional, I lay out my mines in advance and allow robots to build them as the AutoDeconstruct mod dismantles the empty ones. But because of all those missing mine alerts, I can't just click on the icon to locate the missing substations on the map... is there any other trick or mod to do this?
As the factory grows... and Grows... and GROWS...... this becomes more and more difficult!

Re: Locate specific items "missing the material for construction " on the map
Posted: Sat Jul 17, 2021 2:42 am
by DaveMcW
Code: Select all
/c for _, ghost in pairs(game.player.surface.find_entities_filtered{name="entity-ghost"}) do
if ghost.ghost_type ~= "mining-drill" then
game.player.print(ghost.ghost_name.." [gps="..ghost.position.x..","..ghost.position.y.."]")
end
end
Re: Locate specific items "missing the material for construction " on the map
Posted: Sun Jul 18, 2021 7:42 am
by Annihilannic
That's perfect, thanks! Can I bind that to a key somehow?
Re: Locate specific items "missing the material for construction " on the map
Posted: Sun Jul 18, 2021 6:15 pm
by Pi-C
Annihilannic wrote: Sun Jul 18, 2021 7:42 am
Can I bind that to a key somehow?
I've made you a mini-mod. It's too specialized, so I won't upload it to the mod portal -- just download it here and put it in your mod folder! Also, I didn't define a key-binding yet, you must set it yourself (Settings --> Controls from the main menu). Alternatively, you can enter this command in the chat window:
Re: Locate specific items "missing the material for construction " on the map
Posted: Sun Jul 18, 2021 11:41 pm
by Annihilannic
Perfection packaged!

Thanks!!
Re: Locate specific items "missing the material for construction " on the map
Posted: Sun Jul 18, 2021 11:49 pm
by Pi-C
Glad I could help out …

Re: Locate specific items "missing the material for construction " on the map
Posted: Mon Jul 19, 2021 10:31 am
by Qon
I made a mod that I never released that gives buttons, timers and maybe hotkeys for running commands. I don't have access to it right now (...because I didn't release it basically) but I guess this request is a perfect argument for actually finishing and releasing it.
Re: Locate specific items "missing the material for construction " on the map
Posted: Mon Jul 19, 2021 10:46 am
by Pi-C
Qon wrote: Mon Jul 19, 2021 10:31 am
I made a mod that I never released that gives buttons, timers and maybe hotkeys for running commands. I don't have access to it right now (...because I didn't release it basically) but I guess this request is a perfect argument for actually finishing and releasing it.
Seems like it. My mini-mod really is very specific, for running just one hard-coded search. Something a bit more general (perhaps even allowing users to add/remove their own commands and key bindings?) could be quite useful.
Re: Locate specific items "missing the material for construction " on the map
Posted: Mon Jul 19, 2021 11:20 am
by Qon
Yes that is exactly what it was. Some buttons with a textfield (for code) and a timer each, and some hotkeys that would activate those same codes. And you can just write any lua command in those boxes. And if you set a timer then you can run commands periodically.