Advertisement
Vhagard

Untitled

Oct 6th, 2014
718
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. #SingleInstance force
  6. #Persistent
  7. Menu, Tray, Icon, glol.ico
  8. CoordMode, Pixel, Screen
  9. CoordMode, Mouse, Screen
  10.  
  11. cdots:=1
  12. dots:=.
  13.  
  14. ; ///////////  GUI
  15. Gui, Font, s14 c0xff00 w700, Tahoma
  16. Gui, add, Text, x10 y10 w280 h20 +Center +BackgroundTrans  vVar,
  17. Gui, Font
  18. Gui, Add, Button, x10 y40 w120 h40, Run
  19. Gui, Add, Button, x150 y40 w120 h40, Stop
  20. Gui, Show, Center w281 h90, LoL Auto Accept
  21. Return
  22.  
  23. Go:=False
  24.  
  25.  
  26. ; if on checks for accept button every 3 sec, if found it turn itself off
  27.  
  28. aAccept:
  29. if Go
  30. {
  31.     SetTimer, aAccept, Off
  32.     ImageSearch, x, y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 Accept.png
  33.     If (!ErrorLevel)
  34.     {
  35.         BlockInput, on
  36.         MouseMove, x+20, y+10
  37.         Sleep, 100
  38.         MouseClick, left
  39.         Sleep, 100
  40.         MouseClick, left
  41.         BlockInput, off
  42.         found()
  43.     } else {
  44.    
  45.         ImageSearch, x, y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 acceptar.png
  46.         If (!ErrorLevel)
  47.         {
  48.             BlockInput, on
  49.             MouseMove, x+20, y+10
  50.             Sleep, 100
  51.             MouseClick, left
  52.             Sleep, 100
  53.             MouseClick, left
  54.             BlockInput, off
  55.             found()
  56.         } else {
  57.             SetTimer, aAccept, 3000
  58.         }
  59.     }
  60. }
  61. return
  62.  
  63.  
  64. refreshText:
  65. SetTimer, refreshText, Off
  66. if Go
  67. {  
  68.     GuiControl,, Var, Waiting For a Match%dots%
  69.    
  70.  
  71.     if (cdots < 3){
  72.         dots.=.
  73.         cdots:=cdots+1
  74.     }
  75.     else {
  76.         dots:=""
  77.         cdots:=0
  78.     }  
  79. SetTimer, refreshText,500
  80. }
  81.  
  82.  
  83. ButtonRun:
  84. if !Go
  85. {
  86.     TrayTip, Looking for match,Looking for match ,10   
  87.     Go:=True
  88.     SetTimer, aAccept, -10
  89.     SetTimer, refreshText, -10
  90.    
  91. }
  92. return
  93.  
  94.  
  95. ButtonStop:
  96.     stop()
  97. Return
  98.  
  99. GuiClose:
  100. ExitApp
  101.  
  102. stop(){
  103.     global
  104.     Go:=False
  105.     GuiControl, hide, Var
  106.     SetTimer, refreshText, Off
  107.     SetTimer, aAccept, Off
  108. }
  109.  
  110. found(){
  111.     global
  112.     stop()
  113.     GuiControl,show, Var,  
  114.     GuiControl,, Var, Match Found !
  115.     TrayTip, Match Found! , LOL Match Found! ,10   
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement