Hide, Stealth, Shoot by Dante Alexander Da'hart
Description from the author:
setvar chosen_enemy
while not dead
if not hidden
skill 'hiding'
wait 11000
elseif hidden
warmode 'on'
skill 'stealth'
target chosen_enemy
attack chosen_enemy
warmode 'off'
wait 11000
endif
endwhile
I usually get ids by new macro recording, use a skill that allows you to target an NPC, and stop recording, copy the target and it's variable twice into the script and remove one "target" with Attack.