The unwavering patience with Rickie Weeks finally paid off for the Milwaukee Brewers on Tuesday night.

The slumping second baseman racked up three hits, including a huge three-run home run to right-center in the eighth for some insurance in what would be a 12-8 win over the Pittsburgh Pirates.

It was the first multi-hit game since April 3 for Weeks, who also singled, doubled and walked in raising his average from .167 to .191. He also drove in five runs, one more than his total for coming into the game.

"He's had some better at-bats lately," manager Ron Roenicke said. "I think he's been swinging the bat a little better, and today everything worked. When he's driving the ball out opposite field like that, that's really good."

The Brewers, meanwhile, won their eighth consecutive home game and ninth straight against the Pirates dating to last season.

Weeks was one of many offensive stars on both sides in a game that featured 29 hits and seven home runs. The roof was open at Miller Park for the first time with the game-time temperature a balmy 81 degrees, and pitchers paid the price.

"Balls flew today," said Roenicke. "I think the hot weather, the roof being open, balls flew."

After bashing a season-high five homers on Monday, the Brewers used the long ball to decide this one as well as all three of theirs came in the sixth inning or later.

Jean Segura was the first to strike, hitting a solo shot to right-center off Vin Mazzaro to lead off the sixth and tie the game at 8-8. It was the second homer in as many nights for Segura, who was on base four times after walking twice and being hit by a pitch.

In the seventh, it was Yuniesky Betancourt's turn. He went deep to right off Bryan Morris to put the Brewers ahead, 9-8. It was the sixth homer and 21st run batted in for the utility man, which tied him for the team lead in RBI with Ryan Braun.

John Axford pitched a scoreless eighth. Weeks' big blow came against Tony Watson and after Braun singled and Jonathan Lucroy walked. It was his first long ball since that April 3 game, and culminated a day where he reported to the ballpark early for extra work on his swing.

"He called (hitting coach) Johnny (Narron) and wanted to come early today and work on some things," Roenicke said of Weeks, who came in 7 for his last 72. "I don't know exactly what it was, but it was a really good day for him."