Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;Basic League Tools - V3.0
- ;Created by Ruevil2
- ;Original 02-11-2015 -Pastebin http://pastebin.com/uvCtkgsm
- ;Revised 11-28-15
- ;
- ;Features:
- ;Auto-Login
- ; Auto-Accept EULA
- ; Auto-Restart League if it is open
- ; Multiple Account Support - NEW!!!
- ; Handles any number of accounts
- ; Choose account from tray menu, defaults to first account upon opening
- ;Auto-Join Queue
- ;Auto Accept Game - NEW!!!
- ;No ImageSearch - No external files to download
- ;Scales to ANY resolution
- ;Scales to ANY launcher size
- ;Scales to CPU speed
- ;Zero writing to hard disk
- ;Leave login var blank if you use "remember me"
- ;Prompt for password(It will ask every time) - I recommend hardcoding it for the SPEEDS...
- ;Automatic Champ List Update Via Riot Official API - This is the reason for the Key variable
- ; Links to 5 Different build pages for each champion
- ;Screen-Edge Move
- ; This prevents the mouse from moving your view when it touches the edge of the screen.
- ;
- ;HotKeys:
- ;F7 - Auto Login 1 - No auto start
- ;F8 - Auto Login 2 - No auto start
- ;F9 - Auto Login 3 - No auto start
- ;F12 - Reload Script
- ;
- ;!!!!!!!!!!!!!!!!Warning!!!!!!!!!!!!!!!!!!!
- ;You MUST do one of the following for this to work
- ;1)Hardcode Username
- ;2)Use the "Remember Me" option in the League client
- ;
- ;It is also recommended to use 'Run As Administrator' to run this script
- ;;;;;Login Info
- ;If you leave password blank you will be prompted for it every time
- ;To add another login just add another set of vars in the below form and
- ;the script will handle the rest. Logins 1-3 are bound to F7, F8 and F9.
- ;Login# =
- ;Pass# =
- ;Login 1
- Login1 =
- Pass1 =
- ;Login 2
- Login2 =
- Pass2 =
- ;Login 3
- Login3 =
- Pass3 =
- ;Default Login on Load: 1 = Login1, 2 = Login2 etc.
- lgn := 1
- ;;;;;;;;;;;;;;;;;;;;;;DON'T EDIT BELOW THIS LINE;;;;;;;;;;;;;;
- #SingleInstance, Force
- #Persistent
- CoordMode,Mouse,Window
- CoordMode,Pixel,Window
- OnExit, ExitSub
- ;;;;;Global Variables
- Key = 72f7888e-0a65-4f90-aeea-c08f3ae1a6bf
- If Key
- ChampListURL = https://na.api.pvp.net/api/lol/static-data/na/v1.2/champion?api_key=%key%
- ChampList := GetChampList(ChampListURL)
- If !ChampList
- 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"
- Confine = True
- global ColorA = 0xB36C0F
- IfExist C:\Riot Games\league of legends\lol.launcher.exe
- {
- RiotPath = C:\Riot Games\league of legends\lol.launcher.exe
- Menu, Tray, Icon, %RiotPath%, 1
- }
- else
- {
- x = 0
- SelectLeague:
- FileSelectFile, RiotPath, 3, C:\, Select League Launcher, *.exe
- if RiotPath =
- {
- x++
- If x = 3
- {
- MsgBox, League must be located to use this program.
- Goto, ExitSub
- }
- Goto, SelectLeague
- }
- Menu, Tray, Icon, %RiotPath%, 1
- }
- ;;;;;Tray Menu Setup
- Menu, Tray, Tip, Basic League Tools V1.0(5.23+) 11/27/15
- Menu, Tray, NoStandard
- If ChampList
- {
- StringSplit, Count, ChampList, |
- Loop % Count0
- {
- Champ := Count%A_Index%
- Menu, %Champ%, Add, MobaFire, Guides
- Menu, %Champ%, Add, LOLKing, Guides
- Menu, %Champ%, Add, LOLPro, Guides
- Menu, %Champ%, Add, SoloMid, Guides
- Menu, %Champ%, Add, ProBuilds, Guides
- }
- Loop % Count0
- {
- Champ := Count%A_Index%
- Menu, GuideMenu, Add, %Champ%, :%Champ%
- }
- Menu, Tray, Add, Champion Guides, :GuideMenu
- Champ =
- }
- Menu, Tray, Add, ScreenEdge Off, Tools
- If Login1
- {
- Loop
- {
- If (Login%A_Index%)
- {
- l := Login%A_Index%
- Menu, Accounts, Add, %l%, Tools
- }
- Else
- break
- }
- Menu, Tray, Add, Select Account, :Accounts
- }
- Menu, Selections5, Add, 5v5 Team Builder, AutoStart
- Menu, Selections5, Add, 5v5 Blind Pick, AutoStart
- Menu, Selections5, Add, 5v5 Draft Pick, AutoStart
- Menu, Selections5, Add, 5v5 Ranked Solo/Duo, AutoStart
- Menu, Selections3, Add, 3v3 Blind Pick, AutoStart
- Menu, Selections, Add, 5v5, :Selections5
- Menu, Selections, Add, 3v3, :Selections3
- Menu, SelectionsD, Add, Dominion Blind Pick, AutoStart
- Menu, SelectionsD, Add, Dominion Draft Pick, AutoStart
- Menu, Selections, Add, Dominion, :SelectionsD
- Menu, Selections, Add, ARAM, AutoStart
- Menu, Tray, Add, Start League, :Selections
- Menu, Tray, Add
- Menu, Tray, Add, Exit Script, ExitSub
- if not A_IsAdmin
- Run *RunAs "%A_ScriptFullPath%"
- Return
- F7::
- Login(Login1, Pass1, RiotPath)
- return
- F8::
- Login(Login2, Pass2, RiotPath)
- return
- F9::
- Login(Login3, Pass3, RiotPath)
- return
- F12::
- reload
- return
- AutoStart:
- t := A_ThisMenuItem
- Login(Login%lgn%, Pass%lgn%, Riotpath)
- Start(t)
- AutoAccept()
- return
- Guides:
- StringLower, a, A_ThisMenu
- IfEqual, A_ThisMenuItem, MobaFire, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
- IfEqual, A_ThisMenuItem, ProBuilds, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
- IfEqual, A_ThisMenuItem, SoloMid, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
- IfEqual, A_ThisMenuItem, LOLPro, Run, http://www.mobafire.com/league-of-legends/%A_ThisMenu%-guide
- IfEqual, A_ThisMenuItem, LOLKing, Run, http://www.mobafire.com/league-of-legends/%a%-guide
- return
- Tools:
- If A_ThisMenuItem = ScreenEdge Off
- {
- Menu, Tray, ToggleCheck, ScreenEdge Off
- Menu, Tray, Rename, ScreenEdge Off, ScreenEdge On
- SetTimer, ScreenEdge, 250
- }
- else If A_ThisMenuItem = ScreenEdge On
- {
- Menu, Tray, ToggleCheck, ScreenEdge On
- Menu, Tray, Rename, ScreenEdge On, ScreenEdge Off
- SetTimer, ScreenEdge, Off
- Sleep, 100
- ClipCursor(Confine)
- }
- IfEqual, A_ThisMenu, Accounts, lgn := A_ThisMenuItemPos
- return
- ScreenEdge:
- ClipCursor( Confine, 13, 13, A_screenwidth-13, A_screenheight-13)
- Return
- Login(u="", p="", installloc="")
- {
- Run, %installloc%
- WinActivate, ahk_class splashscreenclassname
- Loop, 20
- {
- if WinExist("ahk_class #32770")
- {
- Sleep, 100
- WinActivate, ahk_class #32770
- Send, {Enter}
- }
- else if WinExist("ahk_class LOLPATCHER")
- break
- }
- Sleep, 100
- WinActivate, ahk_class LOLPATCHER
- WinGetPos,,, w, h, A
- b = 0
- Loop
- {
- WinActivate, ahk_class LOLPATCHER
- x := w / 2
- y := h * .025
- Notready:
- PixelGetColor, a_Play, x, y, RGB
- ColDistO := Distance(colorA, a_Play)
- If ColDistO > 30
- Goto, NotReady
- If ColorCross(x, y, colorA, 30)
- {
- Sleep, 100
- MouseClick, left, %x%, %y%, , 0
- break
- }
- Sleep 250
- b++
- if b = 50
- {
- MsgBox, Something went wrong, please close everything and try again.
- ExitApp
- }
- }
- Sleep, 250
- b = 0
- Loop,
- {
- if WinExist("ahk_class ApolloRuntimeContentWindow")
- break
- else
- {
- Sleep, 250
- if WinExist("ahk_class LOLPATCHER")
- {
- WinGetPos,,, w, h, A
- MouseClick, Left, (w*.39), (h*.77),,0
- }
- b++
- if b = 50
- {
- MsgBox, Something went wrong, please close everything and try again.
- ExitApp
- }
- }
- }
- Sleep, 100
- WinActivate, ahk_class ApolloRuntimeContentWindow
- WinWaitActive ahk_class ApolloRuntimeContentWindow
- WinGetPos,,, w, h, A
- b = 0
- Sleep, 100
- If !p
- InputBox, p, Password, Enter your password to continue.
- If !p
- ExitApp
- Sleep, 100
- WinActivate, ahk_class ApolloRuntimeContentWindow
- Loop
- {
- PixelGetColor, a, (w*.2), (h*.4)
- Dist := Distance(0xFFFFFF, a)
- if (Dist < 25)
- {
- Sleep, 100
- break
- }
- Sleep 100
- b++
- if b = 50
- {
- MsgBox, Something went wrong, please close everything and try again.
- ExitApp
- }
- }
- MouseClick, Left, (w*.2), (h*.4),,0
- MouseClick, Left, (w*.2), (h*.4),,0
- Sleep, 100
- Send, %u%
- Sleep, 100
- MouseClick, left, (w*.2), (h*.485),,0
- Sleep, 100
- Send, %p%
- MouseClick, Left, (w*.28), (h*.53),,0
- Sleep, 100
- Loop
- {
- NotReady2:
- WinActivate, ahk_class ApolloRuntimeContentWindow
- PixelGetColor, a_Play, (w / 2), (h * .025), RGB
- ColDist1 := Distance(colorA, a_Play)
- If ColDist1 < 40
- break
- else
- Goto, NotReady2
- Sleep 100
- b++
- if b = 50
- {
- MsgBox, Something went wrong, please close everything and try again.
- ExitApp
- }
- }
- Sleep, 100
- return
- }
- Start(type1)
- {
- StartSleep := 100
- WinGetPos,,, w, h, A
- Sleep, 250
- MouseClick, left, (w / 2), (h * .025),,0
- Sleep, 25
- MouseClick, left, (w / 2), (h * .025),,0
- Sleep, 250
- MouseMove, 290, 115
- MouseClick, left, 290, 115,,0
- If type1 = ARAM
- {
- MouseMove, (w*.42),(h*.26)
- MouseClick, left, (w*.42),(h*.26),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.19)
- MouseClick, left, (w*.68),(h*.19),,0
- Sleep, %StartSleep%
- }
- else if type1 = Dominion Blind Pick
- {
- MouseMove, (w*.42),(h*.22)
- MouseClick, left, (w*.42),(h*.22),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.19)
- MouseClick, left, (w*.68),(h*.19),,0
- Sleep, %StartSleep%
- }
- else if type1 = Dominion Draft Pick
- {
- MouseMove, (w*.42),(h*.22)
- MouseClick, left, (w*.42),(h*.22),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.24)
- MouseClick, left, (w*.68),(h*.24),,0
- Sleep, %StartSleep%
- }
- else if type1 = 5v5 Team Builder
- {
- MouseMove, (w*.42),(h*.18)
- MouseClick, left, (w*.42),(h*.18),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.19)
- MouseClick, left, (w*.68),(h*.19),,0
- Sleep, %StartSleep%
- }
- else if type1 = 5v5 Blind Pick
- {
- MouseMove, (w*.42),(h*.18)
- MouseClick, left, (w*.42),(h*.18),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.24)
- MouseClick, left, (w*.68),(h*.24),,0
- Sleep, %StartSleep%
- }
- else if type1 = 5v5 Draft Pick
- {
- MouseMove, (w*.42),(h*.18)
- MouseClick, left, (w*.42),(h*.18),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.29)
- MouseClick, left, (w*.68),(h*.29),,0
- Sleep, %StartSleep%
- }
- else if type1 = 5v5 Ranked Solo/Duo
- {
- MouseMove, (w*.42),(h*.18)
- MouseClick, left, (w*.42),(h*.18),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.19)
- MouseClick, left, (w*.60),(h*.19),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.34)
- MouseClick, left, (w*.68),(h*.34),,0
- Sleep, %StartSleep%
- }
- else if type1 = 3v3 Blind Pick
- {
- MouseMove, (w*.42),(h*.18)
- MouseClick, left, (w*.42),(h*.18),,0
- Sleep, %StartSleep%
- MouseMove, (w*.60),(h*.24)
- MouseClick, left, (w*.60),(h*.24),,0
- Sleep, %StartSleep%
- MouseMove, (w*.68),(h*.19)
- MouseClick, left, (w*.68),(h*.19),,0
- Sleep, %StartSleep%
- }
- MouseMove, (w*.62),(h*.88)
- MouseClick, left, (w*.62),(h*.88),,0
- Sleep, 100
- }
- AutoAccept()
- {
- colorB := "0x1E4574"
- Sleep, 250
- Loop
- {
- IfWinActive, ahk_class ApolloRuntimeContentWindow
- {
- WinGetPos,,, mWi, mHi, A
- x := (mWi * .40)
- y := (mHi * .55)
- If ColorCross(x, y, colorB, 20)
- {
- Sleep, 500
- MouseMove, %x%, %y%
- Click, %x%, %y%
- return
- }
- }
- If A_Index = 50
- return
- Sleep, 1000
- }
- }
- GetChampList(url)
- {
- global ChampCount
- ComObjError(0)
- WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- WebRequest.Open("GET", URL)
- WebRequest.Send()
- str := WebRequest.ResponseText(), ComObjError(0)
- StringReplace, str, str, `",,All ;"
- StringReplace, str, str, `,, %A_Space%,All
- StringReplace, str, str, name, name, UseErrorLevel
- ChampCount := ErrorLevel
- Pos = 1
- Loop, %ChampCount%
- {
- Pos := (RegExMatch(str, "name:(.*?)\stitle:", Champs, Pos)) + 2
- If A_Index = 1
- NameList = %Champs1%
- else
- NameList = %NameList%|%Champs1%
- }
- Sort, NameList, D`|
- return NameList
- }
- ClipCursor(Confine=True, x1=0 , y1=0, x2=1920, y2=1080)
- {
- VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
- Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
- }
- ColorCross(x, y, col, v)
- {
- PixelGetColor, b, x, (y + 1), RGB
- PixelGetColor, c, x, (y - 1), RGB
- PixelGetColor, d, (x + 1), y, RGB
- PixelGetColor, e, (x - 1), y, RGB
- CDA := Distance(col, b)
- CDB := Distance(col, c)
- CDC := Distance(col, d)
- CDD := Distance(col, e)
- if (CDA < v and CDB < v and CDC < v and CDD < v)
- return True
- Else
- return False
- }
- Distance(c1, c2)
- { ; function by [VxE], return value range = [0, 441.67295593006372]
- r1 := c1 >> 16
- g1 := c1 >> 8 & 255
- b1 := c1 & 255
- r2 := c2 >> 16
- g2 := c2 >> 8 & 255
- b2 := c2 & 255
- return Sqrt( (r1-r2)**2 + (g1-g2)**2 + (b1-b2)**2 )
- }
- ExitSub:
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement