Heron of Alexandria invented a cheiroballistra, which looks a lot like a big automatic crossbow, back around 100 AD.