This mod takes 'dorfl' https://mods.factorio.com/mod/logiquipment mod and extends it to include the cargo wagon entity, for those of us who want construction trains.
If the current fuel is requested in a slot, fuel tank will be filled up first.
Is it possible to do the same for weapon ammo?
Currently it does neither refill from the inventory nor when it is set as filtered directly in the ammo slot.
I will investigate .. I know that currently, I am unable to query the gun's a Spiderton has via LUA code, this is getting fixed when they release the next version.
The best I can probably do is look at what ammo inventory slots exist, and check if they have a filter applied or not. If there is a filter and the ammo is available in the main inventory move the items between locations.