Alright, I've been at Dwarf Fortress for a while now, and built my share of complex machinery, including magma pumps, power plants, repeaters, etc. Right now though, I'm trying to construct a long retracting bridge at the entrance to my fort, something like this:
O = Wall
7 = Lava Moat, 1 Z-level Below
~ = Bridge
^ = Trap (Explained below)
O777~~~777O
O777~~~777O
O777~~~777O
O777~~~777O
O777~~~777O
O777^^^777O
O777~~~777O
O777~~~777O
O777~~~777O
OO777~~~777O
^~~~~~~777O
^~~~~~~777O
^~~~~~~777O
OOOOOOOOOOO
Enemies enter in the lower left, my entrance is beyond the top. The traps in the lower left are pressure plates, only activated by enemies. The pressure plates cause the bridges to retract. The traps near the center are weapon traps. The bridges are anchored on those squares, so if an enemy happens to be standing there when the bridge retracts, they will either be stabbed to death or dodge into the moat.
Any suggestions on improving the design would be appreciated, but the real question I have is this: is there an efficient way to create a system that would react to the bridges retracting, then reset the signal (and the bridges)? The inherent problem with using the pressure plate is that an "off" signal is sent as soon as the goblin steps off of the switch. If the pressure plate activated another water-clock-like device, it might work. Any suggestions?