>>12027666easy as fuck if you just want it to shoot anything that moves, you could probably put something together with maybe an arduino and $100 of parts
if you want it to reliably discriminate targets and not shoot you when you forget it's on and walk in front of it, then it gets a lot harder