zc,zw UserVar zc=1 种植早/晚产作物(早1 晚2) UserVar zw=1 作物顺序 Plugin ck=Window.Foreground() //得到当前窗口句柄 Plugin Window.Move(ck,0,0) //把窗口移动到坐标 0,0 Delay 50 Rem 开始 Gosub 定位草人 Delay 500 MoveTo 95 209+26*zc //种早产作物 LeftClick 1 Delay 100 LeftClick 1 Delay 1000 MoveTo 85 159+26*zw //选作物 LeftClick 1 Delay 100 LeftClick 1 Delay 1000 KeyPress 27,1 //关作物窗口 If zc=1 Delay 1000*300 Else Delay 1000*60*60 EndIf Rem 成熟 VBSCall color1=GetPixelColor(665,610) //成熟,图标闪动 Delay 200 VBSCall color2=GetPixelColor(665,610) Delay 200 If color1=color2 Goto 成熟 EndIf MoveTo x y Delay 50 LeftClick 1 Delay 50 Gosub 收割 Goto 开始 Sub 定位草人 Rem 找草 Shape1=302826352 x0=400:y0=300 //设置递增半径 rr=20 //设置点间距 l=20 //初始化角度 n=0 //设置第一圈半径 r=8 //设置画圆圈数 For 8 While n<3.1415926*2 //画圆公式 x=x0+r*cos(n) y=y0-r*sin(n) MoveTo x y Delay 50 VBSCall Shape=GetCursorShape(0) If shape=shape1 Goto tiao EndIf Delay 10 //l/r:点距除以半径,取得2点间相对圆心的角度 //能有效控制扫描点的密度,2点间的距离就比较平均 n=n+l/r EndWhile //画完一圈后重置角度 n=0 //画完一圈后半径递增rr r=r+rr EndFor Goto 找草 Rem tiao MoveTo x y //点击打开草人 Delay 256 LeftDown 1 Delay 500 LeftUp 1 Delay 500 IfColor 256 256 101821 2 Delay 50 Else Goto 找草 EndIf Return 定位草人 Sub 收割 Shape2=1869203251 // shape3=130767900 For 4 Rem 找作物 x0=400:y0=300 //设置递增半径 rr=20 //设置点间距 l=20 //初始化角度