MessageBox "请将鼠标移至左下坐标后按2键保存坐标"
Rem 等待1
an1 = GetLastKey()
If an1 = 50 Then 
	
        else
Goto 等待1
End If
GetCursorPos xa, ya
MessageBox "请将鼠标移至右上坐标后按2键保存坐标"
Rem 等待2
an1 = GetLastKey()
If an1 = 50 Then 
	
        else
Goto 等待2
End If
GetCursorPos xb, yb
Rem 重复循环
UserVar l=30 "扫描密度"
UserVar z=100 "查找范围"
UserVar se="38FFFF" "色值"
x0=xa:y0=ya:x1=xb:y1=yb:x=x0:y=y0:z=100
KeyPress "1", 1
Delay 500
        While y>y1
    shubiao = GetCursorShape(0)
        If shubiao = 1053591638 Then
    Goto 找到目标
        End If
        If x>x1
        x = x0
        y = y - l
        else
        x = x + l
        y = y
        End If
        MoveTo x,y
        Delay 10
    Wend
Goto 重复循环
    Rem 找到目标
    MoveTo 1800, 60
t1=plugin.sys.gettime()  //这个命令可以简单的理解为,得到当前时间,精确到毫秒(其实真正的不是这个意思,但是这样理解对使用也没错)
do
    FindColorEx x-z,y-z,x+z,y+z, "38FFFF" ,1,0.8,seX,seY
If seX > 0 And seY > 0 Then
MoveTo seX - 10, seY + 10
        RightClick 1
        RightClick 1
        Delay 200
        LeftClick 1
        Delay 200
        LeftClick 1
        Delay 1000
        Goto 重复循环
End If
t2=plugin.sys.gettime()  //t2是之后得到的时间,肯定比t1大
if t2-t1>19000  then       //t2-t1就是后面大时间减前面小时间,,如果大于5000毫秒,就是5秒,就要退出循环了
        Goto 结束
end if
loop
Rem 结束
Goto 重复循环