There are three buildings in case you couldn't see. One of them will do a completely random path each time. One of them will run the movements that the building that made it the farthest last time did. And one will do a variation of the last farthest one. The purpose for the random one is so if the best route is bad the random one will eventually get a better one. Eventually all three buildings will reappear. The way that works is there is a variable that increases by one whenever a building dies, goes to the next level, or does 20 actions (different movements). When it equals three they will reset. Also if none of them seem to be doing the highest over and over it's because the start gets a little offset. If anyone has any ideas on how to fix this please comment that.
If you see a problem in anything, please don't just ignore it, tell me. I am releasing this without a lot of testing but I think it is done. Comment any recommendations you feel would make this better. Credit to @xerno9 for the idea of using lists. And again, I don't know if this is technically AI but that's what I'm calling it.