本帖最后由 aa77dd@163.com 于 2015-12-31 19:24 编辑
回复 6# erjnasrtnws
我放弃 VBS 的尝试, 改用 AHK 成功实现 财经郎眼2014 http://www.ximalaya.com/1162654/album/233577 的自动播放
请安装 AHK, 官方下载地址 [url]http://ahkscript.org/download/ahk-install.exe[/url]
以下代码存为 AutoPlay.ahk 如果安装了 AHK 双击运行即可, 当然你也可以把它转成 EXE 文件(AHK 安装后有一个编译器 Ahk2Exe.exe)来运行- Run, "%ComSpec%" /c start "" /max "%ProgramFiles%\Internet Explorer\iexplore.exe" http://www.ximalaya.com/#/1162654/album/233577, , Max
-
-
- WinActivate, 【财经郎眼 2014】在线收听_mp3下载_ 喜马拉雅官网 - Internet Explorer,
-
- Send, {ALTDOWN}{SPACE}{ALTUP}x
-
- SLEEP, 3000
-
- WinActivate, 【财经郎眼 2014】在线收听_mp3下载_ 喜马拉雅官网 - Internet Explorer,
-
- MouseMove, 0, 0
-
- ; 播放按钮色指纹信息
- Y_1 := 0
- X_1 := 0
- C_1 := 0xFAFAFA
- Y_2 := 0
- X_2 := 3
- C_2 := 0xC9DDFB
- Y_3 := 0
- X_3 := 4
- C_3 := 0x0168FF
- Y_4 := 0
- X_4 := 5
- C_4 := 0x0067FF
- Y_5 := 0
- X_5 := 20
- C_5 := 0xA5C9FF
- Y_6 := 0
- X_6 := 21
- C_6 := 0x0F70FF
- Y_7 := 0
- X_7 := 22
- C_7 := 0x0067FF
- Y_8 := 0
- X_8 := 47
- C_8 := 0x0168FF
- Y_9 := 0
- X_9 := 48
- C_9 := 0xC9DDFB
- Y_10 := 0
- X_10 := 49
- C_10 := 0xFAFAFA
- Y_11 := 5
- X_11 := 0
- C_11 := 0xFAFAFA
- Y_12 := 5
- X_12 := 1
- C_12 := 0xDEE9FB
- Y_13 := 5
- X_13 := 2
- C_13 := 0x0063FF
- Y_14 := 5
- X_14 := 20
- C_14 := 0xFFFFFF
- Y_15 := 5
- X_15 := 27
- C_15 := 0xB3D1FF
- Y_16 := 5
- X_16 := 28
- C_16 := 0x1670FF
- Y_17 := 5
- X_17 := 29
- C_17 := 0x0063FF
- Y_18 := 5
- X_18 := 50
- C_18 := 0xD9E6FB
- Y_19 := 10
- X_19 := 0
- C_19 := 0xFAFAFA
- Y_20 := 10
- X_20 := 1
- C_20 := 0x0E67FF
- Y_21 := 10
- X_21 := 2
- C_21 := 0x005EFF
- Y_22 := 10
- X_22 := 20
- C_22 := 0xFFFFFF
- Y_23 := 10
- X_23 := 34
- C_23 := 0xC0D7FF
- Y_24 := 10
- X_24 := 35
- C_24 := 0x1E71FF
- Y_25 := 10
- X_25 := 36
- C_25 := 0x005EFF
- Y_26 := 10
- X_26 := 50
- C_26 := 0x136AFF
- Y_27 := 15
- X_27 := 0
- C_27 := 0xFAFAFA
- Y_28 := 15
- X_28 := 1
- C_28 := 0x4586FE
- Y_29 := 15
- X_29 := 2
- C_29 := 0x0059FF
- Y_30 := 15
- X_30 := 20
- C_30 := 0xFFFFFF
- Y_31 := 15
- X_31 := 30
- C_31 := 0xFDFEFF
- Y_32 := 15
- X_32 := 31
- C_32 := 0x8FB6FF
- Y_33 := 15
- X_33 := 32
- C_33 := 0x0B60FF
- Y_34 := 15
- X_34 := 33
- C_34 := 0x0059FF
- Y_35 := 15
- X_35 := 50
- C_35 := 0x4485FE
- Y_36 := 20
- X_36 := 0
- C_36 := 0xFAFAFA
- Y_37 := 20
- X_37 := 2
- C_37 := 0x81AAFC
- Y_38 := 20
- X_38 := 3
- C_38 := 0x0054FF
- Y_39 := 20
- X_39 := 20
- C_39 := 0xFFFFFF
- Y_40 := 20
- X_40 := 23
- C_40 := 0xBAD1FF
- Y_41 := 20
- X_41 := 24
- C_41 := 0x226BFF
- Y_42 := 20
- X_42 := 25
- C_42 := 0x0054FF
- Y_43 := 20
- X_43 := 49
- C_43 := 0x7AA5FD
- Y_44 := 20
- X_44 := 50
- C_44 := 0xFAFAFA
-
- y_start := 0
- loop, %A_ScreenHeight% {
- PixelSearch, xs, ys, 0, y_start, A_ScreenWidth, A_ScreenHeight, 0x0168FF, 0, Fast
-
- xs -= 4
- FoundBtn := TRUE
- loop, 44{
-
- X := xs + X_%A_INDEX%
- Y := ys + Y_%A_INDEX%
-
- PixelGetColor, color, %X%, %Y%,
- if (color != C_%A_INDEX%) {
- FoundBtn := FALSE
- Break
- }
- }
-
- if (FoundBtn) {
- MouseClick, left, xs + 52 / 2, ys + 23 / 2
- ExitApp
- }
- y_start += 1
- }
- ExitApp
复制代码 色指纹获取代码- #a::
- WinActivate, ahk_exe mspaint.exe,
-
- i := 0
-
- loop, 5 {
- yoffs := (A_INDEX - 1) * 5
- last_color := -1
- loop, 51 {
- xoffs := A_INDEX - 1
- X := 13 + xoffs
- Y := 87 + yoffs
-
- PixelGetColor, color, %X%, %Y%, Alt
-
- if (color != last_color) {
- last_color := color
- i += 1
-
- FileAppend, Y_%i% := %yoffs%`n, TestLog.txt
- FileAppend, X_%i% := %xoffs%`n, TestLog.txt
- FileAppend, C_%i% := %color%`n, TestLog.txt
- }
- }
- }
-
- return
复制代码
|