You may be looking for MechaGunman, the original Japanese counterpart to this character from Dimensional Warrior Spielban.
Gunslinger is a rifle-toting Cowboy robot Grimlord himself recommends after his Skugs kidnap Kaitlin's cousin Betsy. In his first appearance he speaks like Clint Eastwood combined with stereotypical cowboy language such as "Howdy, pardner", "varmint", and "draw." He wears a brown overcoat and hat, which he dramatically throws off at the start of his battle against JB (His hat explodes on the ground after throwing it), which fails to impress the Trooper. He and JB then have a showdown, but Gunslinger has a force-field to deflect JB's attacks. During the battle, one of Gunslinger's bullets creates a hole in the ground, which JB uses as a trench to surprise Gunslinger before he can activate his shield, then replacing his gun temporarily with a sword.
When Kaitlin comes to JB's aid, she is severely wounded by his machine gun fire, and is unable to continue the fight. As she pleads for JB to destroy the robot for her, JB goes berserk over Gunslinger wounding her and delivers a supercharged flying kick that sends Gunslinger flying after his attempts to shoot JB in midair failed; Gunslinger's shield shorts out from the attack. JB then makes an unusually aggressive impaling attack while Gunslinger is busy having a tantrum over his lost shield. Despite this, Gunslinger doesn't surrender, but continues his raging, apparently trying to reactivate his shield. JB then finishes Gunslinger off permanently with the "Laser Lance" command (surprisingly Gunslinger appears to still be more angry over his lost shield than actual defeat as he continues his tantrum before falling over and exploding). Gunslinger fits the category of General Ivar's Machine Men army.