Complex sentence: They were elated to hear the good news, but discouraged to learn their journey was in vain, for the ammunition they had collected with the intent of helping the militia capture the "Margaretta" was not needed.
Split into simpler sentences: They were elated to hear of the militia's good fortune, but discouraged to learn their journey was in vain. The ammunition they had collected with the intent of helping the militia capture the Margaretta was not needed.