Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance Force
  2. global speed = 2            ;script speed modifiers
  3. global speed2 := speed/2
  4.  
  5. ssearchx=200                ;location where to search for button images
  6. ssearchy=300                ;s - start, e - end
  7. esearchx=900
  8. esearchy=800
  9.  
  10. xoffset=0                   ;offset search rectangle position
  11. yoffset=0
  12.  
  13. windowcheck=0               ;do check for location of a window?
  14. if windowcheck
  15. {
  16.     sleep 5000              ;delay after starting script
  17.     ImageSearch winlocx, winlocy, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%,*70 x.png
  18.         if ErrorLevel = 0   ;will look for the X button on window top rightmost corner
  19.         {
  20.         tooltip Window location offset point found here: %winlocx% %winlocy%, winlocx, winlocy
  21.         yoffset:=winlocy-10 ;y coordinate offset
  22.         sleep 100*speed
  23.         }
  24.     tooltip                 ;clean tooltip
  25.     sleep 100
  26.    
  27.     Tooltip Will look for buttons here:
  28.    
  29.     ssearchx+=xoffset
  30.     ssearchy+=yoffset
  31.     esearchx+=xoffset
  32.     esearchy+=yoffset
  33.    
  34.     tooltip %ssearchx% %ssearchy%, ssearchx, ssearchy, 2    ;positions indicating tooltips on top left and bottom right of search rectangle
  35.     tooltip %esearchx% %esearchy%, esearchx, esearchy, 3
  36.    
  37.     sleep 500*speed
  38. }
  39.  
  40. sleep 1000 ;===delete
  41. integerr = 0                ;champion name array index
  42. integerr2 = 0               ;next champion if previous failed
  43.  
  44. champname := ["talon", "leblanc", "amumu", "illaoi", "singed", "swain", "ziggs", "mordekaiser"] ;few champion name list
  45.  
  46.  
  47. ncx=102 ;nextchampx                     ;pixel offset to next champion on line
  48. ncy=96  ;nextchampy                     ;pixel offset to next champion on the row
  49. ycx=0   ;yourchampx                     ;select champion to play, outdated
  50. ycy=0   ;yourchampy
  51. bcx=0   ;banchampx                      ;select champion to ban, outdated
  52. bcy=0   ;banchampy
  53.  
  54.  
  55. again:
  56. If ProcessExist("League of Legends.exe")                                        ;functions within the game, disables other things
  57. {
  58.         ImageSearch  x, y, ssearchx, ssearchy, esearchx, esearchy+200,*30 q.png ;singed poison on
  59.         if ErrorLevel = 0
  60.         {  
  61.             Random beeprnd, 800, 900
  62.             SoundBeep beeprnd, 25                                               ;make aditional sound
  63.         }
  64.     sleep 25
  65.     goto again
  66. }
  67.  
  68.  
  69.  
  70. if (A_TimeIdlePhysical < 5000)                                                  ;sleep the script if user interacts
  71. {
  72.         tooltip
  73.         sleep 4000
  74.         goto again
  75.  
  76. }
  77. ToolTip, Waiting for a game    
  78. sleep 1000
  79. state=0                                                                         ;initiate state
  80. Sleep 100
  81. state = 1                                                                       ;accept the game
  82. Tooltip %state%
  83. ImageSearch  x, y, ssearchx, ssearchy, esearchx, esearchy,*30 accep.png         ;find flashy accept button
  84. if ErrorLevel = 0
  85.     goto found
  86.  
  87. state = 2                                                                       ;ban a champ
  88. Tooltip %state% %name%
  89. integerr = 1                                                                    ;odd
  90. cnrx=%bcx%                                                                      ;set champion number, outdated
  91. cnry=%bcy%
  92. ImageSearch  x, y, ssearchx, ssearchy, esearchx, esearchy,*30 banned.png        ;look for grey ban button
  93. if ErrorLevel = 0
  94.     goto found
  95.  
  96.  
  97. state = 3                                                                       ;lock in your champion
  98. integerr = 0                                                                    ;even
  99. Tooltip %state% %name%
  100. cnrx=%ycx%                                                                      ;set champion number, outdated
  101. cnry=%ycy%
  102. ImageSearch  x, y, ssearchx, ssearchy, esearchx, esearchy,*30 selec.png         ;look for grey lock in button
  103. if ErrorLevel != 0
  104.     goto again
  105.  
  106.  
  107. found:                                                                         ;perform actions for found state
  108. tooltip Found %state%
  109. sleep 500
  110. Random, rand, 1, 1000
  111. sleep %rand%
  112. sleep 100
  113.  
  114. if (A_TimeIdlePhysical < 5000)                                                  ;if user is active, do nothing
  115. {
  116.     sleep 4000
  117.     goto again
  118. }
  119.  
  120. if (state>1)                                            ;if a champion selection
  121. {
  122.     txtx:=x+150                                         ;textfield location offset if window check was used
  123.     txty:=y-515
  124.     tooltip txtx txty are %txtx% and %txty%
  125.     message=state2clicktxt
  126.     MouseMove, txtx, txty, 2
  127.     sleep 100*speed
  128.     myclick(txtx, txty, message)                        ;click function on textfield
  129.     sleep 100*speed
  130.     tooltip send %name%                                
  131.     sleep 1000
  132.     integerr3:=integerr+integerr2
  133.     thetext := champname[integerr3]
  134.     tooltip % thetext
  135.     typetext(thetext)             ;types in the champion name
  136.     integerr2 += 2     ;in case it fails, advance to other bannable champion on list
  137.    
  138.  
  139.  
  140.    champx:=x-270                                       ;outdated
  141.     champy:=y-460                                       ;outdated
  142.     sleep 100*speed
  143.     tooltip myclick champx bcx cnrx champy bcy cnry     myclick %champx% %bcx% %cnrx% %champy% %bcy% %cnry%
  144.     sleep 300*speed
  145.    
  146.     message=state2clickchamp
  147.     ;myclick(champx+(cnrx*ncx),champy+(cnry*ncy),message)   ;click on champion, outdated
  148.     myclick(x,y,message)                                    ;click on champion
  149.    
  150.     sleep 300*speed
  151.     ;ban and lock in
  152. }
  153.  
  154. ;=======OUTDATED======;
  155. {
  156. ;~ if (state=3)
  157. ;~ {
  158.     ;~ txtx:=x+160
  159.     ;~ txty:=y-515
  160.     ;~ tooltip txtx txty are %txtx% and %txty%
  161.     ;~ message=state2clicktxt
  162.     ;~ MouseMove, txtx, txty, 2
  163.     ;~ sleep 100*speed
  164.     ;~ myclick(txtx, txty, message)
  165.     ;~ sleep 100*speed
  166.     ;~ tooltip send si
  167.     ;~ SendRaw si
  168.     ;~ champx:=x-260
  169.     ;~ champy:=y-460
  170.     ;~ sleep 100*speed
  171.     ;~ tooltip myclick champx bcx cnrx champy bcy cnry     myclick %champx% %bcx% %cnrx% %champy% %bcy% %cnry%
  172.     ;~ sleep 300*speed
  173.     ;~ message=state3clickchamp
  174.     ;~ myclick(champx+(cnrx),champy+(cnry),message)
  175.     ;~ myclick(champx+(cnrx*ncx),champy+(cnry*ncy),message)
  176.     ;~ sleep 300*speed
  177.  
  178.     ;~ ;lock in
  179. ;~ }
  180. }
  181. ;======================;
  182.    
  183. if(state>0)
  184. {
  185.     rndwait()
  186.     messsage=clickbutton
  187.     myclick(x,y,message)
  188. }
  189.  
  190. goto again
  191.  
  192. myclick(x,y,message)                                            ;the custom pseoudorealistic click function
  193. {
  194.     tooltip CLICKING Got %x% %y% generating randoms %message%
  195.     sleep 200*speed2
  196.    
  197.     Random smx, 0, 40                                           ;generate bunch of random values to vary pixel location for mouse actions
  198.     Random smy, 0, 10                                           ;good values to keep within the button
  199.  
  200.     Random morecenterx, 0, 6                                    ;odds of better aiming, only if non-zero values will initiate aim-boost
  201.     Random morecentery, 0, 5
  202.  
  203.     Random smx2, 10, 30                                         ;how much more centered will the mouse be
  204.     Random smy2, 2, 10
  205.    
  206.     tooltip CLICKING generated randoms %smx% %smy% %morecenterx% %morecentery% %smx2% %smy2% %message%
  207.     sleep 50*speed2
  208.     finalmousex := x+smx                                        ;x, y - from image search are topleft corner, add offsets
  209.     finalmousey := y+smy
  210.     tooltip CLICKING generated randoms %smx% %smy% %morecenterx% %morecentery% %smx2% %smy2% finalmouse %finalmousex% %finalmousey% as from %x% and %y% %message%
  211.     sleep 150*speed2
  212.     tooltip CLICKING 1 2 %finalmousex% %finalmousey% %message%
  213.     sleep 100*speed2
  214.     if (morecenterx > 0)                                        ;if non-zero, center it more
  215.     {
  216.         finalmousex +=smx2
  217.     }
  218.    
  219.     if (morecentery > 0)
  220.     {
  221.         finalmousey +=smy2
  222.     }
  223.     Random randragx, 0,2                                        ;click and drag, to simulate not a precise pixel click
  224.     Random randragy, 0,3
  225.     MouseMove, finalmousex, finalmousey, 0
  226.     tooltip CLICKING 1 2 3 %finalmousex% %finalmousey% %message%
  227.     sleep 200*speed2
  228.     MouseClickDrag Left, finalmousex, finalmousey, finalmousex+randragx, finalmousey+randragy
  229.     tooltip CLICKING 1 2 3 4 %message%
  230.     sleep 200*speed2
  231.     MouseMove, 200+smx, 200+smy, 0
  232.     tooltip CLICKED 1 2 3 4 5 %message%
  233.     Sleep 200*speed2
  234. }
  235. return
  236.  
  237. rndwait()                                                       ;random duration waits
  238. {
  239.     Random srnd, 100, 500
  240.     sleep %srnd%
  241. }
  242. return
  243.  
  244. ProcessExist(Name){                                             ;wrapper
  245.     Process,Exist,%Name%
  246.     return Errorlevel
  247. }
  248.  
  249. typetext(thetext)                                               ;random delays between each key press
  250. {
  251.     textarray := StrSplit(thetext)
  252.     tooltip typetext %textarray%
  253.     Loop % textarray.MaxIndex()
  254.     {
  255.         Random r1, 10, 100
  256.         Random r2, 5, 10
  257.         SetKeyDelay r, r2
  258.         SendRaw % textarray[a_index]
  259.     }
  260. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement