Advertisement
dudehacker

Clear box + reset (pixel color based)

Dec 11th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ^o::
  3. Sendmode Event
  4. DetectHiddenWindows, On
  5. CoordMode,Mouse,Screen
  6. CoordMode,Pixel,Screen
  7.  
  8. StopLoop := False
  9. MouseGetPos, xposition,yposition,id
  10. WinGetTitle, title, ahk_id %id%
  11.  
  12. SetTitleMatchMode, 2
  13. SetControlDelay -1
  14.  
  15. ; resolution = 1485 x 995
  16. ; spam = 611 x 693
  17. ; reset = 1341 x 285
  18.  
  19.  
  20. loop
  21. {
  22.     if StopLoop
  23.     {
  24.         break
  25.     }
  26.     WinGetPos,winX,winY,Width, Height,ahk_id %id%
  27.     spamX := winX + 611*Width/1485
  28.     spamY := winY + 693*Height/995
  29.  
  30.     resetX := winX + 1341*Width/1485
  31.     resetY := winY + 285*Height/995
  32.  
  33.     spinX := winX + 986*Width/1485
  34.     spinY := winY + 703*Height/995
  35.    
  36.     PixelGetColor, color, %resetX%, %resetY%, Slow
  37.     sleep 10
  38.  
  39.     if (color = 0xB7846C){
  40.         Click %resetX%,%resetY%
  41.         ;ControlClick,x645 y100,ahk_id id,,,,pos   
  42.         sleep 500
  43.         Click %spinX%,%spinY%
  44.         sleep 500
  45.     } else {
  46.         ;ToolTip %color%
  47.         Click %spamX%,%spamY%
  48.         ;ControlClick,x300 y340,ahk_id id,,,,pos
  49.         sleep 200
  50.     }
  51.    
  52. }
  53. return
  54.  
  55. ^p::
  56. StopLoop := True
  57. i = 0
  58. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement