Dim hwnd,fx,myhnd,mx,my,i,theDate,pplai,ppkai,yi,paox,paoy,paox2,paoy2,n
Dim mypaox(8),mypaoy(8) //保存有炮的坐标
DimEnv wx,wy
BeginThread mywindow
theDate=Now
Delay 2200
pplai=0
ppkai=0
For i=0 to 7
mypaox(i)=1
next
//初始化大炮坐标
i=0
Do While true
//找阳光
Call FindPic(wx,wy+100,wx+800,wy+600,"2.bmp",0.6,px,py)
//找炮,分二个区找炮,加快速度
Call FindPic(wx,wy,wx+550,wy+240,"5.bmp",0.45,paox,paoy)
Call FindPic(wx,wy+240,wx+550,wy+550,"5.bmp",0.45,paox2,paoy2)
//第一个区的炮
If paox>0 and paoy>0 then
kefang=0
//不要收重复的炮
For n=0 to 7
If mypaox(n)>paox-10 and mypaox(n)<paox+10 and mypaoy(n)>paoy-10 and mypaoy(n)<paoy+10 then kefang=1
Next
If kefang=0 then
mypaox(pplai)=paox
mypaoy(pplai)=paoy
pplai=pplai+1
If pplai>7 then pplai=0
End if
End if
//If GetLastKey = 65 then MsgBox mypaox(0) & "a " & mypaox(1) & "b " & mypaox(2) & "c " & mypaox(3) & "d " & mypaox(4) & "e " & mypaox(5) & "f " & mypaox(6) & "g " & mypaox(7)
//如果手动点过炮,要按B清一下数组的数据,找过一次炮,可以不要,要了当然更好
If GetLastKey = 66 then
For i=0 to 7
mypaox(i)=1
next
End if
// //第二个区的炮
If paox2>0 and paoy2>0 then
paox=paox2
paoy=paoy2
kefang=0
//不要收重复的炮
For n=0 to 7
If mypaox(n)>paox-10 and mypaox(n)<paox+10 and mypaoy(n)>paoy-10 and mypaoy(n)<paoy+10 then
kefang=1
End if
Next
If kefang=0 then
mypaox(pplai)=paox
mypaoy(pplai)=paoy
pplai=pplai+1
If pplai>7 then pplai=0
End if
End if
//找炮结束
mym=GetLastClick()
//阳光收集点坐标
If mym=32774 or mym=32773 then
mtox=wx+400
mtoy=wy+200
MoveTo mtox,mtoy
End if
// //中键滑动 开炮标志
// If mym=32781 then
// kp=kp+1
//
// End if
caodix=wx+720
caodiy=wy+157
caodiy2=wy+490
MoveTo caodix,caodiy2
MsgBox wy & "dd"& wx
//Call FindColorEx(caodix,caodiy,wx+720,wy+162,"1DE026",0,0.9,x,y)
//Call FindColorEx(caodix,caodiy2,wx+720,wy+597,"1DE026",0,0.9,x2,y2)
//kaipao=0
caos1=GetPixelColor(caodix,caodiy)
caos2=GetPixelColor(caodix,caodiy2)
//MsgBox caos1
If caos1<>"65EC4A" or caos2<>"16DE1B" Then
kaipao=1
Else
kaipao=0
End If
//开炮条件
Call GetCursorPos(mx,my)
mytime=DateDiff("s", theDate,Now)