To elaborate on @M'vy's answer, you would essentially want the mods Applied Energistics and RedPower 2 in order to do this, as well as a mod that produces energy, such as BuildCraft 3 or IndustrialCraft 2.
You would want to find some AE Quartz and Quartz Dust in the world, and use that to make an ME Controller. This, when powered by EUs and/or MJs from another mod of your choice, is what controls your entire system. Never let this run out of power. Now you're going to craft either three Deep Storage Units or three barrels. Make three ME Storage Busses, and connect the Storage Busses to the controller using ME Cable. Fill the DSUs or barrels with sand and gunpowder. Fill the other one with some premade TNT as a placeholder.Now you want to get into the automatic crafting. Basically, you will set up a system where an ME Level Emitter redirects back into the system. Set it so that there is always a stack of TNT blocks in your system. Make an Assembler Chamber and connect it to your ME System with more ME Cable. Have some ME Export Busses connected to some deployers and a timer set to whatever time it should deploy TNT. Make sure all your Applied Energistics stuff is connected by ME Cable.
Note that you need a way of making sand and gunpowder, this will not get the ingredients for you, it simply autocrafts and deploys.