Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=P:\pictures\ico\REPORTL.ICO
- #AutoIt3Wrapper_UseUpx=n
- #AutoIt3Wrapper_Res_Description=LoL Masteries Man.
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.107
- #AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
- #AutoIt3Wrapper_Res_LegalCopyright=nvn
- #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y
- #AutoIt3Wrapper_Run_After=del /f /q folderPlay_Obfuscated.au3
- #AutoIt3Wrapper_Run_Tidy=y
- #Obfuscator_Parameters=/cs=0 /cn=0 /cf=1 /cv=1 /sf=1 /sv=1
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Run_Debug_Mode=n
- #include <Misc.au3>
- OnAutoItExitRegister('OnAutoItExit')
- HotKeySet('{end}', 'OnAutoItExit')
- HotKeySet('{ins}', 'getpx')
- HotKeySet('{home}', 'getpix')
- $log = FileOpen(@ScriptDir & '\log.txt', 1)
- Func OnAutoItExit()
- FileClose($log)
- Exit
- EndFunc ;==>OnAutoItExit
- AutoItSetOption("MouseCoordMode", 0)
- AutoItSetOption("PixelCoordMode", 0)
- AutoItSetOption("MouseClickDelay", 1)
- AutoItSetOption("MouseClickDownDelay", 1)
- If Not focus() Then
- If _Singleton("lolmastersv", 1) == 0 Then
- MsgBox(0, 'LoL Masteries Save', 'Already running', 3)
- Exit
- EndIf
- If FileExists("C:\Riot Games\League of Legends\lol.launcher.exe") Then
- Run("C:\Riot Games\League of Legends\lol.launcher.exe", "C:\Riot Games\League of Legends")
- While ProcessExists('lol.launcher.exe') And Not WinExists("PVP.net Client", "")
- Sleep(1000)
- WEnd
- If Not WinExists("PVP.net Client", "") Then
- MsgBox(0, 'LoLMasterSave', 'Start Leage Of Legends first')
- Exit
- EndIf
- Sleep(500)
- WinActivate("PVP.net Client", "")
- Else
- MsgBox(0, 'LoLMasterSave', 'Start Leage Of Legends first')
- Exit
- EndIf
- Else
- If _Singleton("lolmastersv", 1) == 0 Then
- WinActivate("PVP.net Client", "")
- MsgBox(0, 'LoL Masteries Save', 'Already running', 3)
- Exit
- EndIf
- EndIf
- #cs
- Master reletive poz 115, 274
- ; masteries detect
- Position: 143, 252
- Color: 0x672019
- Position: 206, 248
- Color: 0xBEDCF9
- Position: 284, 240
- Color: 0xA2BA9A
- #ce
- $hwnd = WinGetHandle("PVP.net Client", "")
- Global $so
- Global $s = WinGetPos($hwnd)
- $xa = 120
- $ya = 290
- Global $wndx = $s[0] + $xa
- Global $wndy = $s[1] + $ya
- Dim $wndw = 210
- Dim $wndh = 317
- $tp = 0
- $show = 1
- $zord = 0
- Global $db[100]
- Global $dbsize = 0
- $dbf = @ScriptDir & '\lolMasterSet.dat'
- $place = 0
- $frz = 1
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GUIListBox.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- Opt("GUIOnEventMode", 1)
- $wnd = GUICreate("LoLMasterSave", 210, 301, 240, 166, $WS_POPUP, $WS_EX_TOOLWINDOW)
- GUISetFont(11, 400, 0, "Microsoft Sans Serif")
- GUISetBkColor(0xC9B170)
- GUISetOnEvent($GUI_EVENT_CLOSE, "wndClose")
- GUISetOnEvent($GUI_EVENT_MINIMIZE, "wndMinimize")
- GUISetOnEvent($GUI_EVENT_MAXIMIZE, "wndMaximize")
- GUISetOnEvent($GUI_EVENT_RESTORE, "wndRestore")
- $list1 = GUICtrlCreateList("", 0, 128, 209, 200, -1, 0)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "list1Click")
- $Button1 = GUICtrlCreateButton("Apply", 128, 96, 83, 25, $WS_GROUP)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "setM")
- $code = GUICtrlCreateEdit("", 80, 24, 129, 60, $ES_WANTRETURN)
- GUICtrlSetData(-1, StringFormat("00000000000000,00000000000000,000000000000000"))
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetTip(-1, "Masteries Code: Fill the numbers from the tree to the right.")
- GUICtrlSetOnEvent(-1, "codeChange")
- $Label2 = GUICtrlCreateLabel("Offense:", 0, 24, 76, 20)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "Label2Click")
- $Label3 = GUICtrlCreateLabel("Defense:", 0, 44, 79, 20)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "Label3Click")
- $Label4 = GUICtrlCreateLabel("Utility:", 0, 64, 75, 20)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "Label4Click")
- $name = GUICtrlCreateInput("Select below", 0, 0, 209, 19, BitOR($ES_CENTER, $ES_AUTOHSCROLL), 0)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetTip(-1, "Type the name here")
- GUICtrlSetOnEvent(-1, "nameChange")
- $Button2 = GUICtrlCreateButton("Save", 56, 96, 67, 25, $WS_GROUP)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "save")
- $Button3 = GUICtrlCreateButton("Delete", 0, 96, 51, 25, $WS_GROUP)
- GUICtrlSetColor(-1, 0x404040)
- GUICtrlSetOnEvent(-1, "delete")
- GUISetState(@SW_SHOW)
- WinSetState($wnd, "", @SW_HIDE)
- Load()
- AdlibRegister('position', 10)
- AdlibRegister('state', 100)
- AdlibRegister('zorder', 50)
- Sleep(1000)
- $frz = 0
- While 1
- Sleep(10)
- WEnd
- Func save()
- $i = c(dbn2i(GUICtrlRead($name)))
- $j = c(_GUICtrlListBox_FindString($list1, GUICtrlRead($name), 1))
- If $j == -1 Then
- If UBound($db) <= $dbsize Then Return
- $db[$dbsize] = GUICtrlRead($name) & ':' & GUICtrlRead($code)
- $dbsize += 1
- _GUICtrlListBox_AddString($list1, GUICtrlRead($name))
- _GUICtrlListBox_SetCurSel($list1, _GUICtrlListBox_FindString($list1, GUICtrlRead($name), 1))
- Else
- $db[$i] = GUICtrlRead($name) & ':' & GUICtrlRead($code)
- ;_GUICtrlListBox_ReplaceString($list1, $i, GUICtrlRead($name))
- _GUICtrlListBox_SetCurSel($list1, $j)
- list1Click()
- EndIf
- dbsave()
- EndFunc ;==>save
- Func delete()
- $i = dbn2i(GUICtrlRead($list1))
- $j = _GUICtrlListBox_FindString($list1, GUICtrlRead($list1), 1)
- If $i == -1 Then Return
- $db[$i] = ''
- _GUICtrlListBox_DeleteString($list1, $j)
- If $i > 0 Then
- $i -= 1
- Else
- $i = 0
- EndIf
- _GUICtrlListBox_SetCurSel($list1, $j)
- list1Click()
- EndFunc ;==>delete
- Func codeChange()
- EndFunc ;==>codeChange
- Func Label2Click()
- EndFunc ;==>Label2Click
- Func Label3Click()
- EndFunc ;==>Label3Click
- Func Label4Click()
- EndFunc ;==>Label4Click
- Func list1Click()
- $i = dbn2i(GUICtrlRead($list1))
- If $i == -1 Then
- c('onclick db fail')
- Return
- EndIf
- ;Agro:30014401313001,00000000000000,031040100000000
- GUICtrlSetData($name, StringMid($db[$i], 1, StringInStr($db[$i], ':') - 1))
- GUICtrlSetData($code, StringMid($db[$i], StringInStr($db[$i], ':') + 1))
- EndFunc ;==>list1Click
- Func nameChange()
- EndFunc ;==>nameChange
- Func wndClose()
- EndFunc ;==>wndClose
- Func wndMaximize()
- EndFunc ;==>wndMaximize
- Func wndMinimize()
- EndFunc ;==>wndMinimize
- Func wndRestore()
- EndFunc ;==>wndRestore
- Func getpix()
- $gpx1 = PixelGetColor(141, 254, $hwnd)
- FileWriteLine($log, $gpx1)
- EndFunc ;==>getpix
- Func getpx()
- $tmp = MouseGetPos()
- $gpx2 = PixelGetColor($tmp[0], $tmp[1], $hwnd)
- FileWriteLine($log, $tmp[0] & ',' & $tmp[1] & @TAB & $gpx2)
- EndFunc ;==>getpx
- Func dbload()
- $file = FileOpen($dbf, 0)
- ; Check if file opened for reading OK
- If $file = -1 Then
- c('no file to load')
- $db[0] = '21-0-9 AP Offense:10034401313001,00000000000000,013040001000000'
- $db[1] = 'Tank:00000000000000,13033421030001,013040001000000'
- $db[2] = 'just a test:30014401313001,00000000000000,031040100000000'
- $dbsize = 3
- Return
- EndIf
- $dbsize = 0
- ; Read in lines of text until the EOF is reached
- While $dbsize < UBound($db)
- $line = FileReadLine($file)
- If @error = -1 Then ExitLoop
- if (StringLen($line) > 46) and (StringInStr($line, ':') > 0) Then
- $db[$dbsize] = $line
- $dbsize += 1
- EndIf
- WEnd
- FileClose($file)
- EndFunc ;==>dbload
- Func dbsave()
- $file = FileOpen($dbf, 2)
- ; Check if file opened for writing OK
- If $file = -1 Then
- MsgBox(0, "Error", "Unable to open file.")
- Exit
- EndIf
- For $i = 0 To UBound($db) - 1
- if ((StringLen($db[$i]) > 46) and (StringInStr($db[$i], ':') > 0)) Then
- FileWriteLine($file, $db[$i])
- EndIf
- Next
- FileClose($file)
- EndFunc ;==>dbsave
- Func dbn2i($txt)
- $l = StringLen($txt)
- $i = 0
- while (($i < UBound($db)) and ($i < $dbsize) and (StringLeft($db[$i], $l) <> $txt))
- $i += 1
- WEnd
- If StringLeft($db[$i], $l) <> $txt Then
- c("can't find:""" & $txt & """")
- Return -1
- Else
- Return $i
- EndIf
- EndFunc ;==>dbn2i
- Func Load()
- dbload()
- WinSetOnTop($wnd, '', 0)
- WinMove($wnd, '', $wndx, $wndy, $wndw, $wndh)
- db2list()
- EndFunc ;==>Load
- Func db2list()
- _GUICtrlListBox_BeginUpdate($list1)
- $i = 0
- while (($i < UBound($db)) and (StringLen($db[$i]) > 46) and (StringInStr($db[$i], ':') > 0))
- _GUICtrlListBox_AddString($list1, StringMid($db[$i], 1, StringInStr($db[$i], ':') - 1))
- $i += 1
- WEnd
- _GUICtrlListBox_EndUpdate($list1)
- _GUICtrlListBox_SetCurSel($list1, 0)
- list1Click()
- EndFunc ;==>db2list
- Func setM()
- $m = GUICtrlRead($code)
- WinSetOnTop($wnd, '', 1)
- focus()
- ;30014401313001,00000000000000,031040100000000
- $m = StringReplace($m, ',', '')
- If StringLen($m) <> 43 Then
- c('not 43')
- Return
- EndIf
- If $place == 1 Then
- $frz = 1
- $tmp = MouseGetPos()
- MouseClick("left", 287, 668, 1, 1)
- #cs
- Return Points
- Position: 287, 668
- Cursor ID: 0
- Color: 0x1F4470 (2049136)
- Yes do it dialog
- Position: 610, 540
- Cursor ID: 0
- Color: 0x1D4270 (1917552)
- #ce
- If Not pixwait(610, 540, 1917552, 10000, $hwnd, 10) Then
- $frz = 0
- Return
- EndIf
- MouseClick("left", 583, 541, 1, 1)
- If Not pixwait(287, 668, 2049136, 10000, $hwnd, 10) Then
- $frz = 0
- Return
- EndIf
- ;Sleep(500)
- $cord = '385,245;449,245;509,245;577,245;449,323;509,323;389,403;449,401;511,403;579,403;451,481;451,561;509,563;451,639;657,243;719,243;781,241;843,247;723,321;785,319;723,403;785,401;841,401;721,475;785,479;725,561;783,565;727,639;929,241;997,243;1057,239;1115,241;993,317;1055,323;931,401;993,399;1053,401;1117,397;1059,477;1123,479;999,559;1055,557;1001,641'
- $cord = StringSplit($cord, ';')
- For $k = 1 To $cord[0]
- For $i = 1 To StringMid($m, $k, 1)
- c($k & ': ' & $cord[$k])
- Execute('MouseClick("left",' & $cord[$k] & ',1,1)')
- Next
- Next
- MouseClick("left", 229, 703, 1, 1)
- ;MouseMove(637,519)
- ;Sleep(2000)
- #cs
- Position: 617, 521
- Cursor ID: 0
- Color: 0x1C406F (1851503)
- #ce
- If Not pixwait(617, 521, 1851503, 10000, $hwnd, 10) Then
- $frz = 0
- Return
- EndIf
- MouseClick("left", 617, 521, 1, 1)
- MouseMove($tmp[0], $tmp[1], 1)
- Sleep(100)
- $frz = 0
- ElseIf $place == 2 Then
- $frz = 1
- $tmp = MouseGetPos()
- MouseClick("left", 288, 644, 1, 1)
- If Not pixwait(605, 516, 1720171, 10000, $hwnd, 10) Then
- $frz = 0
- Return
- EndIf
- ; are you sure?
- MouseClick("left", 605, 516, 1, 1); yes
- If Not pixwait(278, 644, 1982828, 10000, $hwnd, 10) Then
- $frz = 0
- Return
- EndIf
- ; returned
- $cord = '387,224;457,224;513,222;577,220;447,300;509,300;387,388;457,378;515,378;587,384;455,458;449,532;515,534;443,614;657,216;717,218;785,218;849,214;735,300;787,300;713,384;791,378;847,382;725,452;803,454;723,536;787,536;725,618;931,218;991,220;1059,222;1115,222;997,296;1061,292;921,392;1003,378;1059,376;1123,384;1063,452;1123,456;997,538;1067,536;993,612'
- $cord = StringSplit($cord, ';')
- For $k = 1 To $cord[0]
- For $i = 1 To StringMid($m, $k, 1)
- c($k & ': ' & $cord[$k])
- Execute('MouseClick("left",' & $cord[$k] & ',1,1)')
- Next
- Next
- ;MouseClick("left", 279, 679, 1, 1)
- ;MouseMove(637,519)
- ;Sleep(2000)
- ;MouseClick("left", 641, 457, 1, 1)
- ;MouseMove($tmp[0], $tmp[1], 1)
- MouseMove(641, 457, 1)
- Sleep(100)
- $frz = 0
- EndIf
- EndFunc ;==>setM
- Func pixwait($x = 0, $y = 0, $c = 0, $t = 5000, $hndl = '', $tmt = 100)
- $tt = TimerInit()
- While TimerDiff($tt) < $t And PixelGetColor($x, $y, $hndl) <> $c
- Sleep($tmt)
- WEnd
- if (TimerDiff($tt) >= $t) Then
- Return 0
- Else
- Return 1
- EndIf
- EndFunc ;==>pixwait
- Func position()
- If $frz Then Return
- ;#############################
- ; position handle
- $so = $s
- $s = WinGetPos($hwnd)
- ;handle window positioning
- If @error Then
- Exit
- EndIf
- ;position relative to the folder
- If $s[0] <> $so[0] Or $s[1] <> $so[1] Then
- ;115, 274
- $wndx = $s[0] + $xa
- $wndy = $s[1] + $ya
- WinMove($wnd, '', $wndx, $wndy, $wndw, $wndh)
- EndIf
- ;############################
- EndFunc ;==>position
- Func state()
- If $frz Then Return
- ;##############################
- ; State handle
- ;$po = MouseGetPos()
- ;cb($po[0]&", "&$po[1])
- $px = PixelGetColor(141, 254, $hwnd)
- $place = 0
- If $px == 10576732 Then
- $place = 1
- ElseIf $px == 13284473 Then
- $place = 2
- EndIf
- If $place <> 0 Then
- If $show == 0 Then
- WinSetState($wnd, "", @SW_SHOW)
- $show = 1
- c('tab here show')
- EndIf
- Else
- If $show == 1 Then
- WinSetState($wnd, "", @SW_HIDE)
- $show = 0
- c("no tab: hide")
- EndIf
- Return
- EndIf
- EndFunc ;==>state
- Func zorder()
- If $frz Then Return
- $tpo = $tp
- $tp = WinGetTitle("[active]")
- If $tpo == $tp Then Return
- If $tp == 'PVP.net Client' Then
- If $zord == 0 Then
- WinSetOnTop($wnd, '', 1)
- WinActivate($wnd)
- WinActivate($hwnd)
- $zord = 1
- ;WinSetTrans($wnd, '', 255)
- ;$pausedimlvl = 255
- c('set top')
- EndIf
- ElseIf $tp == 'LoLMasterSave' Then
- Return
- Elseif ($zord == 1) Then
- WinSetOnTop($wnd, '', 0)
- WinActivate($wnd)
- WinActivate($tp)
- $zord = 0
- ;WinSetTrans($wnd, '', 128)
- ;$pausedimlvl = 128
- c('set bot: ' & $tp)
- EndIf
- #cs
- ;##################################
- ; topmost handle
- $tpo = $tp
- $tp = WinActive($hwnd)
- If $tpo <> $tp Then
- If $tp Then
- WinSetOnTop($wnd, '', 1)
- WinActivate($wnd)
- WinActivate($hwnd)
- ;WinSetTrans($wnd, '', 255)
- ;$pausedimlvl = 255
- c('LoL set top')
- ElseIF WinActive($wnd) Then
- c('mod is top')
- Else
- Local $active = WinGetTitle("[active]")
- WinSetOnTop($wnd, '', 0)
- WinActivate($wnd)
- WinActivate($active)
- ;WinSetTrans($wnd, '', 128)
- ;$pausedimlvl = 128
- c('set bot')
- EndIf
- EndIf
- ;############################
- #ce
- EndFunc ;==>zorder
- Func focus($t = 1)
- Return _WinWaitActivate("PVP.net Client", "", $t)
- EndFunc ;==>focus
- Func c($txt)
- ConsoleWrite($txt & @CRLF)
- Return $txt
- EndFunc ;==>c
- Func cb($txt = '')
- ConsoleWrite($txt)
- Return $txt
- EndFunc ;==>cb
- Func _WinWaitActivate($title, $text, $timeout = 0)
- WinWait($title, $text, $timeout)
- If Not WinActive($title, $text) Then WinActivate($title, $text)
- If Not WinWaitActive($title, $text, $timeout) Then
- ;msgbox(0,"lolMasterSave","Start Leage Of Legends first")
- Return 0
- Else
- Return 1
- EndIf
- EndFunc ;==>_WinWaitActivate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement