Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Feb 15, 2007 2:38 am |
Hmm... how about something like this? I'm assuming that you keep your current target in a variable, @Target.
#alias scan {~scan;#t+ ScanDetect;#t+ TargetDetect;#alarm +0.5 {#t- ScanDetect;#t- TargetDetect}}
#trig "ScanDetect" {~[(%w)~]} {#var CurrentDir %1}
#trig "TargetDetect" {@Target} {#exec @CurrentDir}
You may need to adjust the time of the alarm depending on how much lag you get. At the moment it's 0.5 seconds.
What this does, when you type "scan", is activate the two triggers. The first matches the direction in the square brackets and saves it - the second matches the name of your target and moves in whichever direction was detected just before your target's name. |
|