//************************定义全局变量******************************
dim location,findcolor,onex,oney,twox,twoy,threex,threey,onebx,oneby
dim ax,ay,bx,by,cx,cy,abx,aby,treex,treey,i,pathtree,delaytime
dim fontcolor,yewtree,roadcolor
//****************定义第2区使用的变量***********
dim sonex,soney,stwox,stwoy,sthreex,sthreey,secondflag
dim spathcolor,syewtree,sroadcolor,slocation
dim onetreen,twotreen,threetreen,onebtreen
//****************初始化所以有查找标志位**************************
onetreen=0
twotreen=0
threetreen=0
onebtreen=0
//*********************初始化变量***************************
yewtree="087900"
roadcolor="6b7173"
location=0
pathtree="000000"
slocation=0
delaytime=100
secondflag=0
syewtree="008a00"
//******************脚本自动执行1000次*****************************************
While i<1000
    i=i+1
    Gosub main
EndWhile 
EndScript 
//***********************************主程序开始*****************************
Sub main
    Gosub onetree
    Gosub findtheonetree
    Gosub cutingone
    Gosub cutingsecondonetree
    Gosub finditem
    Gosub sfinditem
    If location=1
        Gosub checkone
        Gosub gohome
    EndIf 
    If slocation=1
        Gosub checksecondone
        Gosub gohome
    EndIf 
    Gosub twotree
    Gosub findtheSecondtree
    Gosub threetree
    Gosub onetreeb
Return 
//********第一棵树a,找树**************
Sub onetree
    VBSCall FindColorEx(764,252,800,282,yewtree,1,0.9,onex,oney)
    If onex>0 and oney>0
        Delay delaytime
        MoveTo onex,oney
        Delay 500
        LeftClick 1
        Delay 100
    Else 
    EndIf 
Return 
//**************a移动到回城点*******
Sub checkone
    VBSCall FindColorEx(798,219,823,242,pathtree,1,0.9,x,y)
    If x>0 and y>0
        Delay 500
        MoveTo x,y
        Delay 500
        LeftClick 1
        Delay 10000
        Gosub gohome
    Else 
    EndIf 
Return 
//********************查找第一棵树b**************
Sub onetreeb
    VBSCall FindColorEx(824,246,856,270,yewtree,1,0.9,onebx,oneby)
    If onebx>0 and oneby>0
        Delay 500
        MoveTo onebx,oneby
        Delay 500
        LeftClick 1
        Gosub findtwotree
        Gosub cutingoneb
        Rem oneb
        If location=1
            Delay 100
            Gosub checkoneb
            Gosub gohome
        EndIf 
    Else 
    EndIf 
Return 
//**************ab移动到回城点********************************
Sub checkoneb
    VBSCall FindColorEx(796,221,829,251,pathtree,1,0.8,x,y)
    If x>0 and y>0
        Delay 500
        MoveTo x,y
        Delay 500