Page 1 of 1

Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 12:47 pm
by PrgSkidmark
Is there a way to ask if a mining drill entity is stopped because remaining ore = 0?
I'm not sure if I have to get the ore count within the drills boundary because I don't see a method to call.
Thanks,
Doug

Re: Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 12:51 pm
by Tepalus
A way to ask?

Do you want to see how much ores are left while hovering with the mouse over the drill or do you want an pop-up which tells you, there is a empty drill?

At the moment you can see how much ore is left by hovering with the mouse over the drill and you can see how much ore is in each square by hovering over the square.

Re: Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 1:02 pm
by daniel34
Tepalus wrote:A way to ask?

Do you want to see how much ores are left while hovering with the mouse over the drill or do you want an pop-up which tells you, there is a empty drill?

At the moment you can see how much ore is left by hovering with the mouse over the drill and you can see how much ore is in each square by hovering over the square.
This is the Modding help subforum. He is trying to find a way to do it in code, for a mod.

I don't think there is a way to get that information directly from the mining drill, but surface.count_entities_filtered should do the trick.
Search the mining area of the drill and filter by type "resource", this will give you the amount of resources in the given area and also includes modded resources.

Re: Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 1:04 pm
by Phillip_Lynx
Or do some fancy things with combinators and chest :).

(Or are miners capable to conecct directly to the circuit network?)

Re: Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 1:10 pm
by Tepalus
Damn! I usualy search the "new posts" and i did not realize this is the mod-forum! :o

But i have a non-mod idea: Just make a intelligent chest and inserters. One inserter takes ore from the belt and puts it into the chest and one who takes the ore from the chest and puts it on the belt.
Connect the chest to a lamp which turns red when the chest is empty and is yellow when there are less than 200 ores and is green when there are more than 200 ores. (perfectly done when fast inserter puts in chest and normal inserter puts on the belt)

Re: Mining entity stopped because remaining ore is 0

Posted: Thu Apr 14, 2016 2:38 pm
by PrgSkidmark
I figured I would have to check the ore count under the drill. I'll check the resource count then and check.
The position of the drill is dead center right?
The goal is to deconstruct the drills automatically as they exhaust all the ore. I've got it currently deconstructing all drills in my area as I walk. I just need to say if ore count == 0.
Drills are easy to build, and I'm not sure why I want to accomplish this and return them to my inventory. But, it's just a start of a mod.

Re: Mining entity stopped because remaining ore is 0

Posted: Sat Apr 16, 2016 11:23 am
by Arch666Angel
There is a mod, automatic deconstruction which, like the name says, automatically deconstructs miners if they ran dry. So maybe you want to take a look into that mod and the code.