Auto Deconstruct

by mindmix

This mod marks drills that have no more resources to mine for deconstruction.

a month ago
0.13 - 1.1

b [Fixed] Periodic Error

10 months ago

I get error message often on while playing. Not sure what causes them and miners are still marked for deconstruction.

[autodeconstruct|on_resource_depleted] Error: AutoDeconstruct/autodeconstruct.lua: 192: attempt to index field 'last_user' (a nil value)

10 months ago

the line is related to the construction of pipes if you deconstruct a miner using fluid.
the error happens if you try to deconstruct a drill that has no "last_user"
can you explain how you build the offending drill(s)?
It is simple to prevent this error with an additional check, but it would help to understand the root cause first

10 months ago

I use the mod Outpost Planner for 1.1 ( to generate the layout of miners, because I'm lazy. However, that just places ghost entities for you. Then either my personal roboport bots or construction bots from the base's logistic grid actually place the real entities. If the real entities inherit their last user from the ghost entities and if Outpost Planner doesn't properly assign anyone to that then I could see that being a problem.
I'm also playing this in multiplayer with 1 other player who also places miners this way.

10 months ago
(updated 10 months ago)

I have looked into the Outpost planner code a bit and on first glance it does seem like it really omits setting last_user...

It might take a bit of time till I'll provide a pull request to mindmix to fix this, as I am rather busy.

In the meantime you should be able to help yourself by replacing line 192 in autodeconstruct.lua "local drillForce = drill.last_user.force" with "local drill.force"

10 months ago

Having the same issue, I've built mine with mod

10 months ago just waiting for confirmation and integration from mindmix

10 months ago

Made a release, much appreciated!

New response