if you reach base on an error is it an at bat
Error (baseball) An error does not count as a hit but still counts as an at bat for the batter unless, in the scorer's judgment, the batter would have reached first base safely but one or more of the additional base(s) reached was the result of the fielder's mistake. In that case, the play will be scored both as a hit (for the number of bases the fielders should have limited the batter to) and an error. However, if a batter is judged to have reached base solely because of a fielder's mistake, it is scored as a "hit on error," and treated the same as if the batter had been put out, hence lowering his batting average.
Walk-off home run In baseball, a walk-off home run is a home run that ends the game. It must be a home run that gives the home team the lead (and consequently, the win) in the bottom of the final inning of the game. Thus the losing team (the visiting team) must then "walk off" the field immediately afterward, rather than finishing the inning. The winning runs must still be counted at home plate. This scenario can only occur if the visiting team is tied or leading after the top half of the inning.