In The Adventures of Huckleberry Finn, what happens between Pap getting drunk and the judge inviting him to dinner?
I think your question is slightly confused. Pap actually spends most of his time in the story drunk or otherwise under the influence of alcohol, apart from the time when he apparently is reformed by the well-meaning but incredibly naive Judge who tries to correct his alcoholism. It is Chapter Five that these events occur, and you might want to re-read it to remember what happens precisely.
What happens between Pap's first drunken scene in the novel and the new judge's attempts to reform him is that "the judge and the widow" try to legaly remove Huck from pap by going to the court. They ask for one of them to be his guardian. Note the new judge's response to this plea:
...but it was a new judge that had just come, and he didn't know the old man; so he said courts mustn't interfere and separate families if they could help it; said he'd druther not take a child away from its father.
Thus Judge Thatcher is foiled in his attempts to save Huck, much to the delight of Pap, who sees this as a personal victory and forces Huck to get some more money for him which he spends on getting drunk.