Get close by building bricks in front of yourself and undoing them and moving again until you're within range and then trap the enemy bot by spawning a floating brick inside of it then trap it until it cannot shoot you and then undo your cover and shoot at it.
Alternatively, just get close and trap them. There's no way you can get proper gun-leading scripts in, at least, no one who can will bother.