ac-minetest / basic_machines

Simple automation mod for minetest
17 stars 22 forks source link

Distributor delay does not work #38

Closed minertestdude closed 5 years ago

minertestdude commented 5 years ago

need: 2x chest, 2x distributor, 1x mover, 1x battery, 1x clock generator, 4x99 item (I use farming:rhubarb), some mese blocks, 25 batteries

place two chests near each other, place clock generator and distributor on top, remove clock generator from below until setup, place 2nd distributor near 1st distributor, place battery near 2nd distributor, place mese and feed battery so it has enough energy to run test, place all rhubarb in one chest (1st chest)

program: set only target of 1st distributor to 2nd distributor, set only target of 2nd distributor to mover, set delay 1st distributor - 0 set delay 2nd distributor - 100 set mover: inventory mode, punch 1st chest source, 2nd chest dst. set mover filter to: "farming:rhubarb 99" add clockgen under distributor now

expected: clock gen (5s) --> distributor (0 delay, each 5 seconds) --> distributor (100 delay, each 100 seconds) --> mover (moves 99 rhubarb from 1st chest to 2nd chest) in 5..105..205..305.. seconds.

reality: mover moves rhubarb every 5 seconds. This corresponds to 2nd distributor delay is ignored.

ac-minetest commented 5 years ago

no bug here. its still activated every 5 seconds but its delayed 100, so: 100, 105, 110, 115... rethink your approach

minertestdude commented 5 years ago

@ac-minetest why do you close bug without comment from bug reporter?.. I disagree respectfully - its a bug, it removes any sense from "delay". Distributor should not accept signal, if it has not yet sent the previous signal.

Should be: listen to input signal, if signal then stop listen, sleep until $delay, send signal, unblock; It is: listen to input signal, send signal+$delay;

The bug does not surface in accelerating distributors (less than 5). Those wait proper delay, because clock signal is high enough.

This causes any distributor with delay higher than 5 to be useless and I personally have to resort to "randomness (negative)" to simulate big delays.

minertestdude commented 5 years ago

Ok, we talked and for information to general public here - distributor implements a simple "timer relay".
Simple timer relay is a timer relay with one timer who does either: t1S or St1, where S is gate on, t1 is timer value with gate off. Distributor implements the former.

Distributor implement neither wischer functionality, nor two-timer relay "t1t2" where t1=gate off, t2=gate on. Wischer can be seen as t2 set to permanent small time frame.

Which means you have to re-invent own timers using existing simple timer "distributor".