|
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\桌面\2007624111228169\Apple系列-水晶按钮篇2\Item Icon.ico
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#Include <PostMessage_UDF.au3>
#Include <Array.au3>
$flag = False
$nums=""
$hWnd1 = ""
$hWnd2 = ""
$hWnd3 = "" 不会自动释放宝宝和自动攻击 请问是那里不对 谢谢
$hWnd4 = ""
$hWnd5 = ""
$hWnd6 = ""
$hWnd7 = ""
$hWnd8 = ""
$hWnd9 = ""
$hWnd10= ""
$hWndS1 = ""
$hWndS2 = ""
$hWndS3 = ""
$hWndS4 = ""
$hWndS5 = ""
$hWndS6 = ""
$hWndS7 = ""
$hWndS8 = ""
$hWndS9 = ""
$hWndS10 = ''
$checksum=""
$total=0
$all=0
$now=0
$ifsmallmap =True
$x1=601
$y1=256
$x2=156
$y2=256
func setWins()
if $hWnd1<>"" Then
$var = WinList("开心")
$tmp=1
For $i = 1 to $var[0][0]
;MsgBox(4096,"",$i)
if $hWndS1==$var[$i][1] or $hWndS10==$var[$i][1] Then
;MsgBox(4096,"", "成功自动识别队长")
else
Switch $tmp
case 1
$hWnd2 = ControlGetHandle($var[$i][1], "", "#327701")
case 2
$hWnd3 = ControlGetHandle($var[$i][1], "", "#327701")
case 3
$hWnd4 = ControlGetHandle($var[$i][1], "", "#327701")
case 4
$hWnd5 = ControlGetHandle($var[$i][1], "", "#327701")
case 5
$hWnd6 = ControlGetHandle($var[$i][1], "", "#327701")
case 6
$hWnd7 = ControlGetHandle($var[$i][1], "", "#327701")
case 7
$hWnd8 = ControlGetHandle($var[$i][1], "", "#327701")
case 8
$hWnd9 = ControlGetHandle($var[$i][1], "", "#327701")
;case 9
;$hWnd10 = ControlGetHandle($var[$i][1], "", "#327701")
;case 10
;$hWnd = ControlGetHandle($var[$i][1], "", "#327701")
EndSwitch
$tmp = $tmp+1
EndIf
next
MsgBox(4096,"", "成功自动识别开心窗口")
Else
MsgBox(4096,"", "先按ctrl+F1/F10记录队长")
EndIf
EndFunc
$hWndS1 = WinGetHandle("开心")
$hWnd1 = ControlGetHandle("开心", "", "#327701")
Func setRuns()
$var = WinList("开心")
$tmp = 1
For $i = 1 to $var[0][0]
;MsgBox(4096,"",$i)
if $hWndS1==$var[$i][1] or $hWndS10==$var[$i][1] Then
;MsgBox(4096,"", "成功自动识别队长")
else
Switch $tmp
case 1
$hWndS2 = $var[$i][1]
case 2
$hWndS3 = $var[$i][1]
case 3
$hWndS4 = $var[$i][1]
case 4
$hWndS5 = $var[$i][1]
case 5
$hWndS6 = $var[$i][1]
case 6
$hWndS7 = $var[$i][1]
case 7
$hWndS8 = $var[$i][1]
case 8
$hWndS9 = $var[$i][1]
;case 9
;$hWnd10 = ControlGetHandle($var[$i][1], "", "#327701")
;case 10
;$hWnd = ControlGetHandle($var[$i][1], "", "#327701")
EndSwitch
$tmp = $tmp+1
EndIf
next
EndFunc
;dim $userView[5]
;$userView[0] = 4
;$userView[1] = 180
;$userView[2] = 215
;$userView[3] = 234
;$userView[4] = 270
;_MouseClick(ControlGetHandle("开心", "", "#327701"),"left",23,$userView[4])
;Exit
;WinActivate($hWndS)
;Send("!z")
HotKeySet("{f11}", "stop")
HotKeySet("^{f12}", "clearWin")
HotKeySet("^{f11}", "setWins")
HotKeySet("!{f11}", "setRuns")
HotKeySet("^{f1}", "getHwin1")
HotKeySet("^{f2}", "getHwin2")
HotKeySet("^{f3}", "getHwin3")
HotKeySet("^{f4}", "getHwin4")
HotKeySet("^{f5}", "getHwin5")
HotKeySet("^{f6}", "getHwin6")
HotKeySet("^{f7}", "getHwin7")
HotKeySet("^{f8}", "getHwin8")
HotKeySet("^{f9}", "getHwin9")
HotKeySet("^{f10}", "getHwin10")
HotKeySet("!{f2}", "setRun2")
HotKeySet("!{f3}", "setRun3")
HotKeySet("!{f4}", "setRun4")
HotKeySet("!{f5}", "setRun5")
HotKeySet("!{f6}", "setRun6")
HotKeySet("!{f7}", "setRun7")
HotKeySet("!{f8}", "setRun8")
HotKeySet("!{f9}", "setRun9")
if StringLen($hWnd1)>0 Then
$flags=MsgBox(4,"是否自动开始","检查到开心OL窗口,是否自动开始脚本,选否可自己按F11启动")
if $flags=6 Then
$var = WinList("开心")
;MsgBox(4096,"", $var[0][0])
if $var[0][0]<6 Then
setWins()
EndIf
stop()
EndIf
EndIf
$flags=MsgBox(4,"是否点击中间","是否点击中间(选否点击小地图)?")
;MsgBox(4096,"", $flags)
if $flags==6 Then
$ifsmallmap = false
$x1=698
$y1=176
$x2=735
$y2=176
EndIf
$runTime=15
$runTime2=55
$runTime3=55
While 1
if $flag Then
lclickWinOther($x1,$y1)
Sleep(920)
lclickWinOther($x2,$y2)
Sleep(1000)
$runTime = $runTime+1
$runTime2 = $runTime2+1
$runTime3 = $runTime3+1
if $runTime>10 Then
$runTime=0
;点击自动战斗
;lclickWin($hWnd,538, 95)
;lclickWin($hWnd,522, 84)
lclickWin($hWnd10,522,84)
lclickWin($hWnd1,522, 84)
lclickWin($hWnd2,522, 84)
lclickWin($hWnd3,522, 84)
lclickWin($hWnd4,522, 84)
lclickWin($hWnd5,522, 84)
lclickWin($hWnd6,522, 84)
lclickWin($hWnd7,522, 84)
lclickWin($hWnd8,522, 84)
lclickWin($hWnd9,522, 84)
EndIf
lclickWinOther(509, 148);释放牢笼
if $runTime3>2 Then
$runTime3=50
;队长点击离开按钮
lclickWinOther(364,322)
lclickWinOther(414, 310)
EndIf
if $runTime2>50 Then
$runTime2=0
;点击离开按钮 但队长不点击
if $hWndS2 <>"" Then
lclickWin($hWnd2,364, 322)
EndIf
if $hWndS3 <>"" Then
lclickWin($hWnd3,364, 322)
EndIf
if $hWndS4 <>"" Then
lclickWin($hWnd4,364, 322)
EndIf
if $hWndS5 <>"" Then
lclickWin($hWnd5,364, 322)
EndIf
if $hWndS6 <>"" Then
lclickWin($hWnd6,364, 322)
EndIf
if $hWndS7 <>"" Then
lclickWin($hWnd7,364, 322)
EndIf
if $hWndS8 <>"" Then
lclickWin($hWnd8,364, 322)
EndIf
if $hWndS9 <>"" Then
lclickWin($hWnd9,364, 322)
EndIf
EndIf
EndIf
WEnd
Func clearWin()
$flags=MsgBox(4,"清楚所有窗口记忆?","清楚所有窗口记忆?")
if $flags=6 Then
;$hWnd=""
;$hWnd1=""
$hWnd2=""
$hWnd3=""
$hWnd4=""
$hWnd5=""
$hWnd6=""
$hWnd7=""
$hWnd8=""
$hWnd9=""
;$hWnd10=""
;$hWndS1 = ""
$hWndS2 = ""
$hWndS3 = ""
$hWndS4 = ""
$hWndS5 = ""
$hWndS6 = ""
$hWndS7 = ""
$hWndS8 = ""
$hWndS9 = ""
$all = 0
EndIf
EndFunc
Func stop()
$flag = Not $flag
if $flag = False then
MsgBox(4096,"", "已经暂停,下次按下F11启动.")
;Else
;WinMove($hWndS, "", 0, 0)
;$checksum = PixelChecksum(5,0, 10,50)
EndIf
EndFunc
func lclickWin($w,$x,$y)
if StringLen($w)>0 Then
_MouseClick($w,"left",$x,$y)
EndIf
EndFunc
func lclickWinOther($x,$y)
if $hWndS1 <>"" Then
lclickWin($hWnd1,$x,$y)
EndIf
if $hWndS2 <>"" Then
lclickWin($hWnd2,$x,$y)
EndIf
if $hWndS3 <>"" Then
lclickWin($hWnd3,$x,$y)
EndIf
if $hWndS4 <>"" Then
lclickWin($hWnd4,$x,$y)
EndIf
if $hWndS5 <>"" Then
lclickWin($hWnd5,$x,$y)
EndIf
if $hWndS6 <>"" Then
lclickWin($hWnd6,$x,$y)
EndIf
if $hWndS7 <>"" Then
lclickWin($hWnd7,$x,$y)
EndIf
if $hWndS8 <>"" Then
lclickWin($hWnd8,$x,$y)
EndIf
if $hWndS9 <>"" Then
lclickWin($hWnd9,$x,$y)
EndIf
;if $hWndS <>"" Then
; lclickWin($hWnd,$x,$y)
;EndIf
if $hWndS10 <>"" Then
lclickWin($hWnd10,$x,$y)
EndIf
EndFunc
func getHwin0()
getHwin(0)
EndFunc
func getHwin1()
getHwin(1)
EndFunc
func getHwin2()
getHwin(2)
EndFunc
func getHwin3()
getHwin(3)
EndFunc
func getHwin4()
getHwin(4)
EndFunc
func getHwin5()
getHwin(5)
EndFunc
func getHwin6()
getHwin(6)
EndFunc
func getHwin7()
getHwin(7)
EndFunc
func getHwin8()
getHwin(8)
EndFunc
func getHwin9()
getHwin(9)
EndFunc
func getHwin10()
getHwin(10)
EndFunc
func setRun1()
setRun(1)
EndFunc
func setRun2()
setRun(2)
EndFunc
func setRun3()
setRun(3)
EndFunc
func setRun4()
setRun(4)
EndFunc
func setRun5()
setRun(5)
EndFunc
func setRun6()
setRun(6)
EndFunc
func setRun7()
setRun(7)
EndFunc
func setRun8()
setRun(8)
EndFunc
func setRun9()
setRun(9)
EndFunc
func getHwin($user)
Switch $user
case 0
$hWndS = WinGetHandle("开心")
$hWnd = ControlGetHandle("开心", "", "#327701")
case 10
$hWndS10 = WinGetHandle("开心")
$hWnd10 = ControlGetHandle("开心", "", "#327701")
case 1
$hWndS1 = WinGetHandle("开心")
$hWnd1 = ControlGetHandle("开心", "", "#327701")
case 2
$hWnd2 = ControlGetHandle("开心", "", "#327701")
case 3
$hWnd3 = ControlGetHandle("开心", "", "#327701")
case 4
$hWnd4 = ControlGetHandle("开心", "", "#327701")
case 5
$hWnd5 = ControlGetHandle("开心", "", "#327701")
case 6
$hWnd6 = ControlGetHandle("开心", "", "#327701")
case 7
$hWnd7 = ControlGetHandle("开心", "", "#327701")
case 8
$hWnd8 = ControlGetHandle("开心", "", "#327701")
case 9
$hWnd9 = ControlGetHandle("开心", "", "#327701")
EndSwitch
EndFunc
func setRun($user)
Switch $user
;case 1
; $hWndS1 = WinGetHandle("开心")
case 2
$hWndS2 = WinGetHandle("开心")
case 3
$hWndS3 = WinGetHandle("开心")
case 4
$hWndS4 = WinGetHandle("开心")
case 5
$hWndS5 = WinGetHandle("开心")
case 6
$hWndS6 = WinGetHandle("开心")
case 7
$hWndS7 = WinGetHandle("开心")
case 8
$hWndS8 = WinGetHandle("开心")
case 9
$hWndS9 = WinGetHandle("开心")
EndSwitch
EndFunc |
|