#include <WinAPI.au3>
;;;;;;;;;
Opt("TrayIconDebug", 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;文件头;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Opt("SendKeyDelay", 150)
Opt("SendKeyDownDelay", 35)
Opt("MouseClickDelay", 20)
$g_szVersion = "ZXXX"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
$depth = @DesktopDepth
$width = @DesktopWidth
Dim $x_colorex, $y_colorex, $pos[2], $Paused, $win[10], $z[10], $fb, $map1x, $map1y
$i = 0
$jj = 0
Dim $npc_obj[7], $array_npc[9]
For $for = 0 To 5 Step 1
$npc_obj[$for] = 0
Next
If $depth <> 16 Then ;增强16位色
MsgBox(0, "", "不是16位色程序终止,请设置好后重新启动电脑!!!")
Exit 0
EndIf
If $width = 1280 Then ;;1280x1024
$pos[0] = 240
$pos[1] = 210
ElseIf $width = 1440 Then;;1440x900
$pos[0] = 320
$pos[1] = 148
EndIf
HotKeySet("{home}", "test")
HotKeySet("{F9}", "hx")
HotKeySet("{F10}", "sjfb")
HotKeySet("{F11}", "sj")
HotKeySet("{end}", "quit");终止全部脚本
HotKeySet("{pause}", "Togglepause");;暂停
While 1
Sleep(100)
TrayTip("", "F11=打怪 ,F10=副本,F9=换线 ", 1, 4)
;~ hoton()
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;测试区;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func test()
EndFunc ;==>test
Func xxxx()
findcolorex($pos[0],$pos[1],$pos[0]+800,$pos[1]+600,0x009E4A,0,"1\0\0x00B65A\0,6\0\0xF7EFE7\0");;非当前线路
EndFunc ;==>xxxx
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func sjfb()
While 1
sjmapon() ;;开地图
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xBD9A94, 0, "237\-102\0xDE5942\0,97\-170\0xC6A27B\0,214\-53\0xDE594A\0") ;;;FB内的大地图
If $x_colorex > 0 Then
ExitLoop
Else
$fb = 100
back()
EndIf
Sleep(200)
WEnd
Sleep(500) ;;到达洞内口往第一点坐标走
For $for = 1 To 11 Step 1
sjmapon() ;;开地图
Sleep(300)
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xA5825A, 0, "0\1\0x736552\0,11\-1\0xA58663\0,11\0\0x6B614A\0") ;;;FB内的大地图
If $x_colorex > 0 Then
$fb = $for
back()
EndIf
Sleep(200)
$ho = TimerInit()
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xFFB6AD, 0, "1\0\0xFF9E8C\0,1\1\0xFF9A8C\0,0\1\0xFFAE9C\0") ;;红箭头消失证明去到目标
If $x_colorex > 0 Then
Sleep(200)
$ho = TimerInit()
Send("{tab}")
EndIf
Until TimerDiff($ho) > 1500
sjmapof()
$bo = TimerInit()
While 1
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;变通怪HP图
If $x_colorex > 0 Then
dddd()
$bo = TimerInit()
Else
If TimerDiff($bo) > 3000 Then
ExitLoop
EndIf
EndIf
WEnd
Next
fbexit()
Sleep(300)
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x6BA252, 0, "404\0\0xA59A8C\0,0\417\0x73BE7B\0,403\417\0x7BB2DE\0");;外地图
If $x_colorex > 0 Then
sjmapof()
ExitLoop
Else
Send("m")
Sleep(50)
EndIf
Sleep(200)
Until $x_colorex > 0
mds()
EndFunc ;==>sjfb
Func mds() ;;卖东西
$fb = 30
back()
Sleep(200)
$ho = TimerInit()
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xFFB6AD, 0, "1\0\0xFF9E8C\0,1\1\0xFF9A8C\0,0\1\0xFFAE9C\0") ;;红箭头消失证明去到目标
If $x_colorex > 0 Then
Sleep(200)
$ho = TimerInit()
EndIf
Until TimerDiff($ho) > 1500
sjmapof()
Sleep(500)
MouseMove($pos[0] + 250, $pos[1] + 8, 0)
MouseDown("right")
Sleep(500)
MouseMove($pos[0] + 244, $pos[1] + 548)
MouseUp("right")
Sleep(500)
While 1
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xADA29C, 0, "3\0\0x423C31\0,1\2\0x313029\0,-9\39\0x004D84\0") ;;;右上角的XX
If $x_colorex > 0 Then
Send("{a up}")
ExitLoop
Else
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x84DF84, 0, "-10\-2\0x94FF94\0,-28\-2\0x94FF94\0,46\-3\0x8CEF8C\0");;洞口蘑菇字
If $x_colorex > 0 Then
Send("{a up}")
MouseClick("right", $x_colorex, $y_colorex + 8, 5, 0) ;;;
Sleep(200)
Else
Send("{a down}")
EndIf
EndIf
Sleep(200)
WEnd
While 1
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x6B3C5A, 0, "1\-1\0xD67DAD\0,10\-1\0x5A186B\0,11\0\0x5A186B\0");;最后的头像卖东西的
If $x_colorex > 0 Then
MouseMove($x_colorex, $y_colorex, 0)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(200)
ExitLoop
Else
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xADA29C, 0, "3\0\0x423C31\0,1\2\0x313029\0,-9\39\0x004D84\0") ;;;右上角的XX
If $x_colorex > 0 Then
MouseClick("left", $x_colorex - 9, $y_colorex + 336, 5, 0) ;;;
Sleep(200)
EndIf
EndIf
Sleep(200)
WEnd
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x5A594A, 0, "1\-4\0x7B756B\0,-4\-4\0x8C8684\0,-2\3\0xF7F3F7\0");;;问号
Until $x_colorex > 0
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x5A594A, 0, "1\-4\0x7B756B\0,-4\-4\0x8C8684\0,-2\3\0xF7F3F7\0");;;问号
If $x_colorex > 0 Then
MouseMove($x_colorex-93, $y_colorex+284, 0)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(200)
EndIf
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x313029, 0, "0\3\0x5A594A\0,-2\1\0x393831\0,2\1\0x393429\0") ;;;右上角的XX
If $x_colorex > 0 Then
MouseMove($x_colorex, $y_colorex, 0)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(200)
EndIf
Until $x_colorex < 0
EndFunc ;==>mds
Func fbexit() ;;退出副本
Sleep(500)
MouseMove($pos[0] + 250, $pos[1] + 8, 0)
MouseDown("right")
Sleep(500)
MouseMove($pos[0] + 244, $pos[1] + 548)
MouseUp("right")
Sleep(500)
While 1
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xADD7E7, 0, "4\0\0x9CCFD6\0,8\0\0xA5CFDE\0") ;;出洞前的对话框...
If $x_colorex > 0 Then
Send("{a up}")
MouseMove($x_colorex - 5, $y_colorex + 10, 0)
Sleep(200)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(200)
ExitLoop
Else
Do
findcolorex($pos[0] + 271, $pos[1] + 139, $pos[0] + 546, $pos[1] + 320, 0x8CEF8C, 0, "-46\0\0x94FF94\0,52\1\0x8CEF8C\0,53\1\0x315531\0") ;;蘑菇字
If $x_colorex > 0 Then
Send("{a up}")
MouseMove($x_colorex - 5, $y_colorex + 10, 0)
Sleep(200)
MouseDown("right")
Sleep(400)
MouseUp("right")
Sleep(200)
Else
Send("{a down}")
EndIf
Until $x_colorex > 0
EndIf
WEnd
EndFunc ;==>fbexit
Func hx() ;;;德服客户端写
While 1
Login()
Sleep(200)
xxxx()
If $x_colorex > 0 Then
MouseMove($x_colorex, $y_colorex, 0)
Sleep(200)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(500)
findcolorex($pos[0],$pos[1],$pos[0]+800,$pos[1]+600,0x181810,0,"3\0\0x7B756B\0,6\0\0x5A554A\0");确定
If $x_colorex > 0 Then
MouseMove($x_colorex, $y_colorex, 0)
;~ lm()
EndIf
$et = TimerInit()
While 1
findcolorex($pos[0],$pos[1],$pos[0]+800,$pos[1]+600,0xF7EFEF,0,"6\0\0x9C9A8C\0,11\0\0x9C968C\0");;换线时倒数框
If $x_colorex > 0 Then
Return
Else
Sleep(200)
If TimerDiff($et) > 5000 Then
findcolorex($pos[0],$pos[1],$pos[0]+800,$pos[1]+600,0x211C18,0,"6\0\0x7B756B\0,9\0\0x5A554A\0");;取消退出框
MouseMove($x_colorex, $y_colorex, 0)
Sleep(200)
;~ lm()
$et = TimerInit()
ExitLoop
EndIf
EndIf
WEnd
Else
findcolorex($pos[0],$pos[1],$pos[0]+800,$pos[1]+600,0xDEDBD6,0,"5\0\0x8C867B\0,15\0\0x8C8A84\0") ;;出现退出菜单
If $x_colorex > 0 Then
Sleep(300)
MouseMove($x_colorex - 21, $y_colorex + 85, 0) ;退出按扭变亮点
Sleep(500)
MouseDown("left")
Sleep(600)
MouseUp("left")
Else
Send("{esc}")
Sleep(200)
EndIf
EndIf
Sleep(1000)
WEnd
EndFunc ;==>hx
Func Login();;;德服客户端写
Sleep(300)
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x181810, 0, "8\1\0x181810\0,21\-1\0x181810\0,41\-1\0x181818\0")
If $x_colorex > 0 Then
Sleep(200)
MouseClick("left", $x_colorex + 15, $y_colorex - 50, 5, 0)
Sleep(200)
Send("Qq123123")
Sleep(500)
Send("{enter 2}")
Sleep(200)
EndIf
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x181810, 0, "16\1\0x181810\0,34\1\0x181810\0,55\1\0x181C18\0");;和服务器断开连接
If $x_colorex > 0 Then
MouseMove($x_colorex, $y_colorex, 0)
Sleep(200)
MouseDown("left")
Sleep(400)
MouseUp("left")
Sleep(200)
EndIf
EndFunc ;==>Login
Func sjmapon()
While 1
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x004D84, 0, "188\0\0x004D84\0") ;;大地图向左的箭向
If $x_colorex > 0 Then
Sleep(200)
ExitLoop
Else
Send("m")
Sleep(500)
EndIf
WEnd
EndFunc ;==>sjmapon
Func sjmapof()
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x004D84, 0, "188\0\0x004D84\0") ;;大地图向左的箭向
If $x_colorex > 0 Then
Send("m")
Sleep(200)
EndIf
Until $x_colorex < 0
EndFunc ;==>sjmapof
Func back()
While 1
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x004D84, 0, "188\0\0x004D84\0") ;;大地图向左的箭向
If $x_colorex > 0 Then
$mapx = $x_colorex + 318
$mapy = $y_colorex - 451
$map1x = $x_colorex
$map1y = $y_colorex
Sleep(200)
ExitLoop
Else
Send("m")
Sleep(500)
EndIf
WEnd
$hong = TimerInit()
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0xFFB6AD, 0, "1\0\0xFF9E8C\0,1\1\0xFF9A8C\0,0\1\0xFFAE9C\0") ;;寻址中的红箭头
If $x_colorex > 0 Then
Else
Sleep(300)
If $fb = 100 Then
MouseClick("left", $map1x - 49, $map1y - 406, 5, 0) ;;;;进洞
ElseIf $fb = 1 Then
MouseClick("left", $map1x + 57, $map1y - 119, 5, 0) ;;;1
ElseIf $fb = 2 Then
MouseClick("left", $map1x + 27, $map1y - 128, 5, 0) ;;;2
ElseIf $fb = 3 Then
MouseClick("left", $map1x + 57, $map1y - 195, 5, 0) ;;;3
ElseIf $fb = 4 Then
MouseClick("left", $map1x + 93, $map1y - 291, 5, 0) ;;;4
ElseIf $fb = 5 Then
MouseClick("left", $map1x + 86, $map1y - 319, 5, 0) ;;;5 中BOSS左边怪
ElseIf $fb = 6 Then
MouseClick("left", $map1x + 120, $map1y - 305, 5, 0) ;;6 中BOSS右边怪
ElseIf $fb = 7 Then
MouseClick("left", $map1x + 110, $map1y - 327, 5, 0) ;;;7 中BOSS
ElseIf $fb = 8 Then
MouseClick("left", $map1x + 158, $map1y - 283, 5, 0) ;;;8
ElseIf $fb = 9 Then
MouseClick("left", $map1x + 179, $map1y - 271, 5, 0) ;;;9
ElseIf $fb = 10 Then
MouseClick("left", $map1x + 243, $map1y - 233, 5, 0) ;;;;F5进洞第9点的怪] 最后的垃圾
ElseIf $fb = 11 Then
MouseClick("left", $map1x + 250, $map1y - 239, 5, 0) ;;;;出口坐标 实际游戏坐标 307 172
ElseIf $fb = 30 Then
MouseClick("left", $map1x - 42, $map1y - 409, 5, 0) ;;;;城里的卖东西的 实际游戏坐标 48 542
ElseIf $fb = 31 Then
MouseClick("left", $map1x , $map1y - 194, 5, 0) ;;;;大地图12级怪
ElseIf $fb = 32 Then
MouseClick("left", $map1x + 219, $map1y - 175, 5, 0) ;;;;大地图14级怪
ElseIf $fb = 33 Then
MouseClick("left", $map1x + 179, $map1y - 125, 5, 0) ;;;;大地图15级怪
ElseIf $fb = 34 Then
MouseClick("left", $map1x + 45, $map1y - 106, 5, 0) ;;;;大地图16级怪
EndIf
EndIf
Until $x_colorex > 0 Or TimerDiff($hong) > 3000 ;;在点大地图过程中超过5秒后退出
;;sjmapof() ;;关地图
EndFunc ;==>back
Func sw()
Do
Sleep(100)
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x63615A, 0, "13\-1\0x000400\0,23\63\0x212418\0") ;;死
If $x_colorex > 0 Then
MouseClick("left", $x_colorex - 87, $y_colorex, 1, 0)
Sleep(200)
EndIf
Until $x_colorex < 0
MouseMove($pos[0], $pos[1], 0)
$fb = 31 ;;; 点大地图14级怪的位置
back() ;;;点大地图哪个地方,由上面的$fb进行修改
sjmapof() ;关地图
EndFunc ;==>sw
Func sj() ;;打怪部分子程
wineden()
lala()
$back = TimerInit()
While 1
Do
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x63615A, 0, "13\-1\0x000400\0,23\63\0x212418\0") ;;死
If $x_colorex > 0 Then
MouseClick("left", $x_colorex - 87, $y_colorex - 3, 5, 0)
Sleep(300)
$fb = 14
sw()
EndIf
Do
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0xE7C352, 0, "40\0\0xE7C352\0,20\0\0xE7C352\0") ;;如果选中三星怪,换怪打
If $x_colorex > 0 Then
Send("{tab}")
EndIf
Until $x_colorex < 0
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;变通怪HP图
If $x_colorex > 0 Then
PixelSearch($pos[0] + 184, $pos[1] + 68, $pos[0] + 184, $pos[1] + 68, 0x942029, 0) ;;自己红少于60% 色值为红色
If @error Then
Send("6")
Sleep(50)
Send("6")
Sleep(50)
EndIf
PixelSearch($pos[0] + 157, $pos[1] + 86, $pos[0] + 157, $pos[1] + 86, 0x216D94, 0) ;;自己蓝少于50% 色值为蓝色
If @error Then
Send("7")
Sleep(50)
Send("7")
Sleep(50)
EndIf
Send("1")
Sleep(200)
Send("2")
Sleep(200)
Send("3")
Sleep(200)
Else
While 1
PixelSearch($pos[0] + 138, $pos[1] + 120, $pos[0] + 138, $pos[1] + 120, 0x942029, 0) ;;tiger
If @error Then
Send("9")
Sleep(200)
Else
ExitLoop
EndIf
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;怪HP图
If $x_colorex > 0 Then
ExitLoop
EndIf
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x63615A, 0, "13\-1\0x000400\0,23\63\0x212418\0") ;;死
If $x_colorex > 0 Then
MouseClick("left", $x_colorex - 87, $y_colorex - 3, 5, 0)
Sleep(300)
sw()
EndIf
WEnd
PixelSearch($pos[0] + 146, $pos[1] + 68, $pos[0] + 146, $pos[1] + 68, 0x8C2029, 0) ;;自己红少于30% 色值为红色
If @error Then
Send("x")
Sleep(50)
Send("x")
Sleep(1500)
While 1
PixelSearch($pos[0] + 222, $pos[1] + 68, $pos[0] + 222, $pos[1] + 68, 0x8C2029, 0) ;;自己红少于99% 色值为红色
If Not @error Then
ExitLoop
EndIf
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;怪HP图
If $x_colorex > 0 Then
ExitLoop
EndIf
findcolorex($pos[0], $pos[1], $pos[0] + 800, $pos[1] + 600, 0x63615A, 0, "13\-1\0x000400\0,23\63\0x212418\0") ;;死
If $x_colorex > 0 Then
MouseClick("left", $x_colorex - 87, $y_colorex - 3, 5, 0)
Sleep(300)
sw()
EndIf
WEnd
EndIf
EndIf
Until $x_colorex < 0
;~ If TimerDiff($back) > 1000 * 60 * 2 Then ;;;;超过2分钟返回挂机点
;~ $back = TimerInit()
;~ $fb = 14
;~ back()
;~ EndIf
Do
Sleep(50)
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0xE7C352, 0, "40\0\0xE7C352\0,20\0\0xE7C352\0") ;;三星怪
If $x_colorex > 0 Then
Send("{tab}")
EndIf
Until $x_colorex < 0
Do
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;怪HP图
If $x_colorex > 0 Then
Else
Send("{tab}")
EndIf
Until $x_colorex > 0
WEnd
EndFunc ;==>sj
Func lala()
;~ wineden()
$ih = PixelSearch($pos[0] + 90, $pos[1] + 72, $pos[0] + 90, $pos[1] + 72, 0x101410, 0);;自己人像HP
If Not @error Then
Else
findcolorex($pos[0], $pos[1], $pos[0] + 309, $pos[1] + 214, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;HP图
If $x_colorex > 0 Then
MouseClickDrag("left", $x_colorex, $y_colorex, $pos[0] + 90, $pos[1] + 72, 0)
Sleep(200)
EndIf
EndIf
EndFunc ;==>lala
Func wineden()
$var = WinList("Eden")
$ZS = 0
For $for = 1 To $var[0][0]
If IsVisible($var[$for][1]) Then
$ZS = $ZS + 1
$win[$ZS] = $var[$for][1]
EndIf
Next
$i = 0
If $ZS > 0 Then
For $for = $ZS To 1 Step -1
;~ wintab()
If $width = 1280 Then ;;1280x1024 p240 p210 237 181
WinMove($win[$i], "", 237, 181, 806, 632)
$pos[0] = 240
$pos[1] = 210
ElseIf $width = 1440 Then;;1440x900
WinMove($win[$i], "", 317, 119, 806, 632)
$pos[0] = 320
$pos[1] = 148
Else
WinMove($win[$i], "", 237, 181, 806, 632) ;1280x1024
$pos[0] = 240
$pos[1] = 210
EndIf
Sleep(200)
Next
$i = 1
EndIf
EndFunc ;==>wineden
Func dddd();;;打怪
While 1
findcolorex($pos[0] + 239, $pos[1] + 13, $pos[0] + 533, $pos[1] + 117, 0x101410, 0, "2\0\0x101410\0,1\1\0xDEDBDE\0");;变通怪HP图
If $x_colorex > 0 Then
PixelSearch($pos[0] + 184, $pos[1] + 68, $pos[0] + 184, $pos[1] + 68, 0x942029, 0) ;;自己红少于60% 色值为红色
If @error Then
Send("6")
Sleep(50)
Send("6")
Sleep(50)
EndIf
PixelSearch($pos[0] + 157, $pos[1] + 86, $pos[0] + 157, $pos[1] + 86, 0x216D94, 0) ;;自己蓝少于50% 色值为蓝色
If @error Then
Send("7")
Sleep(50)
Send("7")
Sleep(50)
EndIf
Send("1")
Sleep(200)
Send("2")
Sleep(200)
Send("3")
Sleep(200)
$dddd = TimerInit()
Else
Send("{tab}")
If TimerDiff($dddd) > 2500 Then ExitLoop
EndIf
WEnd
EndFunc ;==>dddd
Func Togglepause()
TrayTip("", "", 0)
$Paused = Not $Paused
While $Paused
Sleep(100)
TrayTip("", "暂定", 10, 4)
WEnd
TrayTip("", "", 0)
EndFunc ;==>Togglepause
;多点找色
Func findcolorex($Par_Left, $Par_Top, $Par_Right, $Par_Bottom, $Par_Color, $Par_Shade, $Par_String)
$TempStr = $Par_String & ",over"
$TempStr = StringStripWS($TempStr, 8)
$Color_I = 1
$Array = StringSplit($TempStr, ",")
$TempTop = $Par_Top
Do
$Color_I = $Color_I + 1
Until $Array[$Color_I] = "over"
$Color_Total = $Color_I
$Color_I = 1
Dim $Array_cx[$Color_Total], $Array_cy[$Color_Total], $Array_cc[$Color_Total], $Array_cp[$Color_Total]
$Color_Total = $Color_Total - 1
Do
If $Array[$Color_I] <> "over" Then
$Array_data = StringSplit($Array[$Color_I], "")
$Array_cx[$Color_I] = $Array_data[1]
$Array_cy[$Color_I] = $Array_data[2]
$Array_cc[$Color_I] = $Array_data[3]
$Array_cp[$Color_I] = $Array_data[4]
$Color_I = $Color_I + 1
EndIf
Until $Array[$Color_I] = "over"
$Color_I = 1
$TempXY = PixelSearch($Par_Left, $Par_Top, $Par_Right, $Par_Bottom, $Par_Color, $Par_Shade)
If @error Then
$x_colorex = -1
$y_colorex = -1
Return
Else
$Color_Test = 1
EndIf
Do
If $Color_Test = 1 Then
For $for = 1 To $Color_Total Step 1
$TempXY_Cmp = PixelSearch($TempXY[0] + $Array_cx[$Color_I], $TempXY[1] + $Array_cy[$Color_I], $TempXY[0] + $Array_cx[$Color_I], $TempXY[1] + $Array_cy[$Color_I], $Array_cc[$Color_I], $Array_cp[$Color_I])
If @error Then
$Color_Compare = 0
$Color_I = 1
ExitLoop
Else
$Color_Compare = 1
If $Color_I > $Color_Total Then
$Color_I = 1
Else
$Color_I = $Color_I + 1
EndIf
EndIf
Next
EndIf
If $Color_Compare = 1 Then
$x_colorex = $TempXY[0]
$y_colorex = $TempXY[1]
Return
Else
If $TempXY[0] = $Par_Right Then
$TempTop = $TempXY[1] + 1
$TempXY = PixelSearch($Par_Left, $TempTop, $Par_Right, $Par_Bottom, $Par_Color, $Par_Shade)
If @error Then
$x_colorex = -1
$y_colorex = -1
Return
Else
$Color_Test = 1
EndIf
Else
$TempXY[0] = $TempXY[0] + 1
$TempXY_1 = PixelSearch($TempXY[0], $TempXY[1], $Par_Right, $TempXY[1], $Par_Color, $Par_Shade)
If @error Then
$Color_Test = 0
$TempXY[0] = $Par_Right
Else
$TempXY[0] = $TempXY_1[0]
$Color_Test = 1
EndIf
EndIf
EndIf
Until $TempTop >= $Par_Bottom
$x_colorex = -1
$y_colorex = -1
EndFunc ;==>findcolorex
Func IsVisible($handle2) ;窗口是否可见状态
If BitAND(WinGetState($handle2), 2) Then
Return 1
Else
Return 0
EndIf
EndFunc ;==>IsVisible
;退出
Func quit()
Send("^")
Sleep(30)
Send("{esc up}")
Sleep(30)
Send("{SHIFTUP}")
Sleep(30)
Send("{alt up}")
Sleep(30)
Exit 0
EndFunc ;==>quit