Hi @5010, welcome to the forum!
I can’t see any errors as such in your code. Do you just need help with tactics?
If so, I would recommend not attacking the sand yaks. At the moment your hero attacks if the enemy is closer than thirty meters, or if it’s not a sand yak. This means you’ll attack sand yaks which are closer than thirty meters. Why not use and (&&)?
Apart from that, I’m not exactly sure what to recommend without knowing your equipment. Do you have emperor’s gloves? If not, I recommend buying them, they’re great for killing quite a lot of scouts and fangriders.