I don't know where the batteries are. If I did, a .308 should be enough to handle them. Lacking that knowledge I request a 12ga shotgun. I'll take my chance to punch as many holes in it as possible and hope to hit something important.
I saw a video from the mid 1990s of a gun that could visually track a dozen or so individual bullets from a machine gun and in less than a second, shoot at the origin of the fire. It was an fully autonomous anti-sniper sniper. Strangely enough, I can no longer find that video on YT.
It made me think that if we could do that now, what is the deal with the robots from the movies? What's with Cylons from Battlestar Galactica or the Terminator? If a robot was capable of targeting an object or person and firing at that target, the robot would never miss! This makes me think that we would have very little chance against a combat robot hellbent on destroying all humans. It will most likely see us long before we see it and the robot would undoubtedly be a much better shot.
I say nuke'em from space. It's the only way to be sure. It's either that or negotiate a comfortable human cage in the robot zoo.
If it's in a hominid form, the ones you see in most videos, I'd go with the Garand and black tip AP or the stash of API. Worked well against aircraft in WWII. Use a modified Mozambique drill, sternum then just above the 'belly button" to get the processor or trunk line, then nose area to try and disable visual processors. Unlike us, the 'brains' are likely in the torso, larger and better shielded than a human head.