What ond said. Any form of captcha would stop 99% of bots, cause most people are lazy and don't wanna bother making their own bot scripts, and instead just download premade ones.
Other than that, you would either have to make a table (or even just a file) to store recent account creations and IP's and reject based on that, or simply have the site write the IP of the creator into the "lastIP" field (assuming that's still a thing), and then on creation you just compare if the current IP of the would-be creator exists in any field, and block it if it finds something.