一、性能提高:代碼行效率提高70%以上,函數調用效率提高40%以上,同腳本總體性能比按鍵精靈2014提高10%以上。
二、體驗更好:調試反應迅速,屢次調試內存不會致使內存泄漏積累、CPU佔用太高的狀況。
三、更加穩定:內存佔用有所改善,調試、運行不容易崩潰,不會由於殺軟或優化的緣故致使腳本沒法執行。
四、功能更強:QUI系統優化、附件系統優化、標準庫重作、多線程系統優化,功能比2014版更強大。web
1 /*********** 2 *獲取窗口焦點(*底層識別) 3 ************/ 4 Function windowsIn() 5 //獲取窗口句柄 6 Hwnd = Window.Find("WeChatMainWndForPC", "微信") 7 //窗口復原 8 Window.Restore (Hwnd) 9 //窗口移動 10 Window.Move(Hwnd, 300, 200) 11 //重設窗口大小 12 Window.SetClientSize(Hwnd, 850, 795) 13 //獲取窗口座標 14 sRect = Window.GetWindowRect(Hwnd) 15 //MsgBox "獲得窗口句柄的邊框大小(包括標題欄)爲:"& sRect 16 //下面這句用於分割字符串,將橫座標和縱座標分紅兩個字符串 17 MyArray = Split(sRect, "|") 18 //下面這句將字符串轉換成數值 19 W1 = Clng(MyArray(1)): H1 = Clng(MyArray(2)) 20 W2 = Clng(MyArray(3)) : H2 = Clng(MyArray(4)) 21 //MsgBox "邊框大小: " & W2-W1 & " " & H2-H1 22 sosow=W1+117 23 sosoh = H1 + 26 24 TracePrint W1 & "::" & H1 & "::" & W2 & "::" & H2 25 End Function
1 /***************** 2 **大漠綁定插件命令(*底層識別) 3 *******************/ 4 Function findOcr() 5 dm_ret = dm.SetDict(0, GetResPath()&"dm.txt") 6 dm_ret = dm.GetClientSize(Hwnd,W2-W1,H2-H1) 7 dm_ret = dm.BindWindow(Hwnd, "gdi", "normal", "normal", 0) 8 Delay 200 9 If dm_ret = 0 Then 10 TracePrint ("大漠界面綁定失敗") 11 Return -1 12 Exit Function 13 Else 14 TracePrint ("大漠界面綁定成功") 15 Return 0 16 End If 17 End Function
1 /***************** 2 **大漠識字命令(*底層識別) 3 *daMoFindOcr(x1,y1,x2,y2) 4 *******************/ 5 Function daMoFindOcr(d1_x1,d1_y1,d1_x2,d1_y2) 6 Dim d1_s = dm.Ocr(d1_x1,d1_y1,d1_x2,d1_y2,"727272-202020|000000-eeeeee",0.9) 7 TracePrint (d1_s) 8 Return d1_s 9 End Function
1 /***************** 2 **大漠識圖命令(*底層識別) 3 *dm_findAllPic(x1,y1,x2,y2) 4 *******************/ 5 Function dm_findPic(d3_x1, d3_x2, d3_y1, d3_y2, d3_picUrl) 6 Dim d3_dm_ret, d3_intX,d3_intY, d3_count, d3_sss, d3_x, d3_y 7 d3_dm_ret = dm.FindPic(d3_x1, d3_x2, d3_y1, d3_y2,GetResPath()& d3_picUrl,"000000",0.9,0,d3_intX,d3_intY) 8 If d3_intX >= 0 and d3_intY >= 0 Then 9 d3_intX = d3_intX 10 d3_intY = d3_intY 11 TracePrint (d3_intX & "+dm_findPic+" & d3_intY) 12 Return 0,d3_intX,d3_intY 13 Else 14 TracePrint ("-1,-1,-1") 15 Return -1,-1,-1 16 End If 17 End Function
1 /***************** 2 **大漠識圖命令全局(*底層識別) 3 *dm_findAllPic(x1,y1,x2,y2) 4 *******************/ 5 Function dm_findAllPic(d2_x1, d2_y1, d2_x2, d2_y2, d2_picUrl) 6 dim d2_num = 0 7 Dim d2_picXY(10) 8 Dim d2_daozhangID,d2_shoukuanW,d2_shoukuanH 9 Do 10 d2_daozhangID,d2_shoukuanW,d2_shoukuanH= dm_findPic(d2_x1,d2_y1,d2_x2,d2_y2,d2_picurl) 11 If d2_daozhangID = 0 Then 12 d2_num = d2_num + 1 13 Dim d2_arrayin(1) 14 d2_arrayin(d2_shoukuanW)=d2_shoukuanH 15 d2_picXY(d2_num)=d2_arrayin 16 //x1 = shoukuanW 17 d2_y1 = d2_shoukuanH + 20 18 TracePrint (d2_x1 & d2_y1 & d2_x2 & d2_y2) 19 TracePrint ( "找到" & d2_num & "個,座標爲:"& d2_shoukuanW& d2_shoukuanH) 20 End If 21 Loop While d2_daozhangID= 0 22 //TracePrint ( "找到" & num & "個,座標爲:"& piczuobiaoji) 23 For Each d2_k, d2_v In d2_picXY 24 TracePrint d2_k, d2_v 25 Next 26 Return d2_num,d2_picXY 27 End Function
按鍵精靈X版最新版,首次將底層轉爲基於lua,使得代碼書寫更爲方便,使用流暢度大大提高!正則表達式
推薦兩個插件:windows
推薦使用的工具:微信