key = WaitKey() //输入要从哪组炮开始,从上往下分别对应主键盘上的1~5 If key>48 And key<53 Then //获取游戏窗口坐标 handle= Plugin.Window.Foreground() s = Plugin.Window.GetClientRect(handle) MyArray = Split(s, "|", -1, 1) wx = int(MyArray(0)) wy = int(MyArray(1)) //获取结束 cannon=key-49 //轮到使用哪组炮 even=1 //是否偶数Flag
Call choosecard //进入选卡程序
Rem goon //发炮标记
While 1 Call whichtoshoot //选择可用炮发射 Delay 700 //发炮完后收集阳光 Call FindColorEx(wx,wy+80,wx+800,wy+600,"01F6FE",2,1,intx,inty) If intx>0 and inty>0 Then SaveMousePos MoveTo intx,inty LeftClick 1 RightClick 1 RestoreMousePos End if for 12 Delay 500 warning=GetPixelColor(wx+174,wy+320) //判断红字 If warning="0000FF" Then even=1-even If even Then Call ice //如果是偶数Flag,进入冰消子程序 Else Delay 7500 Goto goon //如果是奇数Flag,等待一段时间 End If End if Next Wend End If
Sub shoot(a,b) //发炮子程序 MoveTo wx+487,wy+a LeftClick 1 Call GetCursorPos(x,y) For 3 color=GetPixelColor(x+10,y) If color<>"1200FF" Then //点击炮后检测是否变红,没变红就继续点 LeftClick 1 End if Next MoveTo wx+682,wy+383 LeftClick 1
MoveTo wx+80,wy+b LeftClick 1 Call GetCursorPos(x,y) For 3 color=GetPixelColor(x+10,y) If color<>"1200FF" Then LeftClick 1 End if Next MoveTo wx+694,wy+208 LeftClick 1
End Sub Sub whichtoshoot //选择可用炮发射 If cannon=0 Then Call shoot(89,195) End if
If cannon=1 Then Call shoot(178,284) End if
If cannon=2 Then Call shoot(255,361) End if
If cannon=3 Then Call shoot(341,447) End if
If cannon=4 Then Call shoot(428,530) End if cannon=(cannon+1) Mod 5
While 1 Call whichtoshoot For 12 Delay 500 shadow=GetPixelColor(wx+26,wy+382) //如果中间出现暗条(Flag结束提示条)就等待一段时间然后进入选卡 If shadow="0F1B46" Then Delay 12000 Call choosecard End if Next Delay 700 Wend End Sub Sub choosecard //选卡子程序 Rem chooseagain //重选标记