>>811
AutoHotKeyの方が圧倒的に早いしnox_adbいらずでおすすめ
非アクティブOK、最小化NG、デスクトップの画面外OK、ウィンドウ同士が重なっててもOK
標準の画像判定は裏化できないのでGdip.ahk,GDIpHelper.ahk、おまけでGdip_ImageSearch.ahkもググって入手して
;■初期化
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance off
#Include Gdip.ahk ;http://www.autohotkey.com/forum/topic32238.html
#Include GDIpHelper.ahk
#Include Gdip_ImageSearch.ahk
hwnd := WinExist(WindowTitle)
SetUPGDIP()
; ピクセル判定関数
CheckPixel(x,y,col) {
global
pixel := GDIP_GetPixel(pBitmap, x, y)
mask = 0xFF
scale = 1
Loop, 3
{
BaseValue := (col & mask)
ElementValue := (pixel & mask)
if (ElementValue < BaseValue) || (ElementValue > BaseValue) {
return false
}
scale *= 0x100
mask *= 0x100
}
return true
}
}
; タップ関数
Tap(x, y) {
global
ControlClick, x%x% y%y%, ahk_id %hwnd%,,L,,D
Sleep 10
ControlClick, x%x% y%y%, ahk_id %hwnd%,,L,,U
}
;■ウィンドウの座標(50,50)のピクセルを色0xRRGGBBで判定して座標(50,50)をタップする
pBitmap := Gdip_BitmapFromHWND(hwnd) ;スクリーンショット取得
if (CheckPixel(50, 50, 0xRRGGBB)) {
Tap(50,50)
}
Gdip_DisposeImage(pBitmap) ;スクリーンショットの破棄
【WinでAndroid】NoxPlayer Part16
■ このスレッドは過去ログ倉庫に格納されています
■ このスレッドは過去ログ倉庫に格納されています