League Tools V6.05 - 05-07-18

Post gaming related scripts
User avatar
Gorgrak
Posts: 23
Joined: 07 Dec 2015, 16:34

Re: League Tools V4.0 - 03-28-16

28 Mar 2016, 20:17

I noticed that ClipCursor uses different variable values in your script?

In one place it is:

Code: Select all

ClipCursor( Confine, 13, 13, A_screenwidth-13, A_screenheight-13)
And in another it is:

Code: Select all

ClipCursor(Confine=True, x1=0 , y1=0, x2=1920, y2=1080)
My monitor is not 1920x1080. Should I change the x2 and y2 values to "A_screenwidth" and "A_screenheight", respectively?
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.0 - 03-28-16

28 Mar 2016, 21:00

The first call is passing params into the second. The function just has those "=" so that if it is passed null or an empty var it will take values as a default.

So basically if x1 is passed nothing, default to 0. Same for x2, y1 and y2.

Code: Select all

ClipCursor(Confine=True, x1=0 , y1=0, x2=1920, y2=1080)
{
	VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
	Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
}
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 10:12

Curious, why did you remove mobafire? I see line 184 commented out and then no block for mobafire URLS under the Guides: label.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 10:55

randomguy9472 wrote:Curious, why did you remove mobafire? I see line 184 commented out and then no block for mobafire URLS under the Guides: label.
I noticed that some of the mobafire links were beginning to break for certain champions. This seems to be due to the mobafire website adding a random number at the end of some of the links.

Code: Select all

http://www.mobafire.com/league-of-legends/champion/aurelion-sol-130
I can't seem to figure out where the "-130" is coming from. It does not seem to align with the API call, Aurelion Sol's id is 136. So they are removed for the time being.
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 11:02

Ruevil2 wrote:I can't seem to figure out where the "-130" is coming from. It does not seem to align with the API call, Aurelion Sol's id is 136. So they are removed for the time being.
It's definitely related to release order. Annie is 1, Aurelion Sol is 130, Jhin is 129, Illaoi is 128.

-EDIT-
Took a while to find but Kayle is 2. Annie and Kayle were both part of the first batch of champions, but I can't seem to figure out how they're ordered beyond that. There were 17 champions released in the first batch, but they seem to be numbered in no particular order on Mobafire.

-EDIT-
Master Yi is 3, also part of the first batch. Kindred is 127. So far pattern holds.

-EDIT-
Alistar is 4. Interestingly enough 5-10 follow alphabetical order: Ryze, Sion, Sivir, Soraka, Sion, Tristana. The next 7 are mixed back and forth between champs alphabetically before Ryze, and champs alphabetically after Tristana. Singed, the first champion released after the batch of 17, is 18 on Mobafire. Still the pattern holds.

-EDIT-
Bard, Ekko, and Tahm Kench are 124, 125, 126. DEFINITELY champion release order after the initial batch of 17. I can't seem to find a pattern for those 17 though.
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 14:34

I don't know if this helps at all but:

Code: Select all

Annie	1
Kayle	2
Master Yi	3
Alistar	4
Ryze	5
Sion	6
Sivir	7
Soraka	8
Teemo	9
Tristana	10
Warwick	11
Nunu	12
Ashe	13
Tryndamere	14
Jax	15
Morgana	16
Zilean	17
Singed	18
Evelynn	19
Twitch	20
Karthus	21
Cho'Gath	22
Amumu	23
Rammus	24
Anivia	25
Dr. Mundo	26
Kassadin	27
Twisted Fate	28
Janna	29
Gangplank	30
Corki	31
Taric	32
Veigar	33
Blitzcrank	34
Malphite	35
Katarina	36
Nasus	37
Fiddlesticks	38
Udyr	39
Heimerdinger	40
Shaco	41
Nidalee	42
Poppy	43
Pantheon	44
Gragas	45
Mordekaiser	46
Ezreal	47
Shen	48
Kennen	49
Akali	50
Garen	51
Malzahar	52
Olaf	53
Kog'Maw	54
Xin Zhao	55
Vladimir	56
Galio	57
Urgot	58
Miss Fortune	59
Sona	60
Swain	61
Lux	62
LeBlanc	63
Irelia	64
Trundle	65
Cassiopeia	66
Caitlyn	67
Renekton	68
Karma	69
Maokai	70
Jarvan IV	71
Nocturne	72
Lee Sin	73
Brand	74
Rumble	75
Vayne	76
Orianna	77
Yorick	78
Leona	79
Wukong	80
Skarner	81
Talon	82
Riven	83
Xerath	84
Graves	85
Shyvana	86
Fizz	87
Volibear	88
Ahri	89
Viktor	90
Sejuani	91
Ziggs	92
Nautilus	93
Fiora	94
Lulu	95
Hecarim	96
Varus	97
Darius	98
Draven	99
Jayce	100
Zyra	101
Diana	102
Rengar	103
Syndra	104
Kha'Zix	105
Elise	106
Zed	107
Nami	108
Vi	109
Thresh	110
Quinn	111
Zac	112
Lissandra	113
Aatrox	114
Lucian	115
Jinx	116
Yasuo	117
Vel'Koz	118
Braum	119
Gnar	120
Azir	121
Kalista	122
Rek'Sai	123
Bard	124
Ekko	125
Tahm Kench	126
Kindred	127
Illaoi	128
Jhin	129
Aurelion Sol	130
User avatar
Gorgrak
Posts: 23
Joined: 07 Dec 2015, 16:34

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 14:43

