--- tags: 按鍵精靈 2014.6 --- [YouTube](https://youtube.com/shorts/R0dozjDAR34) # ROX新世代 自動商會任務 一、使用工具: 1.[按鍵精靈2014.6](http://download.myanjian.com/) ([簡體中文版Window](https://www.microsoft.com/zh-cn/software-download/windows10)安裝使用較無問題。) 2.[雷電模擬器](https://www.ldplayer.tw/?gad_source=1) 2-1.雷電設置: ![image](https://hackmd.io/_uploads/HyQf2fYP0.png) ![image](https://hackmd.io/_uploads/HkC1tfKPR.png) ![image](https://hackmd.io/_uploads/Skp-KMtv0.png) ![image](https://hackmd.io/_uploads/SyxQKMtvR.png) ![image](https://hackmd.io/_uploads/HJjmtMtD0.png) 3.遊戲設定: ![image](https://hackmd.io/_uploads/rkq33MKDC.png) 4.我的電腦配置: ``` 作業系統: Microsoft Windows 10 64位元 CPU型號: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz 主機板: ASUSTeKCOMPUTERINC. TUFZ370-PLUSGAMING 總記憶體: 可用記憶體(34.4GB) 總記憶體(47.9GB) 螢幕: 1920x1080 顯卡型號: Intel(R) UHD Graphics 630(20220719)【當前使用】 顯卡型號: Microsoft Remote Display Adapter(20060621) OpenGL: 4.6.0 - Build 31.0.101.2111 VT: 已開啟 HyperV: 已關閉 Root: 關閉 以系統管理員身分執行: 否 安裝磁碟: C磁碟(-) 可用空間(134GB) 總空間(238GB) 模擬器版本: 9.0.71.3(64) 執行參數: CPU(4核) 記憶體(8192M) 解析度(960x540 DPI 160) FPS(60) 多開參數: 當前編號(1) 正在執行(2) 高速模式(1) FPS限制(60) 硬碟訊息: 類型(自動擴充) 可用空間(22GB) 總空間(27GB) 機型: 品牌(Xiaomi) 型號(SM-G975N) ASTC: 開啟 Root權限: 關閉 模擬器路徑: C:\LDPlayer\LDPlayer9\ 日誌路徑: C:\Users\0976370081\AppData\Roaming\XuanZhi9\log ``` 這個配置頂多同時支援雙開釣魚,否則會卡頓,單開釣魚成功率在95%以上,雙開在90%以上,四開在80%以下。 二、按鍵精靈程式碼: 1.程式碼: ``` NumberA = Int(Form1.InputBox1.Text) NumberB = Int(Form1.InputBox2.Text) //ROX新世代商會任務 win1 = 0 win2 = 0 win3 = 0 win4 = 0 //獲取窗口句柄 If win1 = 0 Then win1 = Lib.API.查找窗口句柄("LDPlayerMainFrame", 1) sRect1 = Plugin.Window.GetWindowRect(win1) Dim MyArray1 MyArray1 = Split(sRect1, "|") MyArray1W1 = Clng(MyArray1(0)) MyArray1H1 = Clng(MyArray1(1)) MyArray1W2 = Clng(MyArray1(2)) MyArray1H2 = Clng(MyArray1(3)) End If If win2 = 0 Then win2 = Lib.API.查找窗口句柄("LDPlayerMainFrame", 2) sRect2 = Plugin.Window.GetWindowRect(win2) Dim MyArray2 MyArray2 = Split(sRect2, "|") MyArray2W1 = Clng(MyArray2(0)) MyArray2H1 = Clng(MyArray2(1)) MyArray2W2 = Clng(MyArray2(2)) MyArray2H2 = Clng(MyArray2(3)) End If If win3 = 0 Then win3 = Lib.API.查找窗口句柄("LDPlayerMainFrame", 3) sRect3 = Plugin.Window.GetWindowRect(win3) Dim MyArray3 MyArray3 = Split(sRect3, "|") MyArray3W1 = Clng(MyArray3(0)) MyArray3H1 = Clng(MyArray3(1)) MyArray3W2 = Clng(MyArray3(2)) MyArray3H2 = Clng(MyArray3(3)) End If If win4 = 0 Then win4 = Lib.API.查找窗口句柄("LDPlayerMainFrame", 4) sRect4 = Plugin.Window.GetWindowRect(win4) dim MyArray4 MyArray4 = Split(sRect4, "|") MyArray4W1 = Clng(MyArray4(0)) MyArray4H1 = Clng(MyArray4(1)) MyArray4W2 = Clng(MyArray4(2)) MyArray4H2 = Clng(MyArray4(3)) End If //四開窗口設定值 MyArray1W21 = 0 MyArray1W22 = 0 MyArray1H21 = 480 MyArray1H22 = 281 MyArray2W21 = 480 MyArray2W22 = 0 MyArray2H21 = 480 MyArray2H22 = 281 MyArray3W21 = 960 MyArray3W22 = 0 MyArray3H21 = 480 MyArray3H22 = 281 MyArray4W21 = 1440 MyArray4W22 = 0 MyArray4H21 = 480 MyArray4H22 = 281 //設定窗口 Call Plugin.Window.Move(win1, MyArray1W21, MyArray1W22) Call Plugin.Window.Size(win1, MyArray1H21, MyArray1H22) Call Plugin.Window.Move(win2, MyArray2W21, MyArray2W22) Call Plugin.Window.Size(win2, MyArray2H21, MyArray2H22) Call Plugin.Window.Move(win3, MyArray3W21, MyArray3W22) Call Plugin.Window.Size(win3, MyArray3H21, MyArray3H22) Call Plugin.Window.Move(win4, MyArray4W21, MyArray4W22) Call Plugin.Window.Size(win4, MyArray4H21, MyArray4H22) win1x = 0 win1y = 0 win2x = 480 win2y = 0 win3x = 960 win3y = 0 win4x = 1440 win4y = 0 winw = 480 winh = 281 //Dim NumberX(9) //Dim NumberY(9) NumberX = Array(342,268,292,317,268,292,317,268,292,317) NumberY = Array(164,139,139,139,164,164,164,190,190,190) Sub A(x, y, w, h, n) FindColorEx x+20,y+102,x+94,y+125,"CF5ABE",0,0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 37, y + 111 LeftClick 1 TracePrint "A" End If End Sub Sub B(x, y, w, h, n) FindPic x,y,x+w,y+h,"Attachment:\交付B.bmp",0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 378, y + 159 LeftClick 1 TracePrint "B" End If End Sub Sub C(x, y, w, h, n) FindPic x,y,x+w,y+h,"Attachment:\C.bmp",0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 383, y + 243 LeftClick 1 TracePrint "C" End If End Sub Sub D(x, y, w, h, n) FindPic x,y,x+w,y+h,"Attachment:\D.bmp",0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 212, y + 202 LeftClick 1 TracePrint "D" End If End Sub Sub E(x, y, w, h, n) FindPic x, y, x + w, y + h, "Attachment:\E.bmp", 0.5, intX, intY If intX > 0 And intY > 0 Then Delay 500 MoveTo x+NumberX(NumberA)+10, y + NumberY(NumberA)+10 LeftClick 1 Delay 500 MoveTo x+NumberX(NumberB)+10, y + NumberY(NumberB)+10 LeftClick 1 Delay 500 MoveTo x+342+10, y+190+10 LeftClick 1 Delay 500 TracePrint "E" End If End Sub Sub F(x, y, w, h, n) FindPic x,y,x+w,y+h,"Attachment:\F.bmp",0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 227, y + 242 LeftClick 1 TracePrint "F" End If End Sub Sub G(x, y, w, h, n) FindPic x,y,x+w,y+h,"Attachment:\G.bmp",0.5,intX,intY If intX > 0 And intY > 0 Then MoveTo x + 314, y + 243 LeftClick 1 TracePrint "G" End If End Sub Sub H(x, y, w, h, n) End Sub Sub I(x, y, w, h, n) End Sub Sub J(x, y, w, h, n) End Sub Sub K(x, y, w, h, n) End Sub Sub L(x, y, w, h, n) End Sub Sub M(x, y, w, h, n) End Sub Sub N(x, y, w, h, n) End Sub Sub O(x, y, w, h, n) End Sub Sub P(x, y, w, h, n) End Sub Sub Q(x, y, w, h, n) End Sub Sub R(x, y, w, h, n) End Sub Sub S(x, y, w, h, n) End Sub Sub T(x, y, w, h, n) End Sub Sub U(x, y, w, h, n) End Sub Sub V(x, y, w, h, n) End Sub Sub W(x, y, w, h, n) End Sub Sub X(x, y, w, h, n) End Sub Sub Y(x, y, w, h, n) End Sub Sub Z(x, y, w, h, n) End Sub State = True While State Call A(win1x, win1y, winw, winh, 1) Call A(win2x, win2y, winw, winh, 2) Call A(win3x, win3y, winw, winh, 3) Call A(win4x, win4y, winw, winh, 4) Delay 100 Call B(win1x, win1y, winw, winh, 1) Call B(win2x, win2y, winw, winh, 2) Call B(win3x, win3y, winw, winh, 3) Call B(win4x, win4y, winw, winh, 4) Delay 100 Call C(win1x, win1y, winw, winh, 1) Call C(win2x, win2y, winw, winh, 2) Call C(win3x, win3y, winw, winh, 3) Call C(win4x, win4y, winw, winh, 4) Delay 100 Call D(win1x, win1y, winw, winh, 1) Call D(win2x, win2y, winw, winh, 2) Call D(win3x, win3y, winw, winh, 3) Call D(win4x, win4y, winw, winh, 4) Delay 100 Call E(win1x, win1y, winw, winh, 1) Call E(win2x, win2y, winw, winh, 2) Call E(win3x, win3y, winw, winh, 3) Call E(win4x, win4y, winw, winh, 4) Delay 100 Call F(win1x, win1y, winw, winh, 1) Call F(win2x, win2y, winw, winh, 2) Call F(win3x, win3y, winw, winh, 3) Call F(win4x, win4y, winw, winh, 4) Delay 100 Call G(win1x, win1y, winw, winh, 1) Call G(win2x, win2y, winw, winh, 2) Call G(win3x, win3y, winw, winh, 3) Call G(win4x, win4y, winw, winh, 4) Delay 100 Wend ``` 2.介面: ![image](https://hackmd.io/_uploads/rkdhs-Aw0.png) 3.1圖片資料夾: ![image](https://hackmd.io/_uploads/SJzf8bGu0.png) ![image](https://hackmd.io/_uploads/SJQmLWzOR.png) 3.2附件: ![image](https://hackmd.io/_uploads/Hye0sbAwA.png) 4.附件圖片: G![G](https://hackmd.io/_uploads/Bkcl2Z0vC.bmp) 交付B![交付B](https://hackmd.io/_uploads/Bycl3WAPA.bmp) C![C](https://hackmd.io/_uploads/By9xh-AwR.bmp) D![D](https://hackmd.io/_uploads/B19ehZCwA.bmp) E![E](https://hackmd.io/_uploads/HkqgnWCPA.bmp) F![F](https://hackmd.io/_uploads/rJql3ZRDR.bmp)