Numbers 23:1-12 Balaam instructed Balak to build 7 altars to sacrifice 7 bulls and 7 rams on each altar. Balaam told Balak to stand by the offering while he went to see if the Lord would speak to him. The Lord instructed Balaam to tell Balak that He will not curse a people that He has already blessed. Balak was not happy that Balaam did not curse Israel, but Balaam said he could do only what the Lord instructed him to do.
Numbers 23:13-24 Balak took Balaam to Zophim where he hoped Balaam would curse the children of Israel. Balak again built 7 altars and offered a bull and ram on each altar. Balaam inquired of the Lord, and the Lord instructed Balaam to tell Balak that the Lord does not change His mind of what He intends for Israel. The Lord is on the side of Israel as their king. Israel will conquer.
Numbers 23:25-30 Balak told Balaam to neither curse nor bless Israel. Balak tried to convince Balaam to go to another location and try again. This time, they went to the top of Peor which overlooks the desert. Balaam again instructed Balak to build 7 altars and sacrifice 7 bulls and 7 rams on each altar, and Balak did so.