I fixed some issues in the Start(type1) section:

Code: Select all

	If type1 = 5v5 Ranked
	{
		MouseMove, (w*.42),(h*.19)
		MouseClick, left, (w*.42),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.60),(h*.19)
		MouseClick, left, (w*.60),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.68),(h*.19)
		MouseClick, left, (w*.68),(h*.19),,0
		Sleep, %StartSleep%
	}
	else if type1 = 5v5 Draft
	{
		MouseMove, (w*.42),(h*.19)
		MouseClick, left, (w*.42),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.60),(h*.19)
		MouseClick, left, (w*.60),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.68),(h*.24)
		MouseClick, left, (w*.68),(h*.24),,0
		Sleep, %StartSleep%
	}
	else if type1 = 5v5 Blind
	{
		MouseMove, (w*.42),(h*.19)
		MouseClick, left, (w*.42),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.60),(h*.19)
		MouseClick, left, (w*.60),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.68),(h*.32)
		MouseClick, left, (w*.68),(h*.32),,0
		Sleep, %StartSleep%
	}
	else if type1 = 3v3 Blind
	{
		MouseMove, (w*.42),(h*.19)
		MouseClick, left, (w*.42),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.60),(h*.24)
		MouseClick, left, (w*.60),(h*.24),,0
		Sleep, %StartSleep%
		MouseMove, (w*.68),(h*.19)
		MouseClick, left, (w*.68),(h*.19),,0
		Sleep, %StartSleep%
	}
	else if type1 = ARAM
	{
		MouseMove, (w*.42),(h*.22)
		MouseClick, left, (w*.42),(h*.22),,0
		Sleep, %StartSleep%
		MouseMove, (w*.60),(h*.19)
		MouseClick, left, (w*.60),(h*.19),,0
		Sleep, %StartSleep%
		MouseMove, (w*.68),(h*.19)
		MouseClick, left, (w*.68),(h*.19),,0
		Sleep, %StartSleep%
	}
randomguy9472 wrote: I don't know if this helps at all but:
Good work, m8! :thumbup:
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 14:55

Random, but in case this is of use to anyone, a while back I was trying to get this script to run at boot, but due to some changes in newer versions of windows, depending on your system, placing files directly in the startup folder doesn't always work anymore. Other than registry edits or getting some 3rd party tools, the best way to run this script at boot I've found was to compile the script into an executible (using the tool AHK provides) and use the built-in Task Scheduler to set up a new task that runs at the login of any user (or your user). There's some detailed guides on how to set up tasks available online (use the googles :P).

To update the script, I keep the .ahk version in the same directory and just edit and recompile it (script has to be stopped).
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 15:19

randomguy9472 wrote:Random, but in case this is of use to anyone, a while back I was trying to get this script to run at boot, but due to some changes in newer versions of windows, depending on your system, placing files directly in the startup folder doesn't always work anymore. Other than registry edits or getting some 3rd party tools, the best way to run this script at boot I've found was to compile the script into an executible (using the tool AHK provides) and use the built-in Task Scheduler to set up a new task that runs at the login of any user (or your user). There's some detailed guides on how to set up tasks available online (use the googles :P).

To update the script, I keep the .ahk version in the same directory and just edit and recompile it (script has to be stopped).
Could you use this command in the Task Scheduler to compile on the fly? Rather than calling the script directly, pass it as a param to the autohotkey.exe

Code: Select all

C:\program files\autohotkey\AutoHotkey.exe C:\Script.ahk
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 15:33

Ruevil2 wrote: Could you use this command in the Task Scheduler to compile on the fly? Rather than calling the script directly, pass it as a param to the autohotkey.exe
I'm sure you could. I was just being exceptionally lazy when I set it up myself. :P

-EDIT-
Yup, it works. Just set up the action like this: http://grab.by/P6MY


-EDIT-
Don't forget to check the box to run with highest privileges!

-EDIT-
If anyone wants, just copy the code below into an xml file and import that into Task Scheduler. No need to configure all that from scratch. The only adjustment you need to make is on the 5th and 4th to last lines. On the 5th to last, change path to your AHK installation, and on the 4th, change path to your script location.

