For the most part, TASes are "played" -- that is, the TASer is telling the program directly which buttons to press at any given time; however, they're played very methodically, one frame at a time, with frequent backing up to try different strategies. Other programs often come in handy, but they usually aren't generating game input. For example, you could have RAM watch running to tell you exactly how fast your character's moving, exactly where they are, exactly how many more frames until their weapon is charged, et cetera.
The most program-heavy runs are the ones where massive RNG manipulation is needed. For example, in Shining Force, DarkKobold wrote a set of MatLab functions that would generate the inputs needed to obtain a given order of battle from the RNG in the minimal number of frames. His
writeup has some details.