Advertisement
Guest User

League Tools V3.0

a guest
Nov 28th, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;Basic League Tools - V3.0
  3. ;Created by Ruevil2
  4. ;Original 02-11-2015    -Pastebin http://pastebin.com/uvCtkgsm
  5. ;Revised  11-28-15
  6. ;
  7. ;Features:
  8. ;Auto-Login
  9. ;   Auto-Accept EULA
  10. ;   Auto-Restart League if it is open
  11. ;   Multiple Account Support - NEW!!!
  12. ;       Handles any number of accounts
  13. ;       Choose account from tray menu, defaults to first account upon opening
  14. ;Auto-Join Queue
  15. ;Auto Accept Game - NEW!!!
  16. ;No ImageSearch - No external files to download
  17. ;Scales to ANY resolution
  18. ;Scales to ANY launcher size
  19. ;Scales to CPU speed
  20. ;Zero writing to hard disk
  21. ;Leave login var blank if you use "remember me"
  22. ;Prompt for password(It will ask every time)   -  I recommend hardcoding it for the SPEEDS...
  23. ;Automatic Champ List Update Via Riot Official API - This is the reason for the Key variable
  24. ;   Links to 5 Different build pages for each champion
  25. ;Screen-Edge Move
  26. ;   This prevents the mouse from moving your view when it touches the edge of the screen.
  27. ;
  28. ;HotKeys:
  29. ;F7 - Auto Login 1 - No auto start
  30. ;F8 - Auto Login 2 - No auto start
  31. ;F9 - Auto Login 3 - No auto start
  32. ;F12 - Reload Script
  33. ;
  34. ;!!!!!!!!!!!!!!!!Warning!!!!!!!!!!!!!!!!!!!
  35. ;You MUST do one of the following for this to work
  36. ;1)Hardcode Username
  37. ;2)Use the "Remember Me" option in the League client
  38. ;
  39. ;It is also recommended to use 'Run As Administrator' to run this script
  40.  
  41. ;;;;;Login Info
  42. ;If you leave password blank you will be prompted for it every time
  43. ;To add another login just add another set of vars in the below form and
  44. ;the script will handle the rest. Logins 1-3 are bound to F7, F8 and F9.
  45. ;Login# =
  46. ;Pass# =
  47.  
  48. ;Login 1
  49. Login1 =
  50. Pass1 =
  51.  
  52. ;Login 2
  53. Login2 =
  54. Pass2 =
  55.  
  56. ;Login 3
  57. Login3 =
  58. Pass3 =
  59.  
  60. ;Default Login on Load: 1 = Login1, 2 = Login2 etc.
  61. lgn := 1
  62.  
  63. ;;;;;;;;;;;;;;;;;;;;;;DON'T EDIT BELOW THIS LINE;;;;;;;;;;;;;;
  64. #SingleInstance, Force
  65. #Persistent
  66. CoordMode,Mouse,Window
  67. CoordMode,Pixel,Window
  68. OnExit, ExitSub
  69.  
  70. ;;;;;Global Variables
  71. Key = 72f7888e-0a65-4f90-aeea-c08f3ae1a6bf
  72. If Key
  73.     ChampListURL = https://na.api.pvp.net/api/lol/static-data/na/v1.2/champion?api_key=%key%
  74. ChampList := GetChampList(ChampListURL)
  75. If !ChampList
  76.     ChampList := "Aatrox|Ahri|Akali|Alistar|Amumu|Anivia|Annie|Ashe|Azir|Bard|Blitzcrank|Brand|Braum|Caitlyn|Cassiopeia|Cho'Gath|Corki|Darius|Diana|Dr. Mundo|Draven|Ekko|Elise|Evelynn|Ezreal|Fiddlesticks|Fiora|Fizz|Galio|Gangplank|Garen|Gnar|Gragas|Graves|Hecarim|Heimerdinger|Illaoi|Irelia|Janna|Jarvan IV|Jax|Jayce|Jinx|Kalista|Karma|Karthus|Kassadin|Katarina|Kayle|Kennen|Kha'Zix|Kindred|Kog'Maw|LeBlanc|Lee Sin|Leona|Lissandra|Lucian|Lulu|Lux|Malphite|Malzahar|Maokai|Master Yi|Miss Fortune|Mordekaiser|Morgana|Nami|Nasus|Nautilus|Nidalee|Nocturne|Nunu|Olaf|Orianna|Pantheon|Poppy|Quinn|Rammus|Rek'Sai|Renekton|Rengar|Riven|Rumble|Ryze|Sejuani|Shaco|Shen|Shyvana|Singed|Sion|Sivir|Skarner|Sona|Soraka|Swain|Syndra|Tahm Kench|Talon|Taric|Teemo|Thresh|Tristana|Trundle|Tryndamere|Twisted Fate|Twitch|Udyr|Urgot|Varus|Vayne|Veigar|Vel'Koz|Vi|Viktor|Vladimir|Volibear|Warwick|Wukong|Xerath|Xin Zhao|Yasuo|Yorick|Zac|Zed|Ziggs|Zilean|Zyra"
  77. Confine = True
  78. global ColorA = 0xB36C0F
  79.  
  80. IfExist C:\Riot Games\league of legends\lol.launcher.exe
  81. {
  82.     RiotPath = C:\Riot Games\league of legends\lol.launcher.exe
  83.     Menu, Tray, Icon, %RiotPath%, 1
  84. }
  85. else
  86. {
  87.     x = 0
  88.     SelectLeague:
  89.     FileSelectFile, RiotPath, 3, C:\, Select League Launcher, *.exe
  90.     if RiotPath =
  91.     {
  92.         x++
  93.         If x = 3
  94.         {
  95.             MsgBox, League must be located to use this program.
  96.             Goto, ExitSub
  97.         }
  98.         Goto, SelectLeague
  99.     }
  100.     Menu, Tray, Icon, %RiotPath%, 1
  101. }
  102.  
  103. ;;;;;Tray Menu Setup
  104. Menu, Tray, Tip, Basic League Tools V1.0(5.23+) 11/27/15
  105. Menu, Tray, NoStandard
  106. If ChampList
  107. {
  108.     StringSplit, Count, ChampList, |
  109.     Loop % Count0
  110.     {
  111.         Champ := Count%A_Index%
  112.         Menu, %Champ%, Add, MobaFire, Guides
  113.         Menu, %Champ%, Add, LOLKing, Guides
  114.         Menu, %Champ%, Add, LOLPro, Guides
  115.         Menu, %Champ%, Add, SoloMid, Guides
  116.         Menu, %Champ%, Add, ProBuilds, Guides
  117.     }
  118.     Loop % Count0
  119.     {
  120.         Champ := Count%A_Index%
  121.         Menu, GuideMenu, Add, %Champ%, :%Champ%
  122.     }
  123.     Menu, Tray, Add, Champion Guides, :GuideMenu
  124.     Champ =
  125. }
  126. Menu, Tray, Add, ScreenEdge Off, Tools
  127. If Login1
  128. {
  129.     Loop
  130.     {
  131.         If (Login%A_Index%)
  132.         {
  133.             l := Login%A_Index%
  134.             Menu, Accounts, Add, %l%, Tools
  135.         }
  136.         Else
  137.             break
  138.     }
  139.     Menu, Tray, Add, Select Account, :Accounts
  140. }
  141. Menu, Selections5, Add, 5v5 Team Builder, AutoStart
  142. Menu, Selections5, Add, 5v5 Blind Pick, AutoStart
  143. Menu, Selections5, Add, 5v5 Draft Pick, AutoStart
  144. Menu, Selections5, Add, 5v5 Ranked Solo/Duo, AutoStart
  145. Menu, Selections3, Add, 3v3 Blind Pick, AutoStart
  146. Menu, Selections, Add, 5v5, :Selections5
  147. Menu, Selections, Add, 3v3, :Selections3
  148. Menu, SelectionsD, Add, Dominion Blind Pick, AutoStart
  149. Menu, SelectionsD, Add, Dominion Draft Pick, AutoStart
  150. Menu, Selections, Add, Dominion, :SelectionsD
  151. Menu, Selections, Add, ARAM, AutoStart
  152. Menu, Tray, Add, Start League, :Selections
  153. Menu, Tray, Add
  154. Menu, Tray, Add, Exit Script, ExitSub
  155.  
  156. if not A_IsAdmin
  157.     Run *RunAs "%A_ScriptFullPath%"
  158.    
  159. Return
  160.  
  161. F7::
  162.     Login(Login1, Pass1, RiotPath)
  163. return
  164.  
  165. F8::
  166.     Login(Login2, Pass2, RiotPath)
  167. return
  168.  
  169. F9::
  170.     Login(Login3, Pass3, RiotPath)
  171. return
  172.  
  173. F12::
  174.     reload
  175. return
  176.  
  177. AutoStart:
  178.     t := A_ThisMenuItem
  179.     Login(Login%lgn%, Pass%lgn%, Riotpath)
  180.     Start(t)
  181.     AutoAccept()
  182. return
  183.  
  184. Guides:
  185.     StringLower, a, A_ThisMenu
  186.     IfEqual, A_ThisMenuItem, MobaFire, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
  187.     IfEqual, A_ThisMenuItem, ProBuilds, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
  188.     IfEqual, A_ThisMenuItem, SoloMid, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
  189.     IfEqual, A_ThisMenuItem, LOLPro, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
  190.     IfEqual, A_ThisMenuItem, LOLKing, Run, http://www.mobafire.com/league-of-legends/%a%-guide
  191. return
  192.    
  193. Tools:
  194.     If A_ThisMenuItem = ScreenEdge Off
  195.     {
  196.         Menu, Tray, ToggleCheck, ScreenEdge Off
  197.         Menu, Tray, Rename, ScreenEdge Off, ScreenEdge On
  198.         SetTimer, ScreenEdge, 250
  199.     }
  200.     else If A_ThisMenuItem = ScreenEdge On
  201.     {
  202.         Menu, Tray, ToggleCheck, ScreenEdge On
  203.         Menu, Tray, Rename, ScreenEdge On, ScreenEdge Off
  204.         SetTimer, ScreenEdge, Off
  205.         Sleep, 100
  206.         ClipCursor(Confine)
  207.     }
  208.     IfEqual, A_ThisMenu, Accounts, lgn := A_ThisMenuItemPos
  209. return
  210.  
  211. ScreenEdge:
  212.     ClipCursor( Confine, 13, 13, A_screenwidth-13, A_screenheight-13)
  213. Return
  214.  
  215. Login(u="", p="", installloc="")
  216. {
  217.     Run, %installloc%
  218.     WinActivate, ahk_class splashscreenclassname
  219.     Loop, 20
  220.     {
  221.         if WinExist("ahk_class #32770")
  222.         {
  223.             Sleep, 100
  224.             WinActivate, ahk_class #32770
  225.             Send, {Enter}
  226.         }
  227.         else if WinExist("ahk_class LOLPATCHER")
  228.             break
  229.     }
  230.     Sleep, 100
  231.     WinActivate, ahk_class LOLPATCHER
  232.     WinGetPos,,, w, h, A
  233.     b = 0
  234.     Loop
  235.     {
  236.         WinActivate, ahk_class LOLPATCHER
  237.         x := w / 2
  238.         y := h * .025
  239.         Notready:
  240.         PixelGetColor, a_Play, x, y, RGB
  241.         ColDistO := Distance(colorA, a_Play)
  242.         If ColDistO > 30
  243.             Goto, NotReady
  244.        
  245.         If ColorCross(x, y, colorA, 30)
  246.         {
  247.             Sleep, 100
  248.             MouseClick, left, %x%, %y%, , 0
  249.             break
  250.         }
  251.         Sleep 250
  252.         b++
  253.         if b = 50
  254.         {
  255.             MsgBox, Something went wrong, please close everything and try again.
  256.             ExitApp
  257.         }
  258.     }
  259.     Sleep, 250
  260.     b = 0
  261.     Loop,
  262.     {
  263.         if WinExist("ahk_class ApolloRuntimeContentWindow")
  264.             break
  265.         else
  266.         {
  267.             Sleep, 250
  268.             if WinExist("ahk_class LOLPATCHER")
  269.             {
  270.                 WinGetPos,,, w, h, A
  271.                 MouseClick, Left, (w*.39), (h*.77),,0
  272.             }
  273.             b++
  274.             if b = 50
  275.             {
  276.                 MsgBox, Something went wrong, please close everything and try again.
  277.                 ExitApp
  278.             }
  279.         }
  280.     }
  281.     Sleep, 100
  282.     WinActivate, ahk_class ApolloRuntimeContentWindow
  283.     WinWaitActive ahk_class ApolloRuntimeContentWindow
  284.     WinGetPos,,, w, h, A
  285.     b = 0
  286.     Sleep, 100
  287.     If !p
  288.         InputBox, p, Password, Enter your password to continue.
  289.        
  290.     If !p
  291.         ExitApp
  292.    
  293.     Sleep, 100
  294.     WinActivate, ahk_class ApolloRuntimeContentWindow
  295.    
  296.     Loop
  297.     {
  298.         PixelGetColor, a, (w*.2), (h*.4)
  299.         Dist := Distance(0xFFFFFF, a)
  300.         if (Dist < 25)
  301.         {
  302.             Sleep, 100
  303.             break
  304.         }
  305.         Sleep 100
  306.         b++
  307.         if b = 50
  308.         {
  309.             MsgBox, Something went wrong, please close everything and try again.
  310.             ExitApp
  311.         }
  312.     }
  313.     MouseClick, Left, (w*.2), (h*.4),,0
  314.     MouseClick, Left, (w*.2), (h*.4),,0
  315.     Sleep, 100
  316.     Send, %u%
  317.     Sleep, 100
  318.     MouseClick, left, (w*.2), (h*.485),,0
  319.     Sleep, 100
  320.     Send, %p%
  321.     MouseClick, Left, (w*.28), (h*.53),,0
  322.     Sleep, 100
  323.  
  324.     Loop
  325.     {
  326.         NotReady2:
  327.         WinActivate, ahk_class ApolloRuntimeContentWindow
  328.         PixelGetColor, a_Play, (w / 2), (h * .025), RGB
  329.         ColDist1 := Distance(colorA, a_Play)
  330.         If ColDist1 < 40
  331.             break
  332.         else
  333.             Goto, NotReady2
  334.  
  335.         Sleep 100
  336.         b++
  337.         if b = 50
  338.         {
  339.             MsgBox, Something went wrong, please close everything and try again.
  340.             ExitApp
  341.         }
  342.     }
  343.     Sleep, 100
  344.     return
  345. }
  346.  
  347. Start(type1)
  348. {
  349.     StartSleep := 100
  350.     WinGetPos,,, w, h, A
  351.     Sleep, 250
  352.     MouseClick, left, (w / 2), (h * .025),,0
  353.     Sleep, 25
  354.     MouseClick, left, (w / 2), (h * .025),,0
  355.     Sleep, 250
  356.     MouseMove, 290, 115
  357.     MouseClick, left, 290, 115,,0
  358.     If type1 = ARAM
  359.     {
  360.         MouseMove, (w*.42),(h*.26)
  361.         MouseClick, left, (w*.42),(h*.26),,0
  362.         Sleep, %StartSleep%
  363.         MouseMove, (w*.60),(h*.19)
  364.         MouseClick, left, (w*.60),(h*.19),,0
  365.         Sleep, %StartSleep%
  366.         MouseMove, (w*.68),(h*.19)
  367.         MouseClick, left, (w*.68),(h*.19),,0
  368.         Sleep, %StartSleep%
  369.     }
  370.     else if type1 = Dominion Blind Pick
  371.     {
  372.         MouseMove, (w*.42),(h*.22)
  373.         MouseClick, left, (w*.42),(h*.22),,0
  374.         Sleep, %StartSleep%
  375.         MouseMove, (w*.60),(h*.19)
  376.         MouseClick, left, (w*.60),(h*.19),,0
  377.         Sleep, %StartSleep%
  378.         MouseMove, (w*.68),(h*.19)
  379.         MouseClick, left, (w*.68),(h*.19),,0
  380.         Sleep, %StartSleep%
  381.     }
  382.     else if type1 = Dominion Draft Pick
  383.     {
  384.         MouseMove, (w*.42),(h*.22)
  385.         MouseClick, left, (w*.42),(h*.22),,0
  386.         Sleep, %StartSleep%
  387.         MouseMove, (w*.60),(h*.19)
  388.         MouseClick, left, (w*.60),(h*.19),,0
  389.         Sleep, %StartSleep%
  390.         MouseMove, (w*.68),(h*.24)
  391.         MouseClick, left, (w*.68),(h*.24),,0
  392.         Sleep, %StartSleep%
  393.     }
  394.     else if type1 = 5v5 Team Builder
  395.     {
  396.         MouseMove, (w*.42),(h*.18)
  397.         MouseClick, left, (w*.42),(h*.18),,0
  398.         Sleep, %StartSleep%
  399.         MouseMove, (w*.60),(h*.19)
  400.         MouseClick, left, (w*.60),(h*.19),,0
  401.         Sleep, %StartSleep%
  402.         MouseMove, (w*.68),(h*.19)
  403.         MouseClick, left, (w*.68),(h*.19),,0
  404.         Sleep, %StartSleep%
  405.     }
  406.     else if type1 = 5v5 Blind Pick
  407.     {
  408.         MouseMove, (w*.42),(h*.18)
  409.         MouseClick, left, (w*.42),(h*.18),,0
  410.         Sleep, %StartSleep%
  411.         MouseMove, (w*.60),(h*.19)
  412.         MouseClick, left, (w*.60),(h*.19),,0
  413.         Sleep, %StartSleep%
  414.         MouseMove, (w*.68),(h*.24)
  415.         MouseClick, left, (w*.68),(h*.24),,0
  416.         Sleep, %StartSleep%
  417.     }
  418.     else if type1 = 5v5 Draft Pick
  419.     {
  420.         MouseMove, (w*.42),(h*.18)
  421.         MouseClick, left, (w*.42),(h*.18),,0
  422.         Sleep, %StartSleep%
  423.         MouseMove, (w*.60),(h*.19)
  424.         MouseClick, left, (w*.60),(h*.19),,0
  425.         Sleep, %StartSleep%
  426.         MouseMove, (w*.68),(h*.29)
  427.         MouseClick, left, (w*.68),(h*.29),,0
  428.         Sleep, %StartSleep%
  429.     }
  430.     else if type1 = 5v5 Ranked Solo/Duo
  431.     {
  432.         MouseMove, (w*.42),(h*.18)
  433.         MouseClick, left, (w*.42),(h*.18),,0
  434.         Sleep, %StartSleep%
  435.         MouseMove, (w*.60),(h*.19)
  436.         MouseClick, left, (w*.60),(h*.19),,0
  437.         Sleep, %StartSleep%
  438.         MouseMove, (w*.68),(h*.34)
  439.         MouseClick, left, (w*.68),(h*.34),,0
  440.         Sleep, %StartSleep%
  441.     }
  442.     else if type1 = 3v3 Blind Pick
  443.     {
  444.         MouseMove, (w*.42),(h*.18)
  445.         MouseClick, left, (w*.42),(h*.18),,0
  446.         Sleep, %StartSleep%
  447.         MouseMove, (w*.60),(h*.24)
  448.         MouseClick, left, (w*.60),(h*.24),,0
  449.         Sleep, %StartSleep%
  450.         MouseMove, (w*.68),(h*.19)
  451.         MouseClick, left, (w*.68),(h*.19),,0
  452.         Sleep, %StartSleep%
  453.     }
  454.     MouseMove, (w*.62),(h*.88)
  455.     MouseClick, left, (w*.62),(h*.88),,0
  456.     Sleep, 100
  457. }
  458.  
  459. AutoAccept()
  460. {
  461.     colorB := "0x1E4574"
  462.     Sleep, 250
  463.     Loop
  464.     {
  465.         IfWinActive, ahk_class ApolloRuntimeContentWindow
  466.         {
  467.             WinGetPos,,, mWi, mHi, A
  468.             x := (mWi * .40)
  469.             y := (mHi * .55)
  470.             If ColorCross(x, y, colorB, 20)
  471.             {
  472.                 Sleep, 500
  473.                 MouseMove, %x%, %y%
  474.                 Click, %x%, %y%
  475.                 return
  476.             }
  477.         }
  478.         If A_Index = 50
  479.             return
  480.         Sleep, 1000
  481.     }
  482. }
  483.  
  484. GetChampList(url)
  485. {
  486.     global ChampCount
  487.     ComObjError(0)
  488.     WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  489.     WebRequest.Open("GET", URL)
  490.     WebRequest.Send()
  491.     str := WebRequest.ResponseText(), ComObjError(0)
  492.     StringReplace, str, str, `",,All    ;"
  493.     StringReplace, str, str, `,, %A_Space%,All
  494.     StringReplace, str, str, name, name, UseErrorLevel
  495.     ChampCount := ErrorLevel
  496.     Pos = 1
  497.     Loop, %ChampCount%
  498.     {
  499.         Pos := (RegExMatch(str, "name:(.*?)\stitle:", Champs, Pos)) + 2
  500.         If A_Index = 1
  501.             NameList = %Champs1%
  502.         else
  503.             NameList = %NameList%|%Champs1%
  504.     }
  505.     Sort, NameList, D`|
  506.     return NameList
  507. }
  508.  
  509. ClipCursor(Confine=True, x1=0 , y1=0, x2=1920, y2=1080)
  510. {
  511.     VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
  512.     Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
  513. }
  514.  
  515. ColorCross(x, y, col, v)
  516. {
  517.     PixelGetColor, b, x, (y + 1), RGB
  518.     PixelGetColor, c, x, (y - 1), RGB
  519.     PixelGetColor, d, (x + 1), y, RGB
  520.     PixelGetColor, e, (x - 1), y, RGB
  521.     CDA := Distance(col, b)
  522.     CDB := Distance(col, c)
  523.     CDC := Distance(col, d)
  524.     CDD := Distance(col, e)
  525.     if (CDA < v and CDB < v and CDC < v and CDD < v)
  526.         return True
  527.     Else
  528.         return False
  529. }
  530.  
  531. Distance(c1, c2)
  532. { ; function by [VxE], return value range = [0, 441.67295593006372]
  533.    r1 := c1 >> 16
  534.    g1 := c1 >> 8 & 255
  535.    b1 := c1 & 255
  536.    r2 := c2 >> 16
  537.    g2 := c2 >> 8 & 255
  538.    b2 := c2 & 255
  539.    return Sqrt( (r1-r2)**2 + (g1-g2)**2 + (b1-b2)**2 )
  540. }
  541.  
  542. ExitSub:
  543.     ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement