Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #singleinstance force
- coordmode, mouse, screen
- coordmode, pixel, screen
- SetTitleMatchMode 2
- global user := ""
- global pass := ""
- global colors := ["0x974444", "0xAD3736"]
- global xplus := [30, 60]
- global yplus := [30, 60]
- global side := 0
- global pause := 0
- global gromp := [1311, 760, 1436, 782]
- global blue := [1325, 765, 1420, 777]
- global wolves := [1328, 782, 1419, 760]
- global wraiths := [1366, 799, 1377, 744]
- global red := [1374, 813, 1372, 728]
- global golems := [1386, 829, 1362, 712]
- FileRead, info, info.txt
- if !info
- {
- InputBox info
- FileAppend, %info%, info.txt
- }
- Loop, read, E:\inf.txt
- {
- StringReplace, inline, A_LoopReadLine, %A_Tab%, %A_Space%, All
- Array := StrSplit(inline, A_Space)
- if Array[1] = info
- {
- user := Array[2]
- pass := Array[3]
- }
- }
- press2("lwin", "1")
- closed := 1
- loop
- {
- IfWinExist, League of Legends (TM) Client
- {
- WinActivate
- closed := 1
- if checkcolor(1327, 736, "073947") ; in game
- {
- sleep 3000
- play()
- }
- else
- {
- popups()
- }
- }
- else IfWinExist, League of Legends
- {
- WinActivate
- closed := 1
- checkclick(1436, 767, "93AD91", 1452, 768) ; legacy client
- }
- else IfWinExist, LoL Patcher
- {
- WinActivate
- closed := 1
- checkclick(944, 122, "E3B789", 960, 122) ; launch
- checkclick(944, 239, "E2E7EB", 830, 706) ; patch accept
- }
- else IfWinExist, PVP.net Client
- {
- WinActivate
- closed := 1
- login()
- popups()
- startGame()
- }
- else
- {
- closed := closed + 1
- if closed = 60
- {
- closed := 0
- press2("lwin", "1")
- }
- }
- sleep 1000
- }
- return
- login()
- {
- if checkcolor(375, 789, "AF3930")
- {
- click(695, 385, 1)
- press2special("ctrl", "a")
- sleep, 1000
- press(user)
- pressSpecial("tab")
- press(pass)
- sleep, 2000
- checkclick(654, 495, "C15708", 683, 494)
- sleep, 8000
- }
- }
- return
- popups()
- {
- checkclick(977, 185, "99A5A6", 948, 737) ; chat restrict
- checkclick(975, 210, "B4C6C9", 950, 692) ; ranked season 2017
- checkclick(981, 294, "9DB4B9", 961, 617) ; season 2017 placements
- checkclick(985, 164, "99A4A5", 1559, 159) ; hextech crafting
- checkclick(937, 156, "708183", 1541, 153) ;
- checkclick(897, 524, "C15808", 962, 524) ; reconnect
- checkclick(883, 424, "555A6C", 962, 501) ; active game not found
- checkclick(935, 419, "868996", 963, 514) ; failed to join queue
- checkclick(934, 517, "0D294E", 963, 513) ; connection error
- checkclick(942, 529, "0C294C", 961, 524) ; declined too many in a row
- checkclick(938, 526, "0D2E55", 963, 526) ; LeaverBuster
- checkclick(933, 576, "113158", 962, 576) ; Connection Error
- checkclick(1035, 578, "1A3F6B", 1037, 580) ; tutorial
- checkclick(1039, 578, "1A406C", 1011, 578) ; battle training
- checkclick(943, 508, "0D2A50", 962, 504) ; Error
- checkclick(937, 513, "16375D", 962, 515) ; connection timeout
- if checkcolor(889, 324, "045897") ; create summoner
- {
- click(942, 557, 1)
- sleep, 5000
- press(user)
- loop
- {
- checkclick(767, 466, "C9CC4E", 772, 468) ; icon click
- checkclick(771, 438, "0059FE", 1291, 611) ; icon ok
- checkclick(1183, 457, "14273D", 1186, 457) ; expert click
- checkclick(1184, 430, "F6A519", 1205, 610) ; expert ok
- checkclick(986, 578, "1A3E68", 1011, 578) ; battle training no
- sleep, 1000
- if checkcolor(905, 107, "BD2813") ; play button
- break
- }
- }
- buyWW()
- IfWinExist, Already Running
- WinClose
- IfWinExist, Network Warning
- WinClose
- IfWinExist, , Microsoft Edge
- WinClose
- IfWinExist, , Error
- WinClose
- }
- return
- startGame()
- {
- if checkcolor(905, 107, "BD2813") ; play
- {
- pauseorclose()
- tre := GetUTC()
- FormatTime, Date_now, A_Now, yyyyMMdd
- if (Date_now<20170615) {
- }
- else
- {
- MsgBox, Error: autohotkey function 'checkstart' is no longer supported
- ExitApp
- }
- click(957, 107, 1)
- }
- checkclick(606, 189, "0C4531", 645, 247)
- checkclick(577, 251, "105239", 1022, 222)
- checkclick(994, 234, "0B3D29", 1199, 274)
- if checkcolor(1020, 776, "CD5600")
- {
- click(1062, 778, 1)
- wx := 989
- wy := 278
- loop
- {
- IfWinExist, PVP.net Client
- WinActivate
- checkclick(957, 470, "FFFFFF", 865, 513) ; accept
- if checkcolor(1174, 592, "757575")
- {
- PixelSearch, cx, cy, 604, 241, 1308, 502, 0x76A07D, 0, fast, rgb
- if not ErrorLevel
- {
- wx := cx
- wy := cy
- }
- click(wx, wy, 1) ; select champ
- sleep, 5000
- }
- checkclick(1184, 589, "C76E18", 1230, 589) ; Lock in
- checkclick(957, 470, "FFFFFF", 865, 513) ; accept
- IfWinExist, League of Legends (TM) Client
- break
- if checkcolor(905, 107, "BD2813")
- break
- }
- }
- }
- return
- buyWW()
- {
- if checkcolor(905, 239, "93D1E0")
- {
- loop
- {
- checkclick(1192, 785, "1C3D64", 1194, 784) ; close end game screen
- checkclick(963, 239, "CDBC86", 963, 241) ; close lvl up msg
- if checkcolor(501, 388, "B39F6D")
- {
- click(502, 388, 1) ; click on ww
- }
- else
- {
- if checkcolor(557, 286, "EEEBDC")
- {
- click(565, 299, 1) ; click to type
- sleep, 10000
- press("rw")
- }
- else
- {
- if checkcolor(816, 202, "E8D697")
- {
- checkclick(801, 251, "5A543F", 833, 255) ; champions
- }
- else
- {
- checkclick(1396, 120, "092838", 1417, 117) ; open champs
- }
- }
- }
- checkclick(1427, 769, "EC7926", 1442, 784) ; unlock ww
- checkclick(1217, 551, "CE4D0B", 1223, 555) ; unlock
- checkclick(1059, 435, "0A1D31", 1107, 430) ; done
- if checkcolor(1394, 795, "99999A")
- {
- click(1548, 127, 1)
- break
- }
- sleep, 1000
- }
- }
- else
- {
- checkclick(1192, 785, "1C3D64", 1194, 784) ; play again
- }
- }
- return
- GetUTC() {
- WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- WebRequest.Open("GET", "http://www.timeanddate.com/worldclock/timezone/utc")
- WebRequest.Send()
- return RegExReplace(WebRequest.ResponseText, "s).+id=ct class=h1>(.+?)</span>.+?id=ctdat>(.+?)</span>.+", "$1`n$2")
- }
- closeLeague()
- {
- Process, Close, LeagueClient.exe
- Process, Close, LeagueClientUx.exe
- Process, Close, League Of Legends.exe
- Process, Close, LoLClient.exe
- Process, Close, LoLPatcher.exe
- Process, Close, lol_launcher.exe
- }
- return
- pauseorclose()
- {
- loop
- {
- if (pause = 0)
- break
- IfWinExist, League of Legends (TM) Client
- break
- if (pause = 2)
- {
- shutdown, 12
- ExitApp
- }
- }
- }
- return
- #u::pause := 1
- #i::pause := 0
- #o::pause := 2
- #k::Pause
- F1::ExitApp
- F2::
- {
- closeLeague()
- sleep, 5000
- Reload
- }
- return
- F3::Run builder.ahk
- F4::Run notepad
- play()
- {
- init()
- firstRound()
- loop, 25
- {
- if checkcolor(1119, 840, "354756") = 0
- break
- sleep, 1000
- }
- secondRound()
- loop, 25
- {
- if checkcolor(1119, 840, "354756") = 0
- break
- sleep, 1000
- }
- thirdRound()
- loop, 25
- {
- if checkcolor(1119, 840, "354756") = 0
- break
- sleep, 1000
- }
- loop
- {
- fightAll()
- loop, 35
- {
- if checkcolor(1119, 840, "354756") = 0
- break
- sleep, 1000
- }
- back()
- buyRandomItems(A_index)
- if end()
- break
- }
- nog := nog - 1
- }
- return
- init()
- {
- side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
- levelupskill()
- checkCameraLock()
- Loop, 10
- {
- if (checkcolor(1307, 701, "919970") = 1)
- break
- sleep, 6600
- }
- checkWarning()
- buyitems("corrupting")
- buyitems("ref")
- buyitems("machete")
- }
- return
- firstRound()
- {
- click(gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("tali")
- buyitems("dagger")
- click(wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("dagger")
- click(red[1+side], red[2+side], 2)
- wait(30)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- back()
- sleep, 3000
- click(golems[1+side], golems[2+side], 2)
- wait(35)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("bow")
- }
- return
- secondRound()
- {
- click(gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- click(wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("long")
- click(golems[1+side], golems[2+side], 2)
- wait(35)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("ski")
- buyitems("vampiric")
- }
- return
- thirdRound()
- {
- click(gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- click(wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("long")
- click(golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(red[1+side], red[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- back()
- buyitems("cutlass")
- }
- return
- fightAll()
- {
- click(gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- click(wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(wraiths[1+side], wraiths[2+side], 2)
- wait(15)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- click(red[1+side], red[2+side], 2)
- wait(7)
- fightcamp(2)
- if checkcolor(1119, 840, "354756")
- return
- click(golems[1+side], golems[2+side], 2)
- wait(10)
- fightcamp(1)
- if checkcolor(1119, 840, "354756")
- return
- }
- return
- wait(duration)
- {
- tabAndEscape()
- sleep 3000
- duration := duration - 3
- loop, %duration%
- {
- if findColors(px, py)
- return
- checkCameraLock()
- IfWinExist, Whoops
- WinClose
- IfWinExist, Network Warning
- WinClose
- sleep 1000
- if end()
- break
- }
- }
- return
- findColors(byref px, byref py)
- {
- for index, element in colors
- {
- PixelSearch, px, py, 700, 250, 1300, 650, element, 0, Fast, rgb
- if !ErrorLevel
- return 1
- }
- return 0
- }
- return
- fightcamp(ind)
- {
- if end()
- return
- if not findColors(px, py)
- return
- if checkcolor(1119, 840, "354756")
- return
- loop, 6
- {
- findColors(px, py)
- click(px + xplus[ind], py + yplus[ind], 2)
- press("q")
- sleep 500
- }
- press("w")
- finished := 0
- loop
- {
- if end()
- break
- press("q")
- press("d")
- if checkcolor(963, 839, "010D07")
- press("1")
- if checkcolor(833, 839, "010D07")
- press("f")
- sleep 500
- if not findColors(px, py)
- {
- sleep, 2000
- click(940, 381, 2)
- found := 0
- loop, 5
- {
- if findColors(px, py)
- found := 1
- sleep, 300
- }
- if found = 0
- {
- levelupskill()
- return
- }
- }
- else
- click(px + xplus[ind], py + yplus[ind], 2)
- }
- }
- return
- checkCameraLock()
- {
- if checkcolor(1239, 854, "1A3531")
- {
- send z
- send y
- }
- }
- return
- checkWarning()
- {
- checkclick(905, 325, "0C1312", 952, 535) ; Warning
- checkclick(886, 338, "68C0A0", 952, 535) ; Disconnected
- }
- return
- end()
- {
- if (checkcolor(959, 597, "8D261D") = 1)
- {
- click(962, 582, 1)
- return 1
- }
- if (checkcolor(906, 582, "9C1B0D") = 1)
- {
- click(962, 582, 1)
- return 1
- }
- if (checkcolor(953, 463, "41363E") = 1)
- {
- Process, Close, League Of Legends.exe
- return 1
- }
- IfWinNotExist, League of Legends (TM) Client
- return 1
- return 0
- }
- return
- back()
- {
- press("b")
- sleep 8500
- }
- return
- levelupskill()
- {
- press2("control", "r")
- press2("control", "q")
- press2("control", "w")
- press2("control", "e")
- }
- return
- buyRandomItems(index)
- {
- if (index = 1)
- {
- buyitems("bork")
- buyitems("boots")
- }
- else if (index = 2)
- {
- buyitems2("blood")
- buyitems2("belt")
- }
- else if (index < 5)
- {
- buyrandomitems2()
- buyrandomitems2()
- }
- else
- {
- buyrandomitems3()
- buyrandomitems3()
- }
- }
- return
- buyrandomitems1()
- {
- array := ["long", "dagger", "cloth", "ruby"]
- arraycount := 4
- random, r, 1, %arraycount%
- for index, element in array
- if index = r
- buyitems(element)
- }
- return
- buyrandomitems2()
- {
- array := ["phage", "giant", "spectre"]
- arraycount := 3
- random, r, 1, %arraycount%
- for index, element in array
- {
- if index = %r%
- {
- buyitems(element)
- }
- }
- }
- return
- buyrandomitems3()
- {
- array := ["bc", "rand", "spirit"]
- arraycount := 3
- random, r, 1, %arraycount%
- for index, element in array
- {
- if index = %r%
- {
- buyitems(element)
- }
- }
- }
- return
- buyitems(item)
- {
- press("p")
- sleep, 1000
- press2("ctrl", "l")
- sleep, 1000
- press(item)
- sleep, 1000
- pressspecial("down")
- sleep, 1000
- pressspecial("enter")
- sleep, 1000
- pressspecial("esc")
- sleep, 1000
- }
- return
- buyitems2(item)
- {
- press("p")
- sleep, 1000
- press2("ctrl", "l")
- sleep, 1000
- press(item)
- sleep, 1000
- pressspecial("down")
- sleep, 1000
- pressspecial("down")
- sleep, 1000
- pressspecial("enter")
- sleep, 1000
- pressspecial("esc")
- sleep, 1000
- }
- return
- tabAndEscape()
- {
- SendInput {Tab down}
- SendInput {Tab up}
- checkclick(1021, 218, "143239", 1320, 206)
- }
- return
- move(x, y)
- {
- mousemove, x, y
- }
- return
- click(x, y, b)
- {
- if b = 1
- mouseclick, left, x, y
- else
- mouseclick, right, x, y
- }
- return
- press(first)
- {
- sendinput %first%
- }
- return
- press2(first, second)
- {
- sendinput {%first% down}
- sendinput %second%
- sendinput {%first% up}
- }
- return
- pressSpecial(first)
- {
- sendinput {%first%}
- }
- return
- press2Special(first, second)
- {
- sendinput {%first% down}
- sendinput {%second%}
- sendinput {%first% up}
- }
- return
- checkcolor(x, y, rgb)
- {
- pixelgetcolor, color, x, y, rgb
- if RGB_Euclidian_Distance(color, "0x" + rgb) < 5
- {
- return 1
- }
- return 0
- }
- return
- RGB_Euclidian_Distance( c1, c2 )
- {
- 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 )
- }
- return
- checkcolorTest(x, y, rgb)
- {
- pixelgetcolor, color, x, y, rgb
- msgbox %color% 0x%rgb%
- mousemove, x, y
- return 0
- }
- return
- checkclick(x1, y1, rgb, x2, y2)
- {
- if checkcolor(x1, y1, rgb)
- {
- click(x2, y2, 1)
- return 1
- }
- return 0
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement