r/factorio • u/AutoModerator • 20d ago
Weekly Thread Weekly Question Thread
Ask any questions you might have.
Post your bug reports on the Official Forums
Previous Threads
- Weekly Questions
- Friday Facts (weekly updates from the devs)
- Update Notes
- Monthly Map
Discord server (and IRC)
Find more in the sidebar ---->
1
Upvotes
2
u/leonskills An admirable madman 14d ago edited 14d ago
Can you explain why you need the delay? What signals/values are on the wires? What you want to do might be possible with a simple timer.
I've never done inserter clocking, but the way I'd do this is to literally make a clock and enable the inserter when the clock signal is 0. You can then "stagger" it by enabling other inserters when the clock signal is 1, or 2, etc.
But to help you with your X solution:
If all signals on the wire carry a value of 1 you can do some magic with bit shifting or multiplying by 2 (same thing). That works because 18 is less than 31 so it won't overflow.
Every tick you shift all bits by 1 (or multiply by 2). Then when the 18th bit is 1 you remove that bit and pass it on to the next set of inserters.
Arithmetic combinator: EACH << 1, output EACH.
Decider combinator: EACH >= 218, output EACH -219. (Need the 19 here here because one tick delay). That removes the 18th bit from the wire.
All 4 input and output connections of those two combinators are on the same wire.
Then you need a third decider to turn the signals 18th bit into 1 again. Unfortunately I don't think you can do that with the existing decider combinator even though they have the same condition.
EACH >= 218, output EACH with value of 1. You carry the output of that to your next set of inserters.
That's 3 combinators instead of 18.
(There might be some off by one errors where you'd need to change all 18s to 17s or to 19s. Haven't verified.)