i think i got it
if anyone would like to test or look at this for errors that be great.
it should set closest enemy , set pet location , attack target , then check to see if pet has moved, if pet doesnt move attack target again
  set %monstertype ZC_WE_IJB_ID_Q_V_UD_ED_RI_SI_EJ_QD_BE_WE_R_S_VI_FD_
set %petid WZXQ
set %scanpk
 
 
for %searchDistance 1 10
{
  finditem %monstertype G_ , %searchdistance
  if #findcnt > 0
   {
    set %targetkill #ltargetid
    event sysmessage monster set
    finditem %petid G_ , %searchdistance
     if #findcnt > 0
      {
       event sysmessage pet distance is at #finddist
       set %petdist1 #finddist
       killloop:
       set #ltargetid %targetkill
       msg all kill$
       wait 10
       target
       event macro 22 0
       wait 10
        {
         finditem %petid G_ , %searchdistance
            if #finddist <> %petdist1
             {
              event sysmessage MOVED
              halt
            if #finddist = %petdist1
              {
               event sysmessage STAYED
               goto killloop
               }
              }
             }
            }
           }
   if #findcnt = 0
     event sysmessage NO MOB
     wait 30
     return