SHARE
TWEET

Untitled

papple23g Sep 30th, 2019 (edited) 297 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;無限循環執行
  2. while true{
  3.     if GetPicturePosition("...\01.png") or GetPicturePosition("...\02.png") or GetPicturePosition("...\03.png"){
  4.         Send {F1}
  5.     } else if GetPicturePosition("...\04.png") or GetPicturePosition("...\05.png") or GetPicturePosition("...\06.png"){
  6.         Send {F2}
  7.     }
  8. }
  9. return
  10.  
  11. ;獲取圖片位置的函式
  12. GetPicturePosition(ImageFilePath){
  13.     gui,add,picture,hwndmypic,%ImageFilePath%
  14.     controlgetpos,,,width,height,,ahk_id %mypic%
  15.     CoordMode Pixel
  16.     ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight,%ImageFilePath%
  17.     CoordMode Mouse
  18.     if %FoundX%{
  19.         return [FoundX+width/2,FoundY+height/2]
  20.     } else {
  21.         return FoundX
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top