This was Konstantinos X of the Empire.*
Clubfooted, arbitrary, gluttonous, lustful, and zealous, he was not what you would consider the best of Emperors. In fact, after rising to rule the empire, he had succeeded mostly in crippling the military and losing land. By the time the Seljuks invaded, things were bad.
Even fools see sense sometimes. Konstantinos began saving money to begin rebuilding the army. He worked to convince the court to raise taxes on cities.
And he raised the levies of the Empire. When most of the army had gather in Teluch, skilled commanders were set in charge, and the army moved to seize Seljuk lands. Christians, even heretic ones, would be freed of their heathen overlords for a time.
This angered Sultan Arp Aslan I, who stopped besieging christian lands, and instead marched to stop the Empire’s army.
This did not work out well for him.
As more Christians were freed from the heathen yoke, the Seljuks brought in reinforcements. The Roman army was outnumbered so Konstantinos, who had learned to be honest (even to himself), hired some mercenaries to round out the Roman army.
The combined Roman forces attacked the combined Seljuk forces.
And bested them.
Holdings were recaptured, and the fleeing army was pursued. And after several months, it was completely destroyed.
And soon thereafter, the Seljuks agreed to peace.
*“Just the Empire. It’s understandable. There’s no need for elaborate names when there’s only one game in town.” - Avernum II