Hello,
i could need help with a setup.
I want to know when an ore/copper/coal etc.. field is depleted. My first idea is to use the new introduced programmable speaker, which give me an alarm sound as soon the transport belt is empty. I took an red cable from the speaker to the belt and set the belt scanner to "read" and "hold". The speaker setup was to play alarm when <item> = 0. This works aslong the field have much ressources but when it´s nearly empty and only a few items runs through the scanner, the alarm plays constantly. Originally that is still correct, the scanner detects <item> = 0 is true and the sound plays, even when a second later an item pass the scanner.
I think "Play sound when <item> = 0 for n seconds" may be better, but i don´t know how to realize it.
Thanks for help
Belt scanner with speaker
Re: Belt scanner with speaker
Try this,
It's something I came up with after 6 beers in about 5 minutes. It probably could be done better. Basically it keeps summing up the number of items that are on the belt each tick and decays the total amount by 1% each tick. The alarm triggers when its below 100 "accrued items", because of integer maths & rounding issues. Further explanation will be better tomorrow or the day after.
here is the blueprint import string:
It's something I came up with after 6 beers in about 5 minutes. It probably could be done better. Basically it keeps summing up the number of items that are on the belt each tick and decays the total amount by 1% each tick. The alarm triggers when its below 100 "accrued items", because of integer maths & rounding issues. Further explanation will be better tomorrow or the day after.
here is the blueprint import string:
Code: Select all
0eNrNVttu3CAQ/ZWEhz5Udmu8m026qvoPfa4ihO3JGgUDAryNFfnfO+C9XxK7raruw9oMw5nxnMPAKylkC8YK5cnylYhSK0eWP16JEyvFZbD5zgBZEuGhIQlRvAkjeDEWnEu95coZbX1agPSkT4hQFbyQJe0fEwLKCy9gQIyDjqm2KcCiw3tYCTHa4XKtQhYImc4S0uEjxyiVsFAOczg8A8+ng89Hg8+mg9PR4PPp4Plo8LvJ4OMTX0zGzkZj30/GHi+Vh8nYV+qdENw83mrJCqj5Wmgb/Ethy1Z4BooXElglXHiS5ROXDpLdtAVesZqrigUQTBH3jLftgcfWPrg2uoKwyWJQNeTgQjwa/lYWQB1uOlGh82wPFsf9Y99fKMiXyQUZv3VotgM3Vq8sb5pQjtQZ4M/ocE3cmw+9Wl2cq3bLnoR1nr3TwHi15qqEKt1AkCGC8zx0QprRMGwMt9yHUORrdNiEC+YGPNhY8iESW3PspEw4ZoQv6x3DAjFt22AhYtVDAbSH4b2fxB895i8P/GHBjnIxkncFL5/ZWss2fCgu2tlWUhdcym4rLXzXP5nRsjO1Vt0m5T5MgD37yhp948R2ebRoxRputqZwfmwqH3OcUPwhZoN646vow2v83d7ekksipfvjg1vha8xTlCkyVggVGTtXUvbpLmrpRKaLy8rao+7F5d5Q11pY36Jll9bgkQJHLRxpKxwG2gAKK8YnH3GNbr1pJ6NOk09+Lp+E5Nf9s4OyX+of+ZX+QfOp1ND/hBmaZcfUfP5H1FzozG9SQ8d1crq/qVRQigrsKBroKBo2iH+bg+yk7377bQoCkOkwvxZb75PVDRMKYYZW9Uf85Kc7Iz/l43j+4T0+Z2+vv9j5w/06dtXlwRU+IZLjGY22760on28+3CCRvkP7Gtv4QOd8ni/uZ/eLxbzvfwGL0iSu
Re: Belt scanner with speaker
A simple approach is to wire a longer stretch of belts together instead of just one. Same conditions as you used, the wires will sum the ore on all belts.
Re: Belt scanner with speaker
Yeah thought of that, but then realised that maybe the length of the belt is not sufficient for it to be practical.
My setup you can attach it to one belt on the output of your balancer and have it work as opposed to having to connect enough of your input/output belts together sufficiently far back/forward so that it catches all the lines correctly (it becomes worse with blue belt vs yellow belt).
edit: it would probably be better to have an incrementer and a timer so that any period of 60 seconds produces the warning, but I only just thought of doing it that way.
My setup you can attach it to one belt on the output of your balancer and have it work as opposed to having to connect enough of your input/output belts together sufficiently far back/forward so that it catches all the lines correctly (it becomes worse with blue belt vs yellow belt).
edit: it would probably be better to have an incrementer and a timer so that any period of 60 seconds produces the warning, but I only just thought of doing it that way.