This looks interesting. If this is for windows, I do have some code for this already. I was developing it for a different game, but the basics are there (mouse clicking, keyboard entry, window detection, screenshotting, color filtering, pixel detection). My programming language is C# however. I haven't played this game, so I'm not sure how the enemies appear. But judging from the youtube videos, I think it's possible to scan for the color red in the upper right hand corner, If it shows up, an enemy has appeared.