Plugin WinTop=Window.Foreground()
Plugin RectTop=Window.GetClientRect(WinTop)
TempArray=Split(RectTop,"|")
x1=CInt(TempArray(0)):y1=CInt(TempArray(1))
x=700:y=200
//移动距离
stepx=40
//精确度
accuracy=3
Rem start
a1=x1:b1=y1:a2=x1:b2=y1:a3=x1:b3=y1
Delay 20
//点到NPC身上鼠标型状
Rem 标2
If a2=-1 and b2=-1
    Goto 标3
EndIf 
VBSCall FindColor(a2+1,b2,800+x1,600+y1,"f0dc48",a2,b2)
IfColor a2+1,b2,f0dc48,0
    gx=a2:gy=b2
Else 
    Goto 标2
EndIf 
Goto 计算
//点到宝箱上鼠标型状
Rem 标3
If a3=-1 and b3=-1
    Goto 标1
EndIf 
VBSCall FindColor(a3+1,b3,800+x1,600+y1,"b88018",a3,b3)
IfColor a3+1,b3,b88018,0
    gx=a3:gy=b3
Else 
    Goto 标3
EndIf 
Goto 计算
//正常鼠标型状
Rem 标1
If a1=-1 and b1=-1
    Goto start
EndIf 
VBSCall FindColor(a1+1,b1,800+x1,600+y1,"98f8f0",a1,b1)
IfColor a1+1,b1,98f8f0,0
    IfColor a1+2,b1,a8f8f0,0
        gx=a1:gy=b1
    Else 
        Goto 标1
    EndIf 
Else 
    Goto 标1
EndIf 
Delay 8
Rem 计算
//得到目标坐标与当前鼠标的差值
tpx=x-gx
tpy=y-gy
//得到目标坐标与当前鼠标的差值(绝对值)
tpax=Abs(x-gx)
tpay=Abs(y-gy)
//算出X坐标的差值除以移动距离的等份
dengfen=tpax/stepx
//算出X坐标的差值每等份的值
ydengfenzhi=tpay/dengfen
If ydengfenzhi>100
    ydengfenzhi=100
EndIf 
//当X或Y的差值大于20作相对移动
If tpax>20 or tpay>20
    If tpx>stepx
        tpx=stepx
    EndIf 
    If tpx<-stepx
        tpx=-stepx
    EndIf 
    //以X的差值等份值算出Y移动距离作相对移动
    If tpy>ydengfenzhi
        tpy=ydengfenzhi
    EndIf 
    If tpy<-ydengfenzhi
        tpy=-ydengfenzhi
    EndIf 
    MoveR tpx,tpy
    Delay 50
    Goto start
EndIf 
//差值小于精度值就直接结束子程序.不作处理
If tpax<=accuracy and tpay<=accuracy
    //差值较小时.作相对微移
Else 
    If tpx>1
        tpx=1
    EndIf 
    If tpx<-1
        tpx=-1
    EndIf 
    If tpy>1
        tpy=1
    EndIf 
    If tpy<-1
        tpy=-1