Battle map generation

ok i have seen some API threads about using API & roll tables and such to generate custom map layer with dynamic lighting. however given my rather short knowledge on the subject matter those threads then to make me lose focus. what i would like to do is use a macro or series of them to trigger an API / roll table. that could help me create outdoor and underground style encounter battle maps that i could then drop monster traps and the like in. i am willing to buy marketplace tile packs so long as they are a bit detailed: aka there is some life in them and would prefer ones that align to grid style play as well as support drag and drop adjustment if needed. System is a fantasy setting but if there mulit purpose it would help down the line. in essence i would setup the triggering macro to generate either an outdoor or underground generic battle map. if i have to manually do the lighting layer that is fine if not awesome sauce. so if you're willing to step by step me thru this process i would greatly appreciate it. 
API Scripter
You can sort of do this with the Terrain Generation API. Make your rollable tables with the images you want, and setup the generation by following the instructions, specifing scale, rotation, variation, etc. And example of macro text that generates a random desert battle map with rocks, dunes, cacti, and other assets. !TGSpawnTrees battlemap2 rocks dune1 20 35 5 25 !TGSpawnTrees battlemap2 rocks desertsandy1 15 65 5 25 !TGSpawnTrees battlemap2 rocks rock1,rock2,rock3,rock4,rock5 4.87 25 1.5 25 !TGSpawnTrees battlemap2 trees desertt1 12 65 4 5 !TGFillBG battlemap2 floor desert 110
Link to the script's forum thread:  [Script] Terrain Generator (The script itself is in One-Click Install.)