Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;無限循環執行
- while true{
- if GetPicturePosition("...\01.png") or GetPicturePosition("...\02.png") or GetPicturePosition("...\03.png"){
- Send {F1}
- } else if GetPicturePosition("...\04.png") or GetPicturePosition("...\05.png") or GetPicturePosition("...\06.png"){
- Send {F2}
- }
- }
- return
- ;獲取圖片位置的函式
- GetPicturePosition(ImageFilePath){
- gui,add,picture,hwndmypic,%ImageFilePath%
- controlgetpos,,,width,height,,ahk_id %mypic%
- CoordMode Pixel
- ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight,%ImageFilePath%
- CoordMode Mouse
- if %FoundX%{
- return [FoundX+width/2,FoundY+height/2]
- } else {
- return FoundX
- }
- }
Add Comment
Please, Sign In to add comment