since your if statements have one command only after them, you could do: Sub Main /declare Dist int outer ${Target.Distance} :Check /varset Dist ${Target.Distance} | <have to get new value inside the loop /if (${Dist}<=30) /gsay Target is in range /if (${Dist}>30) /gsay Target out of range /return N...