Code: Select all

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2016-01-18T22:36:27.5104951</Date>
    <Author>ANDROID-419A5DF\User</Author>
    <Description>Launch League Tools AHK script with admin rights.</Description>
    <URI>\League Tools</URI>
  </RegistrationInfo>
  <Triggers>
    <LogonTrigger>
      <Enabled>true</Enabled>
    </LogonTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-2646924673-2995476194-3937964064-1000</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>"C:\Program Files\AutoHotkey\AutoHotkey.exe"</Command>
      <Arguments>"C:\Users\User\Desktop\Games\League of Legends\League Tools.ahk"</Arguments>
    </Exec>
  </Actions>
</Task>
Last edited by randomguy9472 on 30 Mar 2016, 11:29, edited 1 time in total.
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.1 - 03-28-16

29 Mar 2016, 16:48

I guess if you really wanted to, you could include a menu option to add an auto launch task. No idea if it can be done natively in AHK, but you could just have a block that writes out a powershell script to a temporary file and run that.

Assuming I didn't make any mistakes or overlook something, the following code should do it:

Code: Select all

$action = New-ScheduledTaskAction -Execute "C:\Path\To\AutoHotkey.exe" -Argument "C:\Path\To\League Tools.ahk"
$trigger = New-ScheduledTaskTrigger -AtLogon
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::FromHours(2))

Register-ScheduledTask -Action $action -Trigger $trigger -Settings $settings -TaskName "League Tools" -Description "Launch League Tools AHK script with admin rights." -RunLevel Highest
You'd just have to pass the proper paths down to New-ScheduledTaskAction
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.1 - 03-28-16

30 Mar 2016, 11:00

Small update. Only minor adjustments and tweaks.

fixed skin sales not reading dates properly
adjusted start coordinates
User avatar
Gorgrak
Posts: 23
Joined: 07 Dec 2015, 16:34

Re: League Tools V4.1 - 03-28-16

30 Mar 2016, 14:21

I modified 1 line to match current file structure:

Code: Select all

FileAppend, %str%, %A_ScriptDir%\%ScriptName%\ChampListAPIReturn.txt
EDIT:
Interesting; even though I changed the location, the file still gets created in just the %A_ScriptDir% directory. I don't have time right now to check why.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.1 - 03-28-16

30 Mar 2016, 16:03

Gorgrak wrote:I modified 1 line to match current file structure:

Code: Select all

FileAppend, %str%, %A_ScriptDir%\%ScriptName%\ChampListAPIReturn.txt
EDIT:
Interesting; even though I changed the location, the file still gets created in just the %A_ScriptDir% directory. I don't have time right now to check why.
As a side note. This txt file is used for debugging purposes and shows the raw JSON returned by the API call. Can be safely removed. The directory issue is with the ScriptName var not being passed into the function call. Declaring 'ScriptName' as global would fix this problem.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.1 - 03-28-16

30 Mar 2016, 18:57

Update 4.2

Changes:
New tool! SmartCast quick toggle
- Now switch abilities to Smartcast on the fly without changing settings!
- Toggled with Alt + Q,W,E,R
Debug txt file removed
Hotkey setup block moved to bottom of script to account for #WinActive sensitive hotkeys
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.2 - 03-30-16

31 Mar 2016, 17:56

Alt+Q/W/E/R might not be the best shortcut here, as that is usually set to Self Casting.

-EDIT-

To be honest, this probably isn't of much use to me as I smartcast everything. It wouldn't be a bad idea to include a setting to enable or disable this in the config file so we don't have to comment out a dozen lines in two different parts of the script every update.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.2 - 03-30-16

01 Apr 2016, 10:21

randomguy9472 wrote:Alt+Q/W/E/R might not be the best shortcut here, as that is usually set to Self Casting.

-EDIT-

To be honest, this probably isn't of much use to me as I smartcast everything. It wouldn't be a bad idea to include a setting to enable or disable this in the config file so we don't have to comment out a dozen lines in two different parts of the script every update.
Hey I realized I was overwriting keys that other people might be using! I just wasn't using it myself. I think I chose one that isn't being used.

New Smartcast Hotkeys:
Alt + F1/F2/F3/F4
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: League Tools V4.3 - 04-01-16

01 Apr 2016, 19:31

Update:

All Hotkeys exported to configurable _hotkeys.ini file
Changed default smartcast toggle to Ctrl + F1/F2/F3/F4
adjusted skin sales RegEx and date configuration
randomguy9472
Posts: 28
Joined: 27 Jan 2016, 12:20

Re: League Tools V4.3 - 04-01-16

02 Apr 2016, 12:06

So I just realized, when launching the script as a parameter passed to autohotkey.exe at boot, the script icon isn't shown in the taskbar. Pressing f12 to refresh fixes this.

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 32 guests