Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.39 KB | None | 0 0
  1. #singleinstance force
  2.  
  3. coordmode, mouse, screen
  4. coordmode, pixel, screen
  5. SetTitleMatchMode 2
  6. DetectHiddenWindows, On
  7.  
  8. global logging = 0
  9. global filepath0 := "E:\inf0.txt"
  10. global filepath := "E:\inf.txt"
  11. global filepathlog := "E:\log.txt"
  12.  
  13. global info := 0
  14. global user := ""
  15. global pass := ""
  16. global server := ""
  17.  
  18. global colors := ["0xC15757", "0x481617"]
  19. global xplus := [30, 60]
  20. global yplus := [30, 60]
  21. global side := 0
  22. global pause := 0
  23. global warwick := 0
  24.  
  25. global jungler := 1
  26. global junglerX := [700, 800, 900, 1000, 1100, 1200, 700, 800, 900, 1000, 1100, 1200]
  27. global junglerY := [250, 250, 250, 250, 250, 250, 350, 350, 350, 350, 350, 350]
  28.  
  29. global gromp := [1311, 760, 1436, 782]
  30. global blue := [1325, 765, 1420, 777]
  31. global wolves := [1328, 782, 1419, 760]
  32. global wraiths := [1366, 799, 1377, 744]
  33. global red := [1379, 818, 1372, 728]
  34. global golems := [1386, 829, 1362, 712]
  35.  
  36. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  37.  
  38. FileRead, info, info.txt
  39. if (!info) {
  40. InputBox info
  41. FileAppend, %info%, info.txt
  42. }
  43.  
  44. IfWinNotExist, League of Legends
  45. {
  46. press2("lwin", "1")
  47. }
  48.  
  49. if (info = 99) {
  50. FileRead, Text, %filepath0%
  51. firstLine := SubStr(Text, 1, Instr(Text, "`n") - 1)
  52.  
  53. StringReplace, inline, firstLine, %A_Tab%, %A_Space%, All
  54. Array := StrSplit(inline, A_Space)
  55. user := Array[1]
  56. pass := Array[2]
  57. StringReplace, pass, pass, %A_Space%, , All
  58.  
  59. Text := SubStr(Text, Instr(Text, "`n") + 1) . "`n" . SubStr(Text, 1, Instr(Text, "`n") - 1)
  60. FileDelete, %filepath0%
  61. FileAppend, %Text%, %filepath0%
  62. if (StrLen(firstLine) < 3) {
  63. Reload
  64. }
  65. }
  66.  
  67. Loop, read, %filepath%
  68. {
  69. StringReplace, inline, A_LoopReadLine, %A_Tab%, %A_Space%, All
  70. Array := StrSplit(inline, A_Space)
  71. if (Array[1] = info) {
  72. user := Array[2]
  73. pass := Array[3]
  74. server := Array[4]
  75. }
  76. if (Array[1] = "jungler") {
  77. jungler := Array[2]
  78. }
  79. }
  80.  
  81. closed := 1
  82.  
  83. loop {
  84. IfWinExist, Whoops
  85. WinClose
  86. IfWinExist, Network Warning
  87. WinClose
  88. IfWinExist, Error
  89. WinClose
  90. IfWinExist, Edge
  91. WinClose
  92. IfWinExist, Failed to Connect
  93. WinClose
  94. IfWinExist, League of Legends (TM) Client
  95. {
  96. WinActivate
  97. closed := 1
  98. if (checkcolor(1327, 736, "073947")) { ; in game
  99. play()
  100. } else {
  101. popups()
  102. }
  103. }
  104. else IfWinExist, League of Legends
  105. {
  106. WinActivate
  107. closed := 1
  108. resize()
  109. login()
  110. popups()
  111. startGame()
  112. }
  113. else
  114. {
  115. closed := closed + 1
  116. if (closed = 60) {
  117. closed := 0
  118. press2("lwin", "1")
  119. }
  120. }
  121. sleep 1000
  122. }
  123. return
  124.  
  125. resize() {
  126. checkclick("resize 1", 495, 706, "B2221B", 1429, 191)
  127. checkclick("resize 2", 869, 387, "6A6A62", 927, 393)
  128. checkclick("resize 3", 873, 446, "C2B48A", 925, 449)
  129. checkclick("resize 4", 780, 205, "B3ADA0", 955, 745)
  130. }
  131. return
  132.  
  133. login() {
  134. if (server = "n") {
  135. checkclick("from w to n1", 1420, 462, "C88C32", 1446, 462)
  136. checkclick("from w to n2", 1433, 470, "A09266", 1479, 475)
  137. checkclick("from w to n3", 1553, 507, "F0E6D2", 1577, 506)
  138. checkclick("from w to n4", 1482, 541, "BDB087", 1469, 540)
  139. sleep, 5000
  140. }
  141. if (not server = "n" or (server = "n" and checkcolor(1475, 461, "A85513"))) {
  142. if (checkcolor(378, 775, "D5291F")) {
  143. click("select username input box", 1536, 299, 1)
  144. press2special("ctrl", "a")
  145. press(user)
  146. pressSpecial("tab")
  147. press(pass)
  148. pressSpecial("enter")
  149. sleep, 20000
  150. }
  151. }
  152. }
  153.  
  154. popups() {
  155. checkclick("lvl up1", 371, 222, "01343A", 959, 636)
  156. checkclick("lvl up2", 372, 144, "013B41", 959, 633)
  157. checkclick("lvl up3", 963, 634, "C7A96D", 959, 633)
  158. checkclick("reconnect", 841, 467, "904028", 839, 464)
  159. checkclick("update desktop icons", 957, 507, "C7B98D", 960, 510)
  160. checkclick("accept terms", 885, 731, "C7B98E", 912, 728)
  161. checkclick("restore settings", 903, 508, "CDBE91", 898, 511)
  162. checkclick("no upgrading shards", 1211, 206, "CDBE91", 1210, 207)
  163. checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
  164. checkclick("restored to previous installation", 953, 500, "CABB8F", 960, 497)
  165. checkclick("there was a problem selecting champion", 963, 500, "C6B88C", 958, 500)
  166. checkclick("leaverbuster", 963, 517, "C6B88C", 956, 517)
  167. checkclick("declined too many in a row", 962, 499, "CDBE91", 960, 502)
  168.  
  169. if (checkcolor(951, 113, "627484") and checkcolor(915, 664, "9C9B8C")) { ; create summoner
  170. click("click to type in summoner name", 950, 665, 1)
  171. press(user)
  172. pressSpecial("enter")
  173. loop {
  174. checkclick("skip tutorial", 925, 431, "0493A7", 880, 795)
  175. checkclick("skip battle training", 937, 406, "0093C0", 877, 789)
  176. checkclick("select icon", 959, 427, "7BFE96", 957, 445)
  177. checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
  178. if (checkcolor(439, 132, "07B1B2")) {
  179. break
  180. }
  181. sleep, 3000
  182. }
  183. }
  184. if (checkcolor(1069, 427, "9C9588")) { ; buy ww
  185. checkclick("shop", 1069, 427, "9C9588", 958, 635)
  186. loop {
  187. checkclick("store", 1206, 147, "C6B88D", 1218, 147)
  188. checkclick("champions", 505, 203, "C5B78C", 494, 204)
  189. if (checkcolor(411, 270, "848174")) {
  190. click("search", 470, 273, 1)
  191. sleep, 10000
  192. press("rw")
  193. }
  194. checkclick("click ww", 651, 345, "689067", 653, 352)
  195. checkclick("buy ww", 651, 459, "617E58", 926, 574)
  196. if (checkcolor(830, 598, "BBAE86")) {
  197. click("done", 560, 146, 1)
  198. }
  199. sleep, 5000
  200. }
  201. }
  202. }
  203.  
  204. popups2() {
  205. checkclick("lvl up1", 371, 222, "01343A", 959, 636)
  206. checkclick("lvl up2", 372, 144, "013B41", 959, 633)
  207. checkclick("lvl up3", 963, 634, "C7A96D", 959, 633)
  208. checkclick("restore settings", 903, 508, "CDBE91", 898, 511)
  209. checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
  210. checkclick("leaverbuster", 963, 517, "C6B88C", 956, 517)
  211. checkclick("declined too many in a row", 962, 499, "CDBE91", 960, 502)
  212. }
  213.  
  214. startGame() {
  215. if (checkcolor(361, 143, "AD9968") or checkcolor(361, 143, "5C5B57") or checkcolor(897, 792, "5C5B55")) { ; play again
  216. pauseorclose()
  217. if (info = 99) {
  218. closeLeague()
  219. sleep, 5000
  220. Reload
  221. }
  222. click("play button", 930, 793, 1)
  223. }
  224. checkclick("play", 439, 132, "07B1B2", 439, 148) ; play
  225. checkclick("play 2", 434, 147, "F0E6D2", 444, 150) ; play 2
  226. checkclick("coop", 568, 269, "95948A", 452, 204) ; coop
  227. checkclick("coop 2", 449, 205, "CD9C58", 456, 204) ; coop (other)
  228. checkclick("intermediate", 654, 665, "0B222D", 654, 665) ; intermediate
  229. checkclick("confirm queue", 654, 664, "F0E6D2", 925, 796) ; confirm
  230. if (checkcolor(1000, 287, "325C4E")) {
  231. wx := junglerX[jungler]
  232. wy := junglerY[jungler]
  233. summonerCheck := 1
  234. warwick := 0
  235. loop {
  236. IfWinExist, League of Legends (TM) Client
  237. break
  238. checkclick("start queue", 913, 796, "56A6C7", 925, 797) ; start queue
  239. checkclick("start queue2", 913, 796, "819E9F", 925, 797) ; start queue
  240. if (checkcolor(954, 671, "5B5A56")) {
  241. PixelSearch, cx, cy, 656, 203, 1256, 600, 0x383E23, 0, fast, rgb
  242. if (not ErrorLevel) {
  243. wx := cx
  244. wy := cy
  245. warwick := 1
  246. }
  247. click("select champ", wx, wy, 1) ; select champ
  248. }
  249. else if (checkcolor(956, 671, "059AAB")) {
  250. if (summonerCheck = 1) {
  251. summonerCheck := 0
  252. if (checkcolor(1006, 778, "A4473E") = 0) {
  253. click("first summoner is not smite", 994, 777, 1)
  254. sleep, 5000
  255. click("click smite", 995, 624, 1)
  256. click("close smite popup", 1200, 780, 1)
  257. }
  258. if (checkcolor(1062, 771, "6ABF44") = 0) {
  259. click("first summoner is not heal", 1052, 776, 1)
  260. sleep, 5000
  261. click("click heal", 948, 611, 1)
  262. click("close heal popup", 1200, 780, 1)
  263. }
  264. }
  265. checkclick("lock champ", 956, 671, "059AAB", 958, 690) ; lock
  266. } else {
  267. click("accept queue", 954, 659, 1)
  268. if checkcolor(361, 143, "AD9968") or checkcolor(361, 143, "5C5B57")
  269. break
  270. if checkcolor(439, 132, "07B1B2") or checkcolor(434, 147, "F0E6D2")
  271. break
  272. if checkcolor(378, 775, "D5291F")
  273. break
  274. popups2()
  275. click("accept queue", 954, 659, 1)
  276. }
  277. }
  278. }
  279. }
  280.  
  281. startCustom() {
  282. log("start custom")
  283. IfWinExist, League of Legends
  284. WinActivate
  285. loop {
  286. checkclick("play", 439, 132, "07B1B2", 439, 148)
  287. checkclick("create custom", 701, 204, "CDBE86", 712, 203)
  288. checkclick("confirm", 941, 793, "A3C1A4", 932, 790)
  289. checkclick("start game", 927, 793, "95C7C7", 925, 801)
  290. checkclick("yes no exp", 925, 539, "CDBE91", 925, 542)
  291. if (checkcolor(762, 546, "262B25")) {
  292. wx := junglerX[jungler]
  293. wy := junglerY[jungler]
  294. loop {
  295. if (checkcolor(954, 671, "5B5A56")) {
  296. PixelSearch, cx, cy, 656, 203, 1256, 600, 0x383E23, 0, fast, rgb
  297. if (not ErrorLevel) {
  298. wx := cx
  299. wy := cy
  300. }
  301. click("select champ", wx, wy, 1) ; select champ
  302. }
  303. else if (checkcolor(956, 671, "059AAB")) {
  304. checkclick("lock champ", 956, 671, "059AAB", 958, 690)
  305. }
  306. IfWinExist, League of Legends (TM) Client
  307. {
  308. WinActivate
  309. if (checkcolor(1327, 736, "073947")) { ; in game
  310. play()
  311. return
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318.  
  319. closeLeague() {
  320. Process, Close, LeagueClient.exe
  321. Process, Close, LeagueClientUx.exe
  322. Process, Close, League Of Legends.exe
  323. }
  324.  
  325. pauseorclose() {
  326. loop {
  327. if (pause = 0)
  328. break
  329. IfWinExist, League of Legends (TM) Client
  330. break
  331. if (pause = 2) {
  332. shutdown, 12
  333. ExitApp
  334. }
  335. }
  336. }
  337.  
  338. #u::pause := 1
  339. #i::pause := 0
  340. #o::pause := 2
  341. #k::Pause
  342. #l::logging := 1
  343.  
  344. F1::ExitApp
  345.  
  346. F2::
  347. {
  348. closeLeague()
  349. sleep, 5000
  350. Reload
  351. }
  352.  
  353. F3::
  354. {
  355. Run builder.ahk
  356. Pause
  357. }
  358.  
  359. F4::
  360. {
  361. fullScriptPath = C:\Users\nnn\Documents\bot\builder.ahk ; edit with your full script path
  362. WinClose, %fullScriptPath% ahk_class AutoHotkey
  363. fullScriptPath = C:\Users\nnn\Documents\bot\pause.ahk ; edit with your full script path
  364. WinClose, %fullScriptPath% ahk_class AutoHotkey
  365. Pause
  366. }
  367.  
  368. F5::Reload
  369.  
  370. F6::
  371. {
  372. Text := ""
  373. LastLine := ""
  374. Loop, Read, %filepath0%
  375. {
  376. if (A_Index > 1) {
  377. Text := Text . "`n" . LastLine
  378. }
  379. LastLine := A_LoopReadLine
  380. }
  381. Text := LastLine . Text
  382. FileDelete, %filepath0%
  383. FileAppend, %Text%, %filepath0%
  384. closeLeague()
  385. sleep, 5000
  386. Reload
  387. }
  388.  
  389. F7::logging := 1
  390. F8::logging := 0
  391. F9::startCustom()
  392. F10::
  393. {
  394. IfWinExist, League of Legends (TM) Client
  395. {
  396. WinActivate
  397. play()
  398. }
  399. }
  400.  
  401. F11::
  402. {
  403. log("F11")
  404. IfWinExist, League of Legends (TM) Client
  405. {
  406. sleep, 1000
  407. click("wolves", red[1], red[2], 2)
  408. wait(30)
  409. fightcamp(2)
  410. }
  411. }
  412.  
  413. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  414.  
  415. play() {
  416. log("play")
  417. init()
  418. if (warwick) {
  419. firstRound()
  420. secondRound()
  421. thirdRound()
  422. } else {
  423. playsafe()
  424. }
  425. loop {
  426. fightAll()
  427. back()
  428. buyRandomItems(A_index+warwick*4)
  429. if end()
  430. break
  431. }
  432. }
  433.  
  434. init() {
  435. log("init")
  436. sleep, 3000
  437. side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
  438. levelupskill()
  439. check()
  440. Loop, 10 {
  441. if (side = 0) {
  442. side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
  443. }
  444. if (checkcolor(1328, 782, "DEA239") or checkcolor(1418, 760, "DEA239")) {
  445. log("start early")
  446. break
  447. }
  448. sleep, 6600
  449. }
  450. log("buy first items")
  451. buyitems("machete", 0)
  452. buyitems("cor", 0)
  453. buyitems("ref", 0)
  454. }
  455.  
  456. playsafe() {
  457. log("play safe")
  458. click("gromp", gromp[1+side], gromp[2+side], 2)
  459. wait(30)
  460. fightcamp(1)
  461. back()
  462. sleep, 3000
  463. side1 := side = 0 ? 2 : 0
  464. click("gromp", gromp[1+side1], gromp[2+side1], 2)
  465. sleep, 37000
  466. wait(20)
  467. fightcamp(1)
  468. back()
  469. buyitems("dagger", 0)
  470. click("wolves", wolves[1+side], wolves[2+side], 2)
  471. wait(30)
  472. fightcamp(2)
  473. back()
  474. buyitems("dagger", 0)
  475. click("gromp", gromp[1+side], gromp[2+side], 2)
  476. wait(30)
  477. fightcamp(1)
  478. back()
  479. buyitems("cloth", 0)
  480. click("red", red[1+side], red[2+side], 2)
  481. wait(30)
  482. fightcamp(2)
  483. back()
  484. sleep, 3000
  485. click("golems", golems[1+side], golems[2+side], 2)
  486. wait(30)
  487. fightcamp(1)
  488. back()
  489. buyitems("rec", 0)
  490. click("gromp", gromp[1+side], gromp[2+side], 2)
  491. wait(30)
  492. fightcamp(1)
  493. back()
  494. buyitems("long", 0)
  495. click("wolves", wolves[1+side], wolves[2+side], 2)
  496. wait(30)
  497. fightcamp(1)
  498. back()
  499. sleep, 3000
  500. click("golems", golems[1+side], golems[2+side], 2)
  501. wait(30)
  502. fightcamp(1)
  503. back()
  504. buyitems("scep", 0)
  505. click("wraiths", wraiths[1+side], wraiths[2+side], 2)
  506. wait(30)
  507. fightcamp(1)
  508. back()
  509. sleep, 3000
  510. click("gromp", gromp[1+side], gromp[2+side], 2)
  511. wait(30)
  512. fightcamp(1)
  513. back()
  514. sleep, 3000
  515. click("wolves", wolves[1+side], wolves[2+side], 2)
  516. wait(30)
  517. fightcamp(1)
  518. back()
  519. buyitems("cutl", 0)
  520. click("golems", golems[1+side], golems[2+side], 2)
  521. wait(30)
  522. fightcamp(1)
  523. back()
  524. sleep, 3000
  525. click("gromp", gromp[1+side], gromp[2+side], 2)
  526. wait(30)
  527. fightcamp(1)
  528. back()
  529. buyitems("bork", 0)
  530. click("wolves", wolves[1+side], wolves[2+side], 2)
  531. wait(30)
  532. fightcamp(1)
  533. back()
  534. sleep, 3000
  535. click("golems", golems[1+side], golems[2+side], 2)
  536. wait(30)
  537. fightcamp(1)
  538. back()
  539. buyitems("bork", 0)
  540. click("gromp", gromp[1+side], gromp[2+side], 2)
  541. wait(30)
  542. fightcamp(1)
  543. back()
  544. buyitems("bork", 0)
  545. click("wolves", wolves[1+side], wolves[2+side], 2)
  546. wait(30)
  547. fightcamp(1)
  548. back()
  549. sleep, 3000
  550. click("golems", golems[1+side], golems[2+side], 2)
  551. wait(30)
  552. fightcamp(1)
  553. back()
  554. buyitems("bork", 0)
  555. fightAll()
  556. back()
  557. buyitems("giants", 0)
  558. buyitems("chain", 0)
  559. }
  560.  
  561. firstRound() {
  562. log("first round")
  563. click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
  564. wait(30)
  565. fightcamp(1)
  566. click("blue", blue[1+side], blue[2+side], 2)
  567. wait(7)
  568. fightcamp(2)
  569. back()
  570. buyitems("tali", 0)
  571. buyitems("dagger", 0)
  572.  
  573. click("wolves", wolves[1+side], wolves[2+side], 2)
  574. wait(30)
  575. fightcamp(1)
  576. back()
  577. buyitems("dagger", 0)
  578. click("red", red[1+side], red[2+side], 2)
  579. wait(38)
  580. fightcamp(2)
  581. back()
  582. sleep, 3000
  583.  
  584. click("golems", golems[1+side], golems[2+side], 2)
  585. wait(35)
  586. fightcamp(1)
  587. back()
  588. buyitems("bow", 0)
  589. }
  590.  
  591. secondRound() {
  592. log("second round")
  593. click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
  594. wait(30)
  595. fightcamp(1)
  596. click("blue", blue[1+side], blue[2+side], 2)
  597. wait(7)
  598. fightcamp(2)
  599. click("wolves", wolves[1+side], wolves[2+side], 2)
  600. wait(7)
  601. fightcamp(1)
  602. back()
  603. buyitems("long", 0)
  604.  
  605. click("golems", golems[1+side], golems[2+side], 2)
  606. wait(35)
  607. fightcamp(1)
  608. back()
  609. buyitems("ski", 0)
  610. buyitems("vampiric", 0)
  611. }
  612.  
  613. thirdRound() {
  614. log("third round")
  615. click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
  616. wait(30)
  617. fightcamp(1)
  618. click("blue", blue[1+side], blue[2+side], 2)
  619. wait(7)
  620. fightcamp(2)
  621. click("wolves", wolves[1+side], wolves[2+side], 2)
  622. wait(7)
  623. fightcamp(1)
  624. back()
  625. buyitems("long", 0)
  626.  
  627. click("golems", golems[1+side], golems[2+side], 2)
  628. wait(30)
  629. fightcamp(1)
  630. click("red", red[1+side], red[2+side], 2)
  631. wait(7)
  632. fightcamp(2)
  633. back()
  634. buyitems("cutlass", 0)
  635. }
  636.  
  637. fightAll() {
  638. log("full round")
  639. click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
  640. wait(30)
  641. fightcamp(1)
  642. click("blue", blue[1+side], blue[2+side], 2)
  643. wait(7)
  644. fightcamp(2)
  645. click("wolves", wolves[1+side], wolves[2+side], 2)
  646. wait(7)
  647. fightcamp(1)
  648. click("wraiths", wraiths[1+side], wraiths[2+side], 2)
  649. wait(15)
  650. fightcamp(1)
  651. click("red", red[1+side], red[2+side], 2)
  652. wait(7)
  653. fightcamp(2)
  654. click("golems", golems[1+side], golems[2+side], 2)
  655. wait(10)
  656. fightcamp(1)
  657. }
  658.  
  659. wait(duration) {
  660. log("wait " duration)
  661. check()
  662. sleep 3000
  663. duration := duration - 3
  664. loop, %duration% {
  665. if findColors(px, py)
  666. return
  667. IfWinExist, Whoops
  668. WinClose
  669. IfWinExist, Network Warning
  670. WinClose
  671. sleep 1000
  672. if end()
  673. break
  674. }
  675. }
  676.  
  677. findColors(byref px, byref py) {
  678. for index, element in colors {
  679. if (side = 0) {
  680. PixelSearch, px, py, 700, 200, 1300, 650, element, 0, Fast, rgb
  681. } else {
  682. PixelSearch, px, py, 700, 100, 1300, 650, element, 0, Fast, rgb
  683. }
  684. if (!ErrorLevel) {
  685. log("found " index)
  686. return 1
  687. }
  688. }
  689. return 0
  690. }
  691.  
  692. fightcamp(ind) {
  693. log("fight camp " ind)
  694. if end()
  695. return
  696. if not findColors(px, py)
  697. return
  698. loop, 6 {
  699. findColors(px, py)
  700. click("attack", px + xplus[ind], py + yplus[ind], 2)
  701. press("q")
  702. press("w")
  703. sleep 500
  704. }
  705. finished := 0
  706. loop {
  707. if end()
  708. break
  709. press("q")
  710. press("w")
  711. press("d")
  712. if (checkcolor(991, 841, "010D07")) {
  713. press("1")
  714. press("2")
  715. }
  716. if (checkcolor(808, 838, "010D07")) {
  717. press("f")
  718. }
  719. sleep 500
  720. if (not findColors(px, py)) {
  721. sleep, 2000
  722. if (side = 0) {
  723. click("move away", 940, 381, 2)
  724. } else {
  725. click("move away", 940, 475, 2)
  726. }
  727. found := 0
  728. loop, 5 {
  729. if (findColors(px, py)) {
  730. found := 1
  731. }
  732. sleep, 300
  733. }
  734. if (found = 0) {
  735. levelupskill()
  736. return
  737. }
  738. }
  739. else
  740. click("attack", px + xplus[ind], py + yplus[ind], 2)
  741. }
  742. }
  743.  
  744. check() {
  745. if checkcolor(1239, 854, "1A3531") ; camera
  746. send z
  747. checkclick("warning close", 905, 325, "0C1312", 952, 535) ; Warning
  748. checkclick("disconnected close", 886, 338, "68C0A0", 952, 535) ; Disconnected
  749. checkclick("options close", 1021, 218, "143239", 1320, 206) ; Options opened
  750. checkclick("", 1376, 163, "AB9944", 1377, 162) ; Shop opened
  751.  
  752. SendInput {Tab down}
  753. SendInput {Tab up}
  754. }
  755.  
  756. end() {
  757. if (checkcolor(906, 582, "9C1B0D")) {
  758. log("end")
  759. if (info = 99 and pause = 0) {
  760. closeLeague()
  761. sleep, 5000
  762. Reload
  763. }
  764. click("end", 962, 582, 1)
  765. return 1
  766. }
  767. if (checkcolor(925, 455, "17484E")) {
  768. log("end")
  769. if (info = 99 and pause = 0) {
  770. closeLeague()
  771. sleep, 5000
  772. Reload
  773. }
  774. Process, Close, League Of Legends.exe
  775. return 1
  776. }
  777. IfWinNotExist, League of Legends (TM) Client
  778. {
  779. log("end")
  780. return 1
  781. }
  782. return 0
  783. }
  784.  
  785. back() {
  786. if end()
  787. return
  788. log("back")
  789. press("b")
  790. sleep 8500
  791. }
  792.  
  793. levelupskill() {
  794. log("level up skill")
  795. press2("control", "r")
  796. press2("control", "q")
  797. press2("control", "w")
  798. press2("control", "e")
  799. }
  800. return
  801.  
  802. buyRandomItems(index) {
  803. if (index = 1) {
  804. buyitems("bork", 0)
  805. buyitems("boots", 0)
  806. } else if (index = 2) {
  807. buyitems("blood", 1)
  808. buyitems("belt", 0)
  809. } else if (index < 5) {
  810. buyrandomitems2(2)
  811. } else {
  812. buyrandomitems2(3)
  813. }
  814. }
  815. return
  816.  
  817. buyrandomitems2(index) {
  818. seznam := [["long", "dagger", "ruby"], ["phage", "giant", "spectre"], ["bc", "rand", "spirit"]]
  819. seznam2 := seznam[index]
  820. loop, 2 {
  821. random, r, 1, 3
  822. buyitems(seznam2[r], 0)
  823. }
  824. }
  825. return
  826.  
  827. buyitems(item, i) {
  828. log("buy " item)
  829. if end()
  830. return
  831. press("p")
  832. sleep, 1000
  833. press2("ctrl", "l")
  834. sleep, 1000
  835. press(item)
  836. sleep, 1000
  837. pressspecial("down")
  838. sleep, 1000
  839. if (i) {
  840. pressspecial("down")
  841. sleep, 1000
  842. }
  843. pressspecial("enter")
  844. sleep, 1000
  845. pressspecial("esc")
  846. sleep, 1000
  847. }
  848.  
  849. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  850.  
  851. move(x, y) {
  852. log("move " x y)
  853. mousemove, x, y
  854. }
  855.  
  856. click(log, x, y, b) {
  857. if b = 1
  858. mouseclick, left, x, y
  859. else
  860. mouseclick, right, x, y
  861. log(log " " x " " y " " b)
  862. }
  863.  
  864. press(first) {
  865. log("press " first)
  866. sendinput %first%
  867. }
  868.  
  869. press2(first, second) {
  870. log("press " first " " second)
  871. sendinput {%first% down}
  872. sendinput %second%
  873. sendinput {%first% up}
  874. }
  875.  
  876. pressSpecial(first) {
  877. log("press special " first)
  878. sendinput {%first%}
  879. }
  880.  
  881. press2Special(first, second) {
  882. log("press special " first " " second)
  883. sendinput {%first% down}
  884. sendinput {%second%}
  885. sendinput {%first% up}
  886. }
  887.  
  888. checkcolor(x, y, rgb) {
  889. pixelgetcolor, color, x, y, rgb
  890. if RGB_Euclidian_Distance(color, "0x" + rgb) < 3
  891. return 1
  892. return 0
  893. }
  894.  
  895. RGB_Euclidian_Distance( c1, c2 ) {
  896. r1 := c1 >> 16
  897. g1 := c1 >> 8 & 255
  898. b1 := c1 & 255
  899. r2 := c2 >> 16
  900. g2 := c2 >> 8 & 255
  901. b2 := c2 & 255
  902. return Sqrt( (r1-r2)**2 + (g1-g2)**2 + (b1-b2)**2 )
  903. }
  904.  
  905. checkclick(log, x1, y1, rgb, x2, y2) {
  906. if checkcolor(x1, y1, rgb) = 0
  907. return 0
  908. click(log, x2, y2, 1)
  909. return 1
  910. }
  911.  
  912. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  913.  
  914. global debugCounter := 0
  915. global qx := 0
  916. global qy := 0
  917. global qc := "000000"
  918.  
  919. #t::
  920. {
  921. setCheckClick(0)
  922. }
  923. return
  924.  
  925. #z::
  926. {
  927. setCheckClick(2000)
  928. }
  929. return
  930.  
  931. setCheckClick(timeout)
  932. {
  933. if not mod(debugCounter, 2)
  934. {
  935. MouseGetPos, qx, qy
  936. sleep, timeout
  937. PixelGetColor, qc, qx, qy, rgb
  938. }
  939. else
  940. {
  941. MouseGetPos, x, y
  942. c := substr(qc, 3)
  943. clipboard = checkclick("", %qx%, %qy%, "%c%", %x%, %y%)
  944. }
  945. debugCounter++
  946. output := mod(debugCounter, 2)
  947. msgbox %output%
  948. }
  949. return
  950.  
  951. log(text) {
  952. if (logging) {
  953. FileAppend, %text%`r, %filepathlog%
  954. }
  955. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement