HK knew he recieved a holo message but didn't want to view it of course. The jedi was somewhere in the same cave.
"I will kill him first whatever that message is"- HK thought.
He suddenly heard a lightsaber activating behind his back. HK couldn't dodge it and the jedi cut off his already damaged leg. But now he knew where the jedi was. With the reflexes of a machine he aimed and shot. Then again shot to be sure. He even poisoned the area as he couldn't see anything at all. HK switched his photoreceptors on. The jedi was dead.
"Proud Statement: Mission accomplished. Now let's take a look at that message."
“HK, Arrive to Korriban, take a ship from our base on Foerost and come to Korriban for new duties”-
"Analysis: My chassis and leg has suffered major damage. Somehow I must ge to my ship.........or any other ship."
"Statement: I can't move now. I think I will upgrade my sniper rifle with the components of this lightsaber."
Then HK started to observe the parts and tried to use them in some way. Minutes and hours passed. HK successfully upgraded his rifle and also managed to fix his leg a little bit.
"Statement: I think I will be able to walk. I should be on my way to Korriban."
HK made it to his ship, and he was on his way to Korriban.
"I've barely eaten anything for many decades now. It feels like my stomach shriveled into my back........though i don't have a stomach or back because i'm a skeleton! Yohohohoho! SKULL JOKE!"
"My eyes have never seen such a pretty woman! But i'm a skeleton so my eyes don't see much."