To achieve this, I have set my trains to leave after 5 seconds of inactivity. I resoned that if the train was empty it would not need to stay in the station and wait for the circuit to tell it to leave.
As recap needed is:
- Always wait for 5 seconds of inactivity
- Either leave
- When Everything < 0 (leave when circuit says so)
- When Empty cargo inventory
The last 'AND 5 seconds of inactivity' is in my opinion a bit overkill.
What I suggest is that you can group conditions together, in this case the empty cargo and circuit can get grouped together
Something like this:
Which also allows for creating conditions that say either 5 seconds of inactivity and either 1 or 2, or 60 seconds passed or something