Some dude in Florida has built a working, autonomous sentry gun. The site includes prior prototypes as well as a video demo of the latest iteration. This one shoots paintballs, but the design is clearly intended to be flexible; he notes that the system will work with any gun with a pistol grip.
Paintballs, though, would be plenty to discourage nocturnal patio incursions. Mmmmm.