I'm trying to write a script that makes an "Ally" follow Link directly behind his back, and when there are enemies around, it chases after enemy1, then after enemy1 is dead, it goes onto enemy2, and so on. If link kills enemy2 before the ally kills enemy1, it just goes on to enemy 3. I have the script that makes the ally follow Link...

Code:
WAIT WAITFRAME
 COMPAREV LINKDIR,0
 GOTOTRUE DOWN
 COMPAREV LINKDIR,1
 GOTOTRUE UP
 COMPAREV LINKDIR,2
 GOTOTRUE LEFT
 COMPAREV LINKDIR,3
 GOTOTRUE RIGHT
 GOTO WAIT
DOWN SETR d4,LINKY
 ADDV d4,16
 SETR y,d4
 SETR x,LINKX
 SETR DATA,d0
 GOTO WAIT
UP SETR d4,LINKY
 SUBV d4,16
 SETR y,d4
 SETR x,LINKX
 SETR DATA,d1
 GOTO WAIT
LEFT SETR d4,LINKX
 ADDV d4,16
 SETR x,d4
 SETR y,LINKY
 SETR DATA,d2
 GOTO WAIT
RIGHT SETR d4,LINKX
 SUBV d4,16
 SETR x,d4
 SETR y,LINKY
 SETR DATA,d3
 GOTO WAIT
But I have no idea how to log the positions of enemies, or damage an enemy. Can I get some help on this?