EOC is pretty easy. You have several methods that are all valid.
Simba Code:
InFight;//Returns true if in a fight, located in {$i SRL/SRL/Skill/Fighting.Simba}
or you can check the combat tab if your target has a health bar by counting the color green in that slot (that's what I do).
or you can check the combat tab for a target name (lasts slightly longer than the fight occasionally)
Simba Code:
if(pos('Target',GetTextAtExWrap(595, 220, 660, 230, 0, 50, 10, 3111603, 10, 'UpChars')) = 0)then//'NoTarget' is shown when there is no target.