是否可以使用AutoIT單擊一個閃光燈按鈕?如果是這樣,任何人都可以給我示例代碼嗎?AutoIT單擊Flash按鈕?
0
A
回答
2
如果你知道按鈕的位置並且它在那裏,你可以在屏幕上點擊一個位置。
如果您不知道閃光燈按鈕的狀態(如果它存在或不存在,它的確切位置),您可以使用截取屏幕截圖的腳本,處理圖像,然後創建並運行AutoIT單擊該按鈕的腳本。過去,我必須用Perl和ImageMagick來做這件事。
0
沒有截圖,你可以使用PixelChecksum
來計算一個像素的散列值。然後,您將與之前計算的版本進行比較。您需要檢查一系列像素區域。
https://www.autoitscript.com/autoit3/docs/functions/PixelChecksum.htm
0
下面是使用的AutoIt自動閃光遊戲的一個例子。
#include <IE.au3>
example()
Func example()
$oIE = _IECreate("http://andkon.com/arcade/puzzle/greatmatemaster/")
Local $oEmbedFlash = _IETagNameGetCollection($oIE, "embed", 0)
Local $hWin = _IEPropertyGet($oIE, "hwnd")
WinSetState($hWin, "", @SW_MAXIMIZE)
;get the x/y position of the flash game
Local $iX = _IEPropertyGet($oEmbedFlash, "screenx")
Local $iY = _IEPropertyGet($oEmbedFlash, "screeny")
;add click positions
Local $aPlayChestBtn = [$iX + 240, $iY + 350]
Local $a2b = [$iX + 120, $iY + 390]
Local $a4b = [$iX + 120, $iY + 300]
;click the play chest button
Click($aPlayChestBtn, 2000)
;move pawn to 4b with clicks
Click($a2b, 1000)
Click($a4b, 1000)
EndFunc ;==>example
Func Click($aPos, $iWaitTime = 0)
;waits for a set amount of time for nothing to change where you want to click
If $iWaitTime <> 0 Then PixelChecksumWait($aPos, $iWaitTime)
;clicks the area you want to click
MouseClick("left", $aPos[0], $aPos[1], 1, 0)
EndFunc ;==>Click
Func PixelChecksumWait($aPos, $iWaitTime = 5000)
Local $iCheckSum
;wait to make sure there is no change in the region
While 1
;get checksum
$iCheckSum = PixelChecksum($aPos[1] - 5, $aPos[0] - 5, 10, 10)
;sleep to make sure there is no change
Sleep($iWaitTime)
;exit loop if there was no change
If $iCheckSum = PixelChecksum($aPos[1] - 5, $aPos[0] - 5, 10, 10) Then ExitLoop
WEnd
EndFunc ;==>PixelChecksumWait
相關問題
- 1. autoit IE點擊網站上的按鈕
- 2. AutoIT |瀏覽器|點擊一個按鈕
- 3. Flash按鈕點擊事件
- 4. autoit未運行安裝並自動單擊完成按鈕
- 5. AutoIt - 控制點擊Flash內容
- 6. ObjectListView按鈕單擊按鈕
- 7. 單擊按鈕
- 8. 播放用戶單擊單選按鈕時的聲音! FLASH AS3
- 9. 單擊tableviewcell上的按鈕單擊單元格不按鈕
- 10. PhantomJs點擊一個flash按鈕
- 11. IndexOutOfRangeException單擊按鈕
- 12. HtmlUnit按鈕單擊
- 13. 上按鈕單擊
- 14. C#按鈕單擊
- 15. InputMultiplexer單擊按鈕
- 16. 按鈕單擊RecyclerView
- 17. WebUserControl按鈕單擊
- 18. Knockoutjs按鈕單擊
- 19. 按鈕上單擊
- 20. 按鈕單擊Asp.Net
- 21. 長按並單擊按鈕
- 22. Flash單選按鈕:如何獲取選定的單選按鈕?
- 23. 單擊單選按鈕時
- 24. 通過單擊按鈕更改屏幕上的Flash文件
- 25. 使用硒單擊一個Flash按鈕Webdriver
- 26. 單擊按鈕上的Flash輸入文本框背景
- 27. 無法在Firefox上的Flash中單擊允許按鈕
- 28. 單擊按鈕時如何刪除組合框組件flash as3
- 29. 允許按鈕通過層在Flash/ActionScript3中單擊
- 30. 如何自動點擊Flash菜單上的按鈕?
你好謝謝Narthring可以請你告訴我的AutoIt的任何代碼示例點擊Flash或iteracting閃存..我的google搜索,但你可以參考任何鏈接或任何代碼,我再次無法理解他們..謝謝 – selva
只需使用MouseClick函數點擊相應的區域:http://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm您需要知道提前點擊的位置並通過那些X和Y座標到函數中。 – Narthring