Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #singleinstance force
- coordmode, mouse, screen
- coordmode, pixel, screen
- SetTitleMatchMode 2
- DetectHiddenWindows, On
- global logging = 0
- global filepath0 := "E:\inf0.txt"
- global filepath := "E:\inf.txt"
- global filepathlog := "E:\log.txt"
- global info := 0
- global user := ""
- global pass := ""
- global server := ""
- global colors := ["0xC15757", "0x481617"]
- global xplus := [30, 60]
- global yplus := [30, 60]
- global side := 0
- global pause := 0
- global warwick := 0
- global jungler := 1
- global junglerX := [700, 800, 900, 1000, 1100, 1200, 700, 800, 900, 1000, 1100, 1200]
- global junglerY := [250, 250, 250, 250, 250, 250, 350, 350, 350, 350, 350, 350]
- 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 := [1379, 818, 1372, 728]
- global golems := [1386, 829, 1362, 712]
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- FileRead, info, info.txt
- if (!info) {
- InputBox info
- FileAppend, %info%, info.txt
- }
- IfWinNotExist, League of Legends
- {
- press2("lwin", "1")
- }
- if (info = 99) {
- FileRead, Text, %filepath0%
- firstLine := SubStr(Text, 1, Instr(Text, "`n") - 1)
- StringReplace, inline, firstLine, %A_Tab%, %A_Space%, All
- Array := StrSplit(inline, A_Space)
- user := Array[1]
- pass := Array[2]
- StringReplace, pass, pass, %A_Space%, , All
- Text := SubStr(Text, Instr(Text, "`n") + 1) . "`n" . SubStr(Text, 1, Instr(Text, "`n") - 1)
- FileDelete, %filepath0%
- FileAppend, %Text%, %filepath0%
- if (StrLen(firstLine) < 3) {
- Reload
- }
- }
- Loop, read, %filepath%
- {
- StringReplace, inline, A_LoopReadLine, %A_Tab%, %A_Space%, All
- Array := StrSplit(inline, A_Space)
- if (Array[1] = info) {
- user := Array[2]
- pass := Array[3]
- server := Array[4]
- }
- if (Array[1] = "jungler") {
- jungler := Array[2]
- }
- }
- closed := 1
- loop {
- IfWinExist, Whoops
- WinClose
- IfWinExist, Network Warning
- WinClose
- IfWinExist, Error
- WinClose
- IfWinExist, Edge
- WinClose
- IfWinExist, Failed to Connect
- WinClose
- IfWinExist, League of Legends (TM) Client
- {
- WinActivate
- closed := 1
- if (checkcolor(1327, 736, "073947")) { ; in game
- play()
- } else {
- popups()
- }
- }
- else IfWinExist, League of Legends
- {
- WinActivate
- closed := 1
- resize()
- login()
- popups()
- startGame()
- }
- else
- {
- closed := closed + 1
- if (closed = 60) {
- closed := 0
- press2("lwin", "1")
- }
- }
- sleep 1000
- }
- return
- resize() {
- checkclick("resize 1", 495, 706, "B2221B", 1429, 191)
- checkclick("resize 2", 869, 387, "6A6A62", 927, 393)
- checkclick("resize 3", 873, 446, "C2B48A", 925, 449)
- checkclick("resize 4", 780, 205, "B3ADA0", 955, 745)
- }
- return
- login() {
- if (server = "n") {
- checkclick("from w to n1", 1420, 462, "C88C32", 1446, 462)
- checkclick("from w to n2", 1433, 470, "A09266", 1479, 475)
- checkclick("from w to n3", 1553, 507, "F0E6D2", 1577, 506)
- checkclick("from w to n4", 1482, 541, "BDB087", 1469, 540)
- sleep, 5000
- }
- if (not server = "n" or (server = "n" and checkcolor(1475, 461, "A85513"))) {
- if (checkcolor(378, 775, "D5291F")) {
- click("select username input box", 1536, 299, 1)
- press2special("ctrl", "a")
- press(user)
- pressSpecial("tab")
- press(pass)
- pressSpecial("enter")
- sleep, 20000
- }
- }
- }
- popups() {
- checkclick("lvl up1", 371, 222, "01343A", 959, 636)
- checkclick("lvl up2", 372, 144, "013B41", 959, 633)
- checkclick("lvl up3", 963, 634, "C7A96D", 959, 633)
- checkclick("reconnect", 841, 467, "904028", 839, 464)
- checkclick("update desktop icons", 957, 507, "C7B98D", 960, 510)
- checkclick("accept terms", 885, 731, "C7B98E", 912, 728)
- checkclick("restore settings", 903, 508, "CDBE91", 898, 511)
- checkclick("no upgrading shards", 1211, 206, "CDBE91", 1210, 207)
- checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
- checkclick("restored to previous installation", 953, 500, "CABB8F", 960, 497)
- checkclick("there was a problem selecting champion", 963, 500, "C6B88C", 958, 500)
- checkclick("leaverbuster", 963, 517, "C6B88C", 956, 517)
- checkclick("declined too many in a row", 962, 499, "CDBE91", 960, 502)
- if (checkcolor(951, 113, "627484") and checkcolor(915, 664, "9C9B8C")) { ; create summoner
- click("click to type in summoner name", 950, 665, 1)
- press(user)
- pressSpecial("enter")
- loop {
- checkclick("skip tutorial", 925, 431, "0493A7", 880, 795)
- checkclick("skip battle training", 937, 406, "0093C0", 877, 789)
- checkclick("select icon", 959, 427, "7BFE96", 957, 445)
- checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
- if (checkcolor(439, 132, "07B1B2")) {
- break
- }
- sleep, 3000
- }
- }
- if (checkcolor(1069, 427, "9C9588")) { ; buy ww
- checkclick("shop", 1069, 427, "9C9588", 958, 635)
- loop {
- checkclick("store", 1206, 147, "C6B88D", 1218, 147)
- checkclick("champions", 505, 203, "C5B78C", 494, 204)
- if (checkcolor(411, 270, "848174")) {
- click("search", 470, 273, 1)
- sleep, 10000
- press("rw")
- }
- checkclick("click ww", 651, 345, "689067", 653, 352)
- checkclick("buy ww", 651, 459, "617E58", 926, 574)
- if (checkcolor(830, 598, "BBAE86")) {
- click("done", 560, 146, 1)
- }
- sleep, 5000
- }
- }
- }
- popups2() {
- checkclick("lvl up1", 371, 222, "01343A", 959, 636)
- checkclick("lvl up2", 372, 144, "013B41", 959, 633)
- checkclick("lvl up3", 963, 634, "C7A96D", 959, 633)
- checkclick("restore settings", 903, 508, "CDBE91", 898, 511)
- checkclick("unable to retrieve settings", 903, 507, "CDBE91", 897, 509)
- checkclick("leaverbuster", 963, 517, "C6B88C", 956, 517)
- checkclick("declined too many in a row", 962, 499, "CDBE91", 960, 502)
- }
- startGame() {
- if (checkcolor(361, 143, "AD9968") or checkcolor(361, 143, "5C5B57") or checkcolor(897, 792, "5C5B55")) { ; play again
- pauseorclose()
- if (info = 99) {
- closeLeague()
- sleep, 5000
- Reload
- }
- click("play button", 930, 793, 1)
- }
- checkclick("play", 439, 132, "07B1B2", 439, 148) ; play
- checkclick("play 2", 434, 147, "F0E6D2", 444, 150) ; play 2
- checkclick("coop", 568, 269, "95948A", 452, 204) ; coop
- checkclick("coop 2", 449, 205, "CD9C58", 456, 204) ; coop (other)
- checkclick("intermediate", 654, 665, "0B222D", 654, 665) ; intermediate
- checkclick("confirm queue", 654, 664, "F0E6D2", 925, 796) ; confirm
- if (checkcolor(1000, 287, "325C4E")) {
- wx := junglerX[jungler]
- wy := junglerY[jungler]
- summonerCheck := 1
- warwick := 0
- loop {
- IfWinExist, League of Legends (TM) Client
- break
- checkclick("start queue", 913, 796, "56A6C7", 925, 797) ; start queue
- checkclick("start queue2", 913, 796, "819E9F", 925, 797) ; start queue
- if (checkcolor(954, 671, "5B5A56")) {
- PixelSearch, cx, cy, 656, 203, 1256, 600, 0x383E23, 0, fast, rgb
- if (not ErrorLevel) {
- wx := cx
- wy := cy
- warwick := 1
- }
- click("select champ", wx, wy, 1) ; select champ
- }
- else if (checkcolor(956, 671, "059AAB")) {
- if (summonerCheck = 1) {
- summonerCheck := 0
- if (checkcolor(1006, 778, "A4473E") = 0) {
- click("first summoner is not smite", 994, 777, 1)
- sleep, 5000
- click("click smite", 995, 624, 1)
- click("close smite popup", 1200, 780, 1)
- }
- if (checkcolor(1062, 771, "6ABF44") = 0) {
- click("first summoner is not heal", 1052, 776, 1)
- sleep, 5000
- click("click heal", 948, 611, 1)
- click("close heal popup", 1200, 780, 1)
- }
- }
- checkclick("lock champ", 956, 671, "059AAB", 958, 690) ; lock
- } else {
- click("accept queue", 954, 659, 1)
- if checkcolor(361, 143, "AD9968") or checkcolor(361, 143, "5C5B57")
- break
- if checkcolor(439, 132, "07B1B2") or checkcolor(434, 147, "F0E6D2")
- break
- if checkcolor(378, 775, "D5291F")
- break
- popups2()
- click("accept queue", 954, 659, 1)
- }
- }
- }
- }
- startCustom() {
- log("start custom")
- IfWinExist, League of Legends
- WinActivate
- loop {
- checkclick("play", 439, 132, "07B1B2", 439, 148)
- checkclick("create custom", 701, 204, "CDBE86", 712, 203)
- checkclick("confirm", 941, 793, "A3C1A4", 932, 790)
- checkclick("start game", 927, 793, "95C7C7", 925, 801)
- checkclick("yes no exp", 925, 539, "CDBE91", 925, 542)
- if (checkcolor(762, 546, "262B25")) {
- wx := junglerX[jungler]
- wy := junglerY[jungler]
- loop {
- if (checkcolor(954, 671, "5B5A56")) {
- PixelSearch, cx, cy, 656, 203, 1256, 600, 0x383E23, 0, fast, rgb
- if (not ErrorLevel) {
- wx := cx
- wy := cy
- }
- click("select champ", wx, wy, 1) ; select champ
- }
- else if (checkcolor(956, 671, "059AAB")) {
- checkclick("lock champ", 956, 671, "059AAB", 958, 690)
- }
- IfWinExist, League of Legends (TM) Client
- {
- WinActivate
- if (checkcolor(1327, 736, "073947")) { ; in game
- play()
- return
- }
- }
- }
- }
- }
- }
- closeLeague() {
- Process, Close, LeagueClient.exe
- Process, Close, LeagueClientUx.exe
- Process, Close, League Of Legends.exe
- }
- pauseorclose() {
- loop {
- if (pause = 0)
- break
- IfWinExist, League of Legends (TM) Client
- break
- if (pause = 2) {
- shutdown, 12
- ExitApp
- }
- }
- }
- #u::pause := 1
- #i::pause := 0
- #o::pause := 2
- #k::Pause
- #l::logging := 1
- F1::ExitApp
- F2::
- {
- closeLeague()
- sleep, 5000
- Reload
- }
- F3::
- {
- Run builder.ahk
- Pause
- }
- F4::
- {
- fullScriptPath = C:\Users\nnn\Documents\bot\builder.ahk ; edit with your full script path
- WinClose, %fullScriptPath% ahk_class AutoHotkey
- fullScriptPath = C:\Users\nnn\Documents\bot\pause.ahk ; edit with your full script path
- WinClose, %fullScriptPath% ahk_class AutoHotkey
- Pause
- }
- F5::Reload
- F6::
- {
- Text := ""
- LastLine := ""
- Loop, Read, %filepath0%
- {
- if (A_Index > 1) {
- Text := Text . "`n" . LastLine
- }
- LastLine := A_LoopReadLine
- }
- Text := LastLine . Text
- FileDelete, %filepath0%
- FileAppend, %Text%, %filepath0%
- closeLeague()
- sleep, 5000
- Reload
- }
- F7::logging := 1
- F8::logging := 0
- F9::startCustom()
- F10::
- {
- IfWinExist, League of Legends (TM) Client
- {
- WinActivate
- play()
- }
- }
- F11::
- {
- log("F11")
- IfWinExist, League of Legends (TM) Client
- {
- sleep, 1000
- click("wolves", red[1], red[2], 2)
- wait(30)
- fightcamp(2)
- }
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- play() {
- log("play")
- init()
- if (warwick) {
- firstRound()
- secondRound()
- thirdRound()
- } else {
- playsafe()
- }
- loop {
- fightAll()
- back()
- buyRandomItems(A_index+warwick*4)
- if end()
- break
- }
- }
- init() {
- log("init")
- sleep, 3000
- side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
- levelupskill()
- check()
- Loop, 10 {
- if (side = 0) {
- side := checkcolor(1411, 708, "65898F") * 2 ; 0 - blue, 2 - red
- }
- if (checkcolor(1328, 782, "DEA239") or checkcolor(1418, 760, "DEA239")) {
- log("start early")
- break
- }
- sleep, 6600
- }
- log("buy first items")
- buyitems("machete", 0)
- buyitems("cor", 0)
- buyitems("ref", 0)
- }
- playsafe() {
- log("play safe")
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- side1 := side = 0 ? 2 : 0
- click("gromp", gromp[1+side1], gromp[2+side1], 2)
- sleep, 37000
- wait(20)
- fightcamp(1)
- back()
- buyitems("dagger", 0)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(2)
- back()
- buyitems("dagger", 0)
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("cloth", 0)
- click("red", red[1+side], red[2+side], 2)
- wait(30)
- fightcamp(2)
- back()
- sleep, 3000
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("rec", 0)
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("long", 0)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("scep", 0)
- click("wraiths", wraiths[1+side], wraiths[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("cutl", 0)
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("bork", 0)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("bork", 0)
- click("gromp", gromp[1+side], gromp[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("bork", 0)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- sleep, 3000
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("bork", 0)
- fightAll()
- back()
- buyitems("giants", 0)
- buyitems("chain", 0)
- }
- firstRound() {
- log("first round")
- click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- click("blue", blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- back()
- buyitems("tali", 0)
- buyitems("dagger", 0)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(30)
- fightcamp(1)
- back()
- buyitems("dagger", 0)
- click("red", red[1+side], red[2+side], 2)
- wait(38)
- fightcamp(2)
- back()
- sleep, 3000
- click("golems", golems[1+side], golems[2+side], 2)
- wait(35)
- fightcamp(1)
- back()
- buyitems("bow", 0)
- }
- secondRound() {
- log("second round")
- click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- click("blue", blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- back()
- buyitems("long", 0)
- click("golems", golems[1+side], golems[2+side], 2)
- wait(35)
- fightcamp(1)
- back()
- buyitems("ski", 0)
- buyitems("vampiric", 0)
- }
- thirdRound() {
- log("third round")
- click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- click("blue", blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- back()
- buyitems("long", 0)
- click("golems", golems[1+side], golems[2+side], 2)
- wait(30)
- fightcamp(1)
- click("red", red[1+side], red[2+side], 2)
- wait(7)
- fightcamp(2)
- back()
- buyitems("cutlass", 0)
- }
- fightAll() {
- log("full round")
- click("gromp", gromp[1+side], gromp[2+side], 2) ; go to gromp
- wait(30)
- fightcamp(1)
- click("blue", blue[1+side], blue[2+side], 2)
- wait(7)
- fightcamp(2)
- click("wolves", wolves[1+side], wolves[2+side], 2)
- wait(7)
- fightcamp(1)
- click("wraiths", wraiths[1+side], wraiths[2+side], 2)
- wait(15)
- fightcamp(1)
- click("red", red[1+side], red[2+side], 2)
- wait(7)
- fightcamp(2)
- click("golems", golems[1+side], golems[2+side], 2)
- wait(10)
- fightcamp(1)
- }
- wait(duration) {
- log("wait " duration)
- check()
- sleep 3000
- duration := duration - 3
- loop, %duration% {
- if findColors(px, py)
- return
- IfWinExist, Whoops
- WinClose
- IfWinExist, Network Warning
- WinClose
- sleep 1000
- if end()
- break
- }
- }
- findColors(byref px, byref py) {
- for index, element in colors {
- if (side = 0) {
- PixelSearch, px, py, 700, 200, 1300, 650, element, 0, Fast, rgb
- } else {
- PixelSearch, px, py, 700, 100, 1300, 650, element, 0, Fast, rgb
- }
- if (!ErrorLevel) {
- log("found " index)
- return 1
- }
- }
- return 0
- }
- fightcamp(ind) {
- log("fight camp " ind)
- if end()
- return
- if not findColors(px, py)
- return
- loop, 6 {
- findColors(px, py)
- click("attack", px + xplus[ind], py + yplus[ind], 2)
- press("q")
- press("w")
- sleep 500
- }
- finished := 0
- loop {
- if end()
- break
- press("q")
- press("w")
- press("d")
- if (checkcolor(991, 841, "010D07")) {
- press("1")
- press("2")
- }
- if (checkcolor(808, 838, "010D07")) {
- press("f")
- }
- sleep 500
- if (not findColors(px, py)) {
- sleep, 2000
- if (side = 0) {
- click("move away", 940, 381, 2)
- } else {
- click("move away", 940, 475, 2)
- }
- found := 0
- loop, 5 {
- if (findColors(px, py)) {
- found := 1
- }
- sleep, 300
- }
- if (found = 0) {
- levelupskill()
- return
- }
- }
- else
- click("attack", px + xplus[ind], py + yplus[ind], 2)
- }
- }
- check() {
- if checkcolor(1239, 854, "1A3531") ; camera
- send z
- checkclick("warning close", 905, 325, "0C1312", 952, 535) ; Warning
- checkclick("disconnected close", 886, 338, "68C0A0", 952, 535) ; Disconnected
- checkclick("options close", 1021, 218, "143239", 1320, 206) ; Options opened
- checkclick("", 1376, 163, "AB9944", 1377, 162) ; Shop opened
- SendInput {Tab down}
- SendInput {Tab up}
- }
- end() {
- if (checkcolor(906, 582, "9C1B0D")) {
- log("end")
- if (info = 99 and pause = 0) {
- closeLeague()
- sleep, 5000
- Reload
- }
- click("end", 962, 582, 1)
- return 1
- }
- if (checkcolor(925, 455, "17484E")) {
- log("end")
- if (info = 99 and pause = 0) {
- closeLeague()
- sleep, 5000
- Reload
- }
- Process, Close, League Of Legends.exe
- return 1
- }
- IfWinNotExist, League of Legends (TM) Client
- {
- log("end")
- return 1
- }
- return 0
- }
- back() {
- if end()
- return
- log("back")
- press("b")
- sleep 8500
- }
- levelupskill() {
- log("level up skill")
- press2("control", "r")
- press2("control", "q")
- press2("control", "w")
- press2("control", "e")
- }
- return
- buyRandomItems(index) {
- if (index = 1) {
- buyitems("bork", 0)
- buyitems("boots", 0)
- } else if (index = 2) {
- buyitems("blood", 1)
- buyitems("belt", 0)
- } else if (index < 5) {
- buyrandomitems2(2)
- } else {
- buyrandomitems2(3)
- }
- }
- return
- buyrandomitems2(index) {
- seznam := [["long", "dagger", "ruby"], ["phage", "giant", "spectre"], ["bc", "rand", "spirit"]]
- seznam2 := seznam[index]
- loop, 2 {
- random, r, 1, 3
- buyitems(seznam2[r], 0)
- }
- }
- return
- buyitems(item, i) {
- log("buy " item)
- if end()
- return
- press("p")
- sleep, 1000
- press2("ctrl", "l")
- sleep, 1000
- press(item)
- sleep, 1000
- pressspecial("down")
- sleep, 1000
- if (i) {
- pressspecial("down")
- sleep, 1000
- }
- pressspecial("enter")
- sleep, 1000
- pressspecial("esc")
- sleep, 1000
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- move(x, y) {
- log("move " x y)
- mousemove, x, y
- }
- click(log, x, y, b) {
- if b = 1
- mouseclick, left, x, y
- else
- mouseclick, right, x, y
- log(log " " x " " y " " b)
- }
- press(first) {
- log("press " first)
- sendinput %first%
- }
- press2(first, second) {
- log("press " first " " second)
- sendinput {%first% down}
- sendinput %second%
- sendinput {%first% up}
- }
- pressSpecial(first) {
- log("press special " first)
- sendinput {%first%}
- }
- press2Special(first, second) {
- log("press special " first " " second)
- sendinput {%first% down}
- sendinput {%second%}
- sendinput {%first% up}
- }
- checkcolor(x, y, rgb) {
- pixelgetcolor, color, x, y, rgb
- if RGB_Euclidian_Distance(color, "0x" + rgb) < 3
- return 1
- return 0
- }
- 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 )
- }
- checkclick(log, x1, y1, rgb, x2, y2) {
- if checkcolor(x1, y1, rgb) = 0
- return 0
- click(log, x2, y2, 1)
- return 1
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- global debugCounter := 0
- global qx := 0
- global qy := 0
- global qc := "000000"
- #t::
- {
- setCheckClick(0)
- }
- return
- #z::
- {
- setCheckClick(2000)
- }
- return
- setCheckClick(timeout)
- {
- if not mod(debugCounter, 2)
- {
- MouseGetPos, qx, qy
- sleep, timeout
- PixelGetColor, qc, qx, qy, rgb
- }
- else
- {
- MouseGetPos, x, y
- c := substr(qc, 3)
- clipboard = checkclick("", %qx%, %qy%, "%c%", %x%, %y%)
- }
- debugCounter++
- output := mod(debugCounter, 2)
- msgbox %output%
- }
- return
- log(text) {
- if (logging) {
- FileAppend, %text%`r, %filepathlog%
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement