I tried using the TargetEX(who, time); functions and although they work I have some problems.
It is really easy to get a "nnnn used out-of-sequence target cursor" console error if you double click a target.
Also the function itself seems to be buggy: the second half after the return statment can't run can it?
Code:
function TargetEX(mobile, duration:=0, flags := TGTOPT_CHECK_LOS+TGTOPT_NEUTRAL)
if ( duration > 0 )
if ( CInt(TS_GetTimerDuration(mobile, "TargetControl")) > 0 )
// Existing timer... stop it (itll cancel the old target)
TS_LowerDuration(mobile, "TargetControl", -1);
endif
TS_StartTimer(mobile, "TargetControl", duration);
endif
return Target(mobile, flags);
if ( duration > 0 )
if ( CInt(TS_GetTimerDuration(mobile, "TargetControl")) > 0 )
TS_LowerDuration(mobile, "TargetControl", -1);
endif
endif
return 1;
endfunction
It also appears the program is killed when the timer runs down. Any reason for this? Wouldn't it just be better for the target cursor to cancel and the TargetEX return 0 if it timed out?