Apparently it is possible to script Starcraft using a C++ API.
http://eis.ucsc.edu/StarCraftAICompetition#GettingStarted
http://www.broodwarai.com/forums/index.php?showtopic=322 http://code.google.com/p/bwapi/