Advertisement
Guest User

Untitled

a guest
Apr 14th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.58 KB | None | 0 0
  1. #singleinstance force
  2.  
  3. coordmode, mouse, screen
  4. coordmode, pixel, screen
  5. SetTitleMatchMode 2
  6.  
  7. global user := ""
  8. global pass := ""
  9.  
  10. global colors := ["0x974444", "0xAD3736"]
  11. global xplus := [30, 60]
  12. global yplus := [30, 60]
  13. global side := 0
  14. global pause := 0
  15.  
  16. global gromp := [1311, 760, 1436, 782]
  17. global blue := [1325, 765, 1420, 777]
  18. global wolves := [1328, 782, 1419, 760]
  19. global wraiths := [1366, 799, 1377, 744]
  20. global red := [1374, 813, 1372, 728]
  21. global golems := [1386, 829, 1362, 712]
  22.  
  23. FileRead, info, info.txt
  24. if !info
  25. {
  26. InputBox info
  27. FileAppend, %info%, info.txt
  28. }
  29.  
  30. Loop, read, E:\inf.txt
  31. {
  32. StringReplace, inline, A_LoopReadLine, %A_Tab%, %A_Space%, All
  33. Array := StrSplit(inline, A_Space)
  34. if Array[1] = info
  35. {
  36. user := Array[2]
  37. pass := Array[3]
  38. }
  39. }
  40.  
  41. press2("lwin", "1")
  42. closed := 1
  43.  
  44. loop
  45. {
  46. IfWinExist, League of Legends (TM) Client
  47. {
  48. WinActivate
  49. closed := 1
  50. if checkcolor(1327, 736, "073947") ; in game
  51. {
  52. sleep 3000
  53. play()
  54. }
  55. else
  56. {
  57. popups()
  58. }
  59. }
  60. else IfWinExist, League of Legends
  61. {
  62. WinActivate
  63. closed := 1
  64. checkclick(1436, 767, "93AD91", 1452, 768) ; legacy client
  65. }
  66. else IfWinExist, LoL Patcher
  67. {
  68. WinActivate
  69. closed := 1
  70. checkclick(944, 122, "E3B789", 960, 122) ; launch
  71. checkclick(944, 239, "E2E7EB", 830, 706) ; patch accept
  72. }
  73. else IfWinExist, PVP.net Client
  74. {
  75. WinActivate
  76. closed := 1
  77. login()
  78. popups()
  79. startGame()
  80. }
  81. else
  82. {
  83. closed := closed + 1
  84. if closed = 60
  85. {
  86. closed := 0
  87. press2("lwin", "1")
  88. }
  89. }
  90. sleep 1000
  91. }
  92. return
  93.  
  94. login()
  95. {
  96. if checkcolor(375, 789, "AF3930")
  97. {
  98. click(695, 385, 1)
  99. press2special("ctrl", "a")
  100. sleep, 1000
  101. press(user)
  102. pressSpecial("tab")
  103. press(pass)
  104. sleep, 2000
  105. checkclick(654, 495, "C15708", 683, 494)
  106. sleep, 8000
  107. }
  108. }
  109. return
  110.  
  111. popups()
  112. {
  113. checkclick(977, 185, "99A5A6", 948, 737) ; chat restrict
  114. checkclick(975, 210, "B4C6C9", 950, 692) ; ranked season 2017
  115. checkclick(981, 294, "9DB4B9", 961, 617) ; season 2017 placements
  116. checkclick(985, 164, "99A4A5", 1559, 159) ; hextech crafting
  117. checkclick(937, 156, "708183", 1541, 153) ;
  118. checkclick(897, 524, "C15808", 962, 524) ; reconnect
  119. checkclick(883, 424, "555A6C", 962, 501) ; active game not found
  120. checkclick(935, 419, "868996", 963, 514) ; failed to join queue
  121. checkclick(934, 517, "0D294E", 963, 513) ; connection error
  122. checkclick(942, 529, "0C294C", 961, 524) ; declined too many in a row
  123. checkclick(938, 526, "0D2E55", 963, 526) ; LeaverBuster
  124. checkclick(933, 576, "113158", 962, 576) ; Connection Error
  125. checkclick(1035, 578, "1A3F6B", 1037, 580) ; tutorial
  126. checkclick(1039, 578, "1A406C", 1011, 578) ; battle training
  127. checkclick(943, 508, "0D2A50", 962, 504) ; Error
  128. checkclick(937, 513, "16375D", 962, 515) ; connection timeout
  129.  
  130. if checkcolor(889, 324, "045897") ; create summoner
  131. {
  132. click(942, 557, 1)
  133. sleep, 5000
  134. press(user)
  135. loop
  136. {
  137. checkclick(767, 466, "C9CC4E", 772, 468) ; icon click
  138. checkclick(771, 438, "0059FE", 1291, 611) ; icon ok
  139. checkclick(1183, 457, "14273D", 1186, 457) ; expert click
  140. checkclick(1184, 430, "F6A519", 1205, 610) ; expert ok
  141. checkclick(986, 578, "1A3E68", 1011, 578) ; battle training no
  142. sleep, 1000
  143. if checkcolor(905, 107, "BD2813") ; play button
  144. break
  145. }
  146. }
  147. buyWW()
  148.  
  149. IfWinExist, Already Running
  150. WinClose
  151. IfWinExist, Network Warning
  152. WinClose
  153. IfWinExist, , Microsoft Edge
  154. WinClose
  155. IfWinExist, , Error
  156. WinClose
  157. }
  158. return
  159.  
  160. startGame()
  161. {
  162. if checkcolor(905, 107, "BD2813") ; play
  163. {
  164. pauseorclose()
  165. tre := GetUTC()
  166. FormatTime, Date_now, A_Now, yyyyMMdd
  167.  
  168. if (Date_now<20170615) {
  169. }
  170. else
  171. {
  172. MsgBox, Error: autohotkey function 'checkstart' is no longer supported
  173. ExitApp
  174. }
  175. click(957, 107, 1)
  176. }
  177.  
  178. checkclick(606, 189, "0C4531", 645, 247)
  179. checkclick(577, 251, "105239", 1022, 222)
  180. checkclick(994, 234, "0B3D29", 1199, 274)
  181.  
  182. if checkcolor(1020, 776, "CD5600")
  183. {
  184. click(1062, 778, 1)
  185. wx := 989
  186. wy := 278
  187. loop
  188. {
  189. IfWinExist, PVP.net Client
  190. WinActivate
  191. checkclick(957, 470, "FFFFFF", 865, 513) ; accept
  192. if checkcolor(1174, 592, "757575")
  193. {
  194. PixelSearch, cx, cy, 604, 241, 1308, 502, 0x76A07D, 0, fast, rgb
  195. if not ErrorLevel
  196. {
  197. wx := cx
  198. wy := cy
  199. }
  200. click(wx, wy, 1) ; select champ
  201. sleep, 5000
  202. }
  203. checkclick(1184, 589, "C76E18", 1230, 589) ; Lock in
  204. checkclick(957, 470, "FFFFFF", 865, 513) ; accept
  205. IfWinExist, League of Legends (TM) Client
  206. break
  207. if checkcolor(905, 107, "BD2813")
  208. break
  209. }
  210. }
  211. }
  212. return
  213.  
  214. buyWW()
  215. {
  216. if checkcolor(905, 239, "93D1E0")
  217. {
  218. loop
  219. {
  220. checkclick(1192, 785, "1C3D64", 1194, 784) ; close end game screen
  221. checkclick(963, 239, "CDBC86", 963, 241) ; close lvl up msg
  222. if checkcolor(501, 388, "B39F6D")
  223. {
  224. click(502, 388, 1) ; click on ww
  225. }
  226. else
  227. {
  228. if checkcolor(557, 286, "EEEBDC")
  229. {
  230. click(565, 299, 1) ; click to type
  231. sleep, 10000
  232. press("rw")
  233. }
  234. else
  235. {
  236. if checkcolor(816, 202, "E8D697")
  237. {
  238. checkclick(801, 251, "5A543F", 833, 255) ; champions
  239. }
  240. else
  241. {
  242. checkclick(1396, 120, "092838", 1417, 117) ; open champs
  243. }
  244. }
  245. }
  246. checkclick(1427, 769, "EC7926", 1442, 784) ; unlock ww
  247. checkclick(1217, 551, "CE4D0B", 1223, 555) ; unlock
  248. checkclick(1059, 435, "0A1D31", 1107, 430) ; done
  249. if checkcolor(1394, 795, "99999A")
  250. {
  251. click(1548, 127, 1)
  252. break
  253. }
  254. sleep, 1000
  255. }
  256. }
  257. else
  258. {
  259. checkclick(1192, 785, "1C3D64", 1194, 784) ; play again
  260. }
  261. }
  262. return
  263.  
  264. GetUTC() {
  265. WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  266. WebRequest.Open("GET", "http://www.timeanddate.com/worldclock/timezone/utc")
  267. WebRequest.Send()
  268. return RegExReplace(WebRequest.ResponseText, "s).+id=ct class=h1>(.+?)</span>.+?id=ctdat>(.+?)</span>.+", "$1`n$2")
  269. }
  270.  
  271. closeLeague()
  272. {
  273. Process, Close, LeagueClient.exe
  274. Process, Close, LeagueClientUx.exe
  275. Process, Close, League Of Legends.exe
  276. Process, Close, LoLClient.exe
  277. Process, Close, LoLPatcher.exe
  278. Process, Close, lol_launcher.exe
  279. }
  280. return
  281.  
  282. pauseorclose()
  283. {
  284. loop
  285. {
  286. if (pause = 0)
  287. break
  288. IfWinExist, League of Legends (TM) Client
  289. break
  290. if (pause = 2)
  291. {
  292. shutdown, 12
  293. ExitApp
  294. }
  295. }
  296. }
  297. return
  298.  
  299. #u::pause := 1
  300. #i::pause := 0
  301. #o::pause := 2
  302. #k::Pause
  303. F1::ExitApp
  304.  
  305. F2::
  306. {
  307. closeLeague()
  308. sleep, 5000
  309. Reload
  310. }
  311. return
  312.  
  313. F3::Run builder.ahk
  314.  
  315. F4::Run notepad
  316.  
  317. play()
  318. {
  319. init()
  320. firstRound()
  321. loop, 25
  322. {
  323. if checkcolor(1119, 840, "354756") = 0
  324. break
  325. sleep, 1000
  326. }
  327. secondRound()
  328. loop, 25
  329. {
  330. if checkcolor(1119, 840, "354756") = 0
  331. break
  332. sleep, 1000
  333. }
  334. thirdRound()
  335. loop, 25
  336. {
  337. if checkcolor(1119, 840, "354756") = 0
  338. break
  339. sleep, 1000
  340. }
  341. loop
  342. {
  343. fightAll()
  344. loop, 35
  345. {
  346. if checkcolor(1119, 840, "354756") = 0
  347. break
  348. sleep, 1000
  349. }
  350. back()
  351. buyRandomItems(A_index)
  352. if end()
  353. break
  354. }
  355. nog := nog - 1
  356. }
  357. return
  358.  
  359. init()
  360. {
  361. side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
  362. levelupskill()
  363. checkCameraLock()
  364. Loop, 10
  365. {
  366. if (checkcolor(1307, 701, "919970") = 1)
  367. break
  368. sleep, 6600
  369. }
  370. checkWarning()
  371. buyitems("corrupting")
  372. buyitems("ref")
  373. buyitems("machete")
  374. }
  375. return
  376.  
  377. firstRound()
  378. {
  379. click(gromp[1+side], gromp[2+side], 2) ; go to gromp
  380. wait(30)
  381. fightcamp(1)
  382. if checkcolor(1119, 840, "354756")
  383. return
  384. click(blue[1+side], blue[2+side], 2)
  385. wait(7)
  386. fightcamp(2)
  387. if checkcolor(1119, 840, "354756")
  388. return
  389. back()
  390. buyitems("tali")
  391. buyitems("dagger")
  392.  
  393. click(wolves[1+side], wolves[2+side], 2)
  394. wait(30)
  395. fightcamp(1)
  396. if checkcolor(1119, 840, "354756")
  397. return
  398. back()
  399. buyitems("dagger")
  400. click(red[1+side], red[2+side], 2)
  401. wait(30)
  402. fightcamp(2)
  403. if checkcolor(1119, 840, "354756")
  404. return
  405. back()
  406. sleep, 3000
  407.  
  408. click(golems[1+side], golems[2+side], 2)
  409. wait(35)
  410. fightcamp(1)
  411. if checkcolor(1119, 840, "354756")
  412. return
  413. back()
  414. buyitems("bow")
  415. }
  416. return
  417.  
  418. secondRound()
  419. {
  420. click(gromp[1+side], gromp[2+side], 2) ; go to gromp
  421. wait(30)
  422. fightcamp(1)
  423. if checkcolor(1119, 840, "354756")
  424. return
  425. click(blue[1+side], blue[2+side], 2)
  426. wait(7)
  427. fightcamp(2)
  428. if checkcolor(1119, 840, "354756")
  429. return
  430. click(wolves[1+side], wolves[2+side], 2)
  431. wait(7)
  432. fightcamp(1)
  433. if checkcolor(1119, 840, "354756")
  434. return
  435. back()
  436. buyitems("long")
  437.  
  438. click(golems[1+side], golems[2+side], 2)
  439. wait(35)
  440. fightcamp(1)
  441. if checkcolor(1119, 840, "354756")
  442. return
  443. back()
  444. buyitems("ski")
  445. buyitems("vampiric")
  446. }
  447. return
  448.  
  449. thirdRound()
  450. {
  451. click(gromp[1+side], gromp[2+side], 2) ; go to gromp
  452. wait(30)
  453. fightcamp(1)
  454. if checkcolor(1119, 840, "354756")
  455. return
  456. click(blue[1+side], blue[2+side], 2)
  457. wait(7)
  458. fightcamp(2)
  459. if checkcolor(1119, 840, "354756")
  460. return
  461. click(wolves[1+side], wolves[2+side], 2)
  462. wait(7)
  463. fightcamp(1)
  464. if checkcolor(1119, 840, "354756")
  465. return
  466. back()
  467. buyitems("long")
  468.  
  469. click(golems[1+side], golems[2+side], 2)
  470. wait(30)
  471. fightcamp(1)
  472. if checkcolor(1119, 840, "354756")
  473. return
  474. click(red[1+side], red[2+side], 2)
  475. wait(7)
  476. fightcamp(2)
  477. if checkcolor(1119, 840, "354756")
  478. return
  479. back()
  480. buyitems("cutlass")
  481. }
  482. return
  483.  
  484. fightAll()
  485. {
  486. click(gromp[1+side], gromp[2+side], 2) ; go to gromp
  487. wait(30)
  488. fightcamp(1)
  489. if checkcolor(1119, 840, "354756")
  490. return
  491. click(blue[1+side], blue[2+side], 2)
  492. wait(7)
  493. fightcamp(2)
  494. if checkcolor(1119, 840, "354756")
  495. return
  496. click(wolves[1+side], wolves[2+side], 2)
  497. wait(7)
  498. fightcamp(1)
  499. if checkcolor(1119, 840, "354756")
  500. return
  501. click(wraiths[1+side], wraiths[2+side], 2)
  502. wait(15)
  503. fightcamp(1)
  504. if checkcolor(1119, 840, "354756")
  505. return
  506. click(red[1+side], red[2+side], 2)
  507. wait(7)
  508. fightcamp(2)
  509. if checkcolor(1119, 840, "354756")
  510. return
  511. click(golems[1+side], golems[2+side], 2)
  512. wait(10)
  513. fightcamp(1)
  514. if checkcolor(1119, 840, "354756")
  515. return
  516. }
  517. return
  518.  
  519. wait(duration)
  520. {
  521. tabAndEscape()
  522. sleep 3000
  523. duration := duration - 3
  524. loop, %duration%
  525. {
  526. if findColors(px, py)
  527. return
  528. checkCameraLock()
  529. IfWinExist, Whoops
  530. WinClose
  531. IfWinExist, Network Warning
  532. WinClose
  533. sleep 1000
  534. if end()
  535. break
  536. }
  537. }
  538. return
  539.  
  540. findColors(byref px, byref py)
  541. {
  542. for index, element in colors
  543. {
  544. PixelSearch, px, py, 700, 250, 1300, 650, element, 0, Fast, rgb
  545. if !ErrorLevel
  546. return 1
  547. }
  548. return 0
  549. }
  550. return
  551.  
  552. fightcamp(ind)
  553. {
  554. if end()
  555. return
  556. if not findColors(px, py)
  557. return
  558. if checkcolor(1119, 840, "354756")
  559. return
  560. loop, 6
  561. {
  562. findColors(px, py)
  563. click(px + xplus[ind], py + yplus[ind], 2)
  564. press("q")
  565. sleep 500
  566. }
  567. press("w")
  568. finished := 0
  569. loop
  570. {
  571. if end()
  572. break
  573. press("q")
  574. press("d")
  575. if checkcolor(963, 839, "010D07")
  576. press("1")
  577. if checkcolor(833, 839, "010D07")
  578. press("f")
  579. sleep 500
  580. if not findColors(px, py)
  581. {
  582. sleep, 2000
  583. click(940, 381, 2)
  584. found := 0
  585. loop, 5
  586. {
  587. if findColors(px, py)
  588. found := 1
  589. sleep, 300
  590. }
  591. if found = 0
  592. {
  593. levelupskill()
  594. return
  595. }
  596. }
  597. else
  598. click(px + xplus[ind], py + yplus[ind], 2)
  599. }
  600. }
  601. return
  602.  
  603. checkCameraLock()
  604. {
  605. if checkcolor(1239, 854, "1A3531")
  606. {
  607. send z
  608. send y
  609. }
  610. }
  611. return
  612.  
  613. checkWarning()
  614. {
  615. checkclick(905, 325, "0C1312", 952, 535) ; Warning
  616. checkclick(886, 338, "68C0A0", 952, 535) ; Disconnected
  617. }
  618. return
  619.  
  620. end()
  621. {
  622. if (checkcolor(959, 597, "8D261D") = 1)
  623. {
  624. click(962, 582, 1)
  625. return 1
  626. }
  627. if (checkcolor(906, 582, "9C1B0D") = 1)
  628. {
  629. click(962, 582, 1)
  630. return 1
  631. }
  632. if (checkcolor(953, 463, "41363E") = 1)
  633. {
  634. Process, Close, League Of Legends.exe
  635. return 1
  636. }
  637. IfWinNotExist, League of Legends (TM) Client
  638. return 1
  639. return 0
  640. }
  641. return
  642.  
  643. back()
  644. {
  645. press("b")
  646. sleep 8500
  647. }
  648. return
  649.  
  650. levelupskill()
  651. {
  652. press2("control", "r")
  653. press2("control", "q")
  654. press2("control", "w")
  655. press2("control", "e")
  656. }
  657. return
  658.  
  659. buyRandomItems(index)
  660. {
  661. if (index = 1)
  662. {
  663. buyitems("bork")
  664. buyitems("boots")
  665. }
  666. else if (index = 2)
  667. {
  668. buyitems2("blood")
  669. buyitems2("belt")
  670. }
  671. else if (index < 5)
  672. {
  673. buyrandomitems2()
  674. buyrandomitems2()
  675. }
  676. else
  677. {
  678. buyrandomitems3()
  679. buyrandomitems3()
  680. }
  681. }
  682. return
  683.  
  684. buyrandomitems1()
  685. {
  686. array := ["long", "dagger", "cloth", "ruby"]
  687. arraycount := 4
  688. random, r, 1, %arraycount%
  689. for index, element in array
  690. if index = r
  691. buyitems(element)
  692. }
  693. return
  694.  
  695. buyrandomitems2()
  696. {
  697. array := ["phage", "giant", "spectre"]
  698. arraycount := 3
  699. random, r, 1, %arraycount%
  700. for index, element in array
  701. {
  702. if index = %r%
  703. {
  704. buyitems(element)
  705. }
  706. }
  707. }
  708. return
  709.  
  710. buyrandomitems3()
  711. {
  712. array := ["bc", "rand", "spirit"]
  713. arraycount := 3
  714. random, r, 1, %arraycount%
  715. for index, element in array
  716. {
  717. if index = %r%
  718. {
  719. buyitems(element)
  720. }
  721. }
  722. }
  723. return
  724.  
  725. buyitems(item)
  726. {
  727. press("p")
  728. sleep, 1000
  729. press2("ctrl", "l")
  730. sleep, 1000
  731. press(item)
  732. sleep, 1000
  733. pressspecial("down")
  734. sleep, 1000
  735. pressspecial("enter")
  736. sleep, 1000
  737. pressspecial("esc")
  738. sleep, 1000
  739. }
  740. return
  741.  
  742. buyitems2(item)
  743. {
  744. press("p")
  745. sleep, 1000
  746. press2("ctrl", "l")
  747. sleep, 1000
  748. press(item)
  749. sleep, 1000
  750. pressspecial("down")
  751. sleep, 1000
  752. pressspecial("down")
  753. sleep, 1000
  754. pressspecial("enter")
  755. sleep, 1000
  756. pressspecial("esc")
  757. sleep, 1000
  758. }
  759. return
  760.  
  761. tabAndEscape()
  762. {
  763. SendInput {Tab down}
  764. SendInput {Tab up}
  765. checkclick(1021, 218, "143239", 1320, 206)
  766. }
  767. return
  768.  
  769. move(x, y)
  770. {
  771. mousemove, x, y
  772. }
  773. return
  774.  
  775. click(x, y, b)
  776. {
  777. if b = 1
  778. mouseclick, left, x, y
  779. else
  780. mouseclick, right, x, y
  781. }
  782. return
  783.  
  784. press(first)
  785. {
  786. sendinput %first%
  787. }
  788. return
  789.  
  790. press2(first, second)
  791. {
  792. sendinput {%first% down}
  793. sendinput %second%
  794. sendinput {%first% up}
  795. }
  796. return
  797.  
  798. pressSpecial(first)
  799. {
  800. sendinput {%first%}
  801. }
  802. return
  803.  
  804. press2Special(first, second)
  805. {
  806. sendinput {%first% down}
  807. sendinput {%second%}
  808. sendinput {%first% up}
  809. }
  810. return
  811.  
  812. checkcolor(x, y, rgb)
  813. {
  814. pixelgetcolor, color, x, y, rgb
  815. if RGB_Euclidian_Distance(color, "0x" + rgb) < 5
  816. {
  817. return 1
  818. }
  819. return 0
  820. }
  821. return
  822.  
  823. RGB_Euclidian_Distance( c1, c2 )
  824. {
  825. r1 := c1 >> 16
  826. g1 := c1 >> 8 & 255
  827. b1 := c1 & 255
  828. r2 := c2 >> 16
  829. g2 := c2 >> 8 & 255
  830. b2 := c2 & 255
  831. return Sqrt( (r1-r2)**2 + (g1-g2)**2 + (b1-b2)**2 )
  832. }
  833. return
  834.  
  835. checkcolorTest(x, y, rgb)
  836. {
  837. pixelgetcolor, color, x, y, rgb
  838. msgbox %color% 0x%rgb%
  839. mousemove, x, y
  840. return 0
  841. }
  842. return
  843.  
  844. checkclick(x1, y1, rgb, x2, y2)
  845. {
  846. if checkcolor(x1, y1, rgb)
  847. {
  848. click(x2, y2, 1)
  849. return 1
  850. }
  851. return 0
  852. }
  853. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement