Zeroun_Scripts

Quick PixelSearch

Jun 7th, 2021 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Global program = "enter program here"
  2. Global PixelTest = 0
  3.  
  4. clickTest(){
  5.    
  6.     CoordMode Pixel Client
  7.     CoordMode Mouse Client
  8.         ;------------------------------------------------Select Color-------------------------------------------------
  9.     Loop
  10.     {
  11.         mousegetpos, x, y
  12.         PixelGetColor,Selected_Color,%x%,%y%, Fast RGB
  13.         tooltip, RButton Select Color - %Selected_Color% , (x + 20), (y + 20), 1
  14.         If (GetKeyState("RButton", "P")){
  15.             break
  16.         }
  17.     }
  18.     KeyWait, RButton, L
  19.     MouseGetPos,tpx,tpy
  20.     PixelGetColor,Selected_Color,%tpx%,%tpy%, Fast RGB
  21.     Tooltip,
  22.    
  23.     ;------------------------------------------------Select Top Left---------------------------------------------
  24.     Loop{
  25.         mousegetpos, x, y
  26.         tooltip, Select Top Left %x% - %y%, (x + 20), (y + 20), 1
  27.         If (GetKeyState("RButton", "P")){
  28.             break
  29.         }
  30.                 ;Sleep 200
  31.     }
  32.     KeyWait, RButton, L
  33.     MouseGetPos,tlx,tly
  34.     Tooltip,
  35.     ;------------------------------------------------Select Bottom Right-----------------------------------------
  36.    
  37.     Loop{
  38.         mousegetpos, x, y
  39.         tooltip, Select Bottom Right %x% - %y%, (x + 20), (y + 20), 1
  40.         If (GetKeyState("RButton", "P")){
  41.             break
  42.         }
  43.                     ;Sleep 200
  44.     }
  45.     KeyWait, RButton, L
  46.     MouseGetPos,brx,bry
  47.     Tooltip,
  48.    
  49.     ;------------------------------------------------Pixel Color Test-------------------------------------------
  50.    
  51.     Loop{
  52.        
  53.         if(PixelTest < 19){
  54.             PixelSearch, x, y, %tlx%, %tly%, %brx%, %bry%, %Selected_Color%, 1, Fast RGB
  55.             if(ErrorLevel = 0){
  56.                 PixelTest++
  57.                 Tooltip, Successes - %PixelTest%
  58.                 ;WinActivate %program%
  59.                 ;WinWait %program%
  60.             }
  61.             if(ErrorLevel = 1){
  62.                 MsgBox, Can't find it, select new color
  63.                 PixelTest := 0
  64.                 WinActivate %program%
  65.                 WinWait %program%
  66.                 Loop
  67.                 {
  68.                     mousegetpos, x, y
  69.                     PixelGetColor,Selected_Color,%x%,%y%, Fast RGB
  70.                     tooltip, RButton Select Color - %Selected_Color% , (x + 20), (y + 20), 1
  71.                     If (GetKeyState("RButton", "P")){
  72.                         break
  73.                     }
  74.                 }
  75.                 KeyWait, RButton, L
  76.                 MouseGetPos,tpx,tpy
  77.                 PixelGetColor,Selected_Color,%tpx%,%tpy%, Fast RGB
  78.                 Tooltip,
  79.             }
  80.         }
  81.         if(PixelTest >= 19){
  82.             Tooltip,
  83.             ;currentTask := "Tested the color " Selected_Color " successfully"
  84.             SoundPlay, *-1
  85.             Clipboard :=
  86.             Clipboard = PixelSearch, x, y, %tlx%, %tly%, %brx%, %bry%, %Selected_Color%, 1, Fast RGB
  87.             PixelTest := 0
  88.             break
  89.         }
  90.     }
  91. }
  92.  
Add Comment
Please, Sign In to add comment