Thief Script(this one is somewhat simpler, but it is just an example)
IF
HPPercentLT(Myself,50)
THEN
RESPONSE #100
Help()
END
IF
Delay(30)
THEN
RESPONSE #100
Hide()
END
IF
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END