Page 1 of 1

Restart mining drill

Posted: Thu Aug 23, 2018 2:16 pm
by hreintke
Hi,

- I have a mining drill which took all the ore below it.
- Put new ore beneath it with "surface.create_entity({name="copper-ore", amount=ore, position={game.player.position.x+x, game.player.position.y+y}})"
- I see it correctly displayed, the mining drill shows "expected resources"

But the mining drill does not start to take the new created ore.
When destructed and a new drill is placed on the same location, it does begin.
Saving an reload of the game dos not solve it.

Is there a specific action needed to restart ?

Re: Restart mining drill

Posted: Thu Aug 23, 2018 3:36 pm
by steinio
You need to remove and rebuild it. The position is burned up and will not be rescanned until you build a new miner.

Re: Restart mining drill

Posted: Thu Aug 23, 2018 9:50 pm
by hreintke
Did some further testing.

Looks like it is not that the drill doesn't "see" the ore but that it cannot move it to the belt.
Just rotating the drill 4 times makes it work.

See the picture, the drill has mined the ore but is not putting it on the belt.
The yellow dots are from the bottleneck mod, also showing "output full"
drill.JPG
drill.JPG (102.41 KiB) Viewed 3348 times

Re: Restart mining drill

Posted: Thu Aug 23, 2018 11:13 pm
by Aeternus
Looking at the bottom mines in that screenshot, those also show yellow without any ore beneath them. Makes me suspect the bottleneck mod shows mines as yellow for ore shortages too, since mines do not have any input.

It's probably an optimization thing. If a mine has run out of ore, shut it down and never recheck it, since in vanilla there is no condition under which that mine could ever become active again.

Re: Restart mining drill

Posted: Fri Aug 24, 2018 7:09 am
by darkfrei

Re: Restart mining drill

Posted: Fri Aug 24, 2018 3:24 pm
by hreintke
@darkfrei
Thanks, Setting the drill active first to false then to true made it get back to work.

@Aeternus
The drills you see with yellow do have resources beneath them (I checked).
Bottleneck shows red when no resources available( and green when all is running OK)

Re: Restart mining drill

Posted: Fri Aug 24, 2018 7:24 pm
by darkfrei
hreintke wrote:@darkfrei
Thanks, Setting the drill active first to false then to true made it get back to work.
Nice!

Re: Restart mining drill

Posted: Sat Aug 25, 2018 4:02 am
by eradicator
Most likely cause: The game sends the drill into sleep mode after it's finished, to save CPU power. As adding new resources isn't a possible action in vanilla. You might try to ask if this can be fixed as a "bug". Otherwise any change to the drill will probably get it back into active state. Drill.active = Drill.active might even work, and preserves the actual active state in case some other mod made it inactive on purpose.

Re: Restart mining drill

Posted: Sun Aug 26, 2018 8:51 pm
by Bilka
You can use https://lua-api.factorio.com/latest/Lua ... onnections to wake up the mining drill.