This should work as intended, please contact me if not.
This circuit is able to change the priority of a train station based on 2 criteria:
- There are no resources in the chests.
- It's been at least 10 minutes since the chests were filled (grace period of 10 seconds).
Just connect the green wire from the right side to your chests and from the power pole to your station. If there's been a train at the station within the last 10 minutes that has satisfied the grace period, the priority will be set to 1. Once there are no more resources in the chests and there's been 10 minutes, priority will be reset to 50 again.
Note: The 10 seconds grace period is there to avoid accidents, and also does so that if the chests are almost instantly emptied, it doesn't count. Change it as you please. The circuit shouldn't need to be swapped based on the resource. The top left can be tweaked though based on your preferences.
Do not change X, it is what tells the system to stop. T is for Ticks. The interval which the clock will go on its own is 600 - 36 000 ticks, or 10 seconds to 10 minutes. Outside of that, if the condition becomes false, the clock is stopped and priority is reset to 50.
This took me like 20 tries to upload so I probably won't bother if this is buggy.
