Page 3 of 10

Posted: 12 Mar 2016, 21:03
by Gorgrak
To hide the Accounts Menu (because I only use a single account) add/replace this in the Menu section of the script:

Code: Select all

If Login2 !=
	Menu, Tray, Add, Select Account, :Accounts
Thanks Osimodas for your contributions; specifically, I LOVE the idea of adding icons to the menu. I am having trouble integrating it with Ruevil's script, though, because when he grabs the champion list he automatically changes names that are supposed to have spaces or ' in them so it is making it difficult for me to grab those pics off the website.

EDIT: (3/12/16 @ 9:25 PM)
To integrate Osimodas's icon script I added his stuff into the TrayMenu section at the end of the ChampListD Loop (but still inside the loop).

To fix some errors in his code (when integrating into Ruevil's script) and to fix my above problem I now have this code:
*** The webaddresses are CASE SENSITIVE *** (this took some time figuring out the STUPID case sensitive icon web pages.... UGH)
(this is the complete code of Ruevil's ChampListD loop + Osimodas's icon script)

Code: Select all

Loop % Count0
{
	Champ := Count%A_Index%
	StringSplit, n, Champ, -
	StringSplit, f, n2, :
	If Reg = ru
	{
		Menu, %f2%, Add, Lol-Game.ru, Guides
		Menu, %f2%, Add
	}
	Else If Reg = kr
	{
		Menu, %f2%, Add, lol.inven.co.kr, Guides
		Menu, %f2%, Add
	}
	Menu, %f2%, Add, MobaFire, Guides
	Menu, %f2%, Add, LOLKing, Guides
	Menu, %f2%, Add, LOLPro, Guides
	Menu, %f2%, Add, SoloMid, Guides
	Menu, %f2%, Add, ProBuilds, Guides
	If (A_Index = 41) || (A_Index = 81) || (A_Index = 121) || (A_Index = 161) || (A_Index = 201)
		Menu, GuideMenu, Add, %f2%, :%f2%, +BarBreak
	Else
		Menu, GuideMenu, Add, %f2%, :%f2%
	if f2 = Cho'Gath
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/Chogath.png
	else if f2 = Dr. Mundo
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/DrMundo.png
	else if f2 = Fiddlesticks
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/FiddleSticks.png
	else if f2 = Jarvan IV
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/JarvanIV.png
	else if f2 = Kha'Zix
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/Khazix.png
	else if f2 = Kog'Maw
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/KogMaw.png
	else if f2 = LeBlanc
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/Leblanc.png
	else if f2 = Lee Sin
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/LeeSin.png
	else if f2 = Master Yi
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/MasterYi.png
	else if f2 = Miss Fortune
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/MissFortune.png
	else if f2 = Rek'Sai
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/RekSai.png
	else if f2 = Tahm Kench
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/TahmKench.png
	else if f2 = Twisted Fate
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/TwistedFate.png
	else if f2 = Vel'Koz
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/Velkoz.png
	else if f2 = Wukong
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/MonkeyKing.png
	else if f2 = Xin Zhao
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/XinZhao.png
	else
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/%f2%.png
	If( InStr( FileExist("ChampIcon"), "D") )
	{
	}else{
		FileCreateDir, ChampIcon
	}
	IfNotExist, ChampIcon\%f2%.png
	{
		UrlDownloadToFile, %urlchamp%, ChampIcon\%f2%.png
		Menu, GuideMenu, Icon, %f2%, ChampIcon\%f2%.png,,20
	}
	else
	{
		Menu, GuideMenu, Icon, %f2%, ChampIcon\%f2%.png,,20
	}
}
The first time you run the script it will take a few long seconds to download all the campion icons and add them into a folder named "ChampIcon" that will be created wherever you run the script from.

ALSO!!! Ruevil you had a typo in the ChampListD StringReplace for Tahm Kench the variable was spelled tehmkench when it should have been tahmkench

Re: League Tools V3.8 - 02-29-16

Posted: 13 Mar 2016, 19:41
by randomguy9472
Using your latest published version, the champion list no longer shows up as a menu option. Naturally, due to that, I can't test Osimodas'/Gorgrak's mod above either.

Re: League Tools V3.8 - 02-29-16

Posted: 14 Mar 2016, 07:00
by Gorgrak
Can you elaborate? Mine works perfectly with the download on page 1.

Re: League Tools V3.8 - 02-29-16

Posted: 16 Mar 2016, 09:18
by randomguy9472
Don't see what you want me to elaborate on. Upon replacing the script with the latest version, the champion list is no longer a menu option. Pretty straightforward.

Re: League Tools V3.8 - 02-29-16

Posted: 16 Mar 2016, 09:36
by randomguy9472
Tested an older version of the script I had. Champion list doesn't show up there either. maybe the api key? I'm gonna go register for one and test it out.

EDIT Nope, not the API key. I'm thinking riot changed some formatting on their end? at work right now so can't dig into this too much but i'll take a look when I get home, unless one of you figure it out first.

This should help:

Code: Select all

{"type":"champion","version":"6.5.1","data":{"Thresh":{"id":412,"key":"Thresh","name":"Thresh","title":"the Chain Warden"},"Aatrox":{"id":266,"key":"Aatrox","name":"Aatrox","title":"the Darkin Blade"},"Tryndamere":{"id":23,"key":"Tryndamere","name":"Tryndamere","title":"the Barbarian King"},"Gragas":{"id":79,"key":"Gragas","name":"Gragas","title":"the Rabble Rouser"},"Cassiopeia":{"id":69,"key":"Cassiopeia","name":"Cassiopeia","title":"the Serpent's Embrace"},"Ryze":{"id":13,"key":"Ryze","name":"Ryze","title":"the Rogue Mage"},"Poppy":{"id":78,"key":"Poppy","name":"Poppy","title":"Keeper of the Hammer"},"Sion":{"id":14,"key":"Sion","name":"Sion","title":"The Undead Juggernaut"},"Jhin":{"id":202,"key":"Jhin","name":"Jhin","title":"the Virtuoso"},"Annie":{"id":1,"key":"Annie","name":"Annie","title":"the Dark Child"},"Nautilus":{"id":111,"key":"Nautilus","name":"Nautilus","title":"the Titan of the Depths"},"Karma":{"id":43,"key":"Karma","name":"Karma","title":"the Enlightened One"},"Lux":{"id":99,"key":"Lux","name":"Lux","title":"the Lady of Luminosity"},"Ahri":{"id":103,"key":"Ahri","name":"Ahri","title":"the Nine-Tailed Fox"},"Olaf":{"id":2,"key":"Olaf","name":"Olaf","title":"the Berserker"},"Viktor":{"id":112,"key":"Viktor","name":"Viktor","title":"the Machine Herald"},"Singed":{"id":27,"key":"Singed","name":"Singed","title":"the Mad Chemist"},"Garen":{"id":86,"key":"Garen","name":"Garen","title":"The Might of Demacia"},"Anivia":{"id":34,"key":"Anivia","name":"Anivia","title":"the Cryophoenix"},"Maokai":{"id":57,"key":"Maokai","name":"Maokai","title":"the Twisted Treant"},"Lissandra":{"id":127,"key":"Lissandra","name":"Lissandra","title":"the Ice Witch"},"Morgana":{"id":25,"key":"Morgana","name":"Morgana","title":"Fallen Angel"},"Fizz":{"id":105,"key":"Fizz","name":"Fizz","title":"the Tidal Trickster"},"Evelynn":{"id":28,"key":"Evelynn","name":"Evelynn","title":"the Widowmaker"},"Zed":{"id":238,"key":"Zed","name":"Zed","title":"the Master of Shadows"},"Heimerdinger":{"id":74,"key":"Heimerdinger","name":"Heimerdinger","title":"the Revered Inventor"},"Rumble":{"id":68,"key":"Rumble","name":"Rumble","title":"the Mechanized Menace"},"Sona":{"id":37,"key":"Sona","name":"Sona","title":"Maven of the Strings"},"Mordekaiser":{"id":82,"key":"Mordekaiser","name":"Mordekaiser","title":"the Iron Revenant"},"KogMaw":{"id":96,"key":"KogMaw","name":"Kog'Maw","title":"the Mouth of the Abyss"},"Katarina":{"id":55,"key":"Katarina","name":"Katarina","title":"the Sinister Blade"},"Lulu":{"id":117,"key":"Lulu","name":"Lulu","title":"the Fae Sorceress"},"Ashe":{"id":22,"key":"Ashe","name":"Ashe","title":"the Frost Archer"},"Karthus":{"id":30,"key":"Karthus","name":"Karthus","title":"the Deathsinger"},"Alistar":{"id":12,"key":"Alistar","name":"Alistar","title":"the Minotaur"},"Darius":{"id":122,"key":"Darius","name":"Darius","title":"the Hand of Noxus"},"Vayne":{"id":67,"key":"Vayne","name":"Vayne","title":"the Night Hunter"},"Varus":{"id":110,"key":"Varus","name":"Varus","title":"the Arrow of Retribution"},"Udyr":{"id":77,"key":"Udyr","name":"Udyr","title":"the Spirit Walker"},"Leona":{"id":89,"key":"Leona","name":"Leona","title":"the Radiant Dawn"},"Jayce":{"id":126,"key":"Jayce","name":"Jayce","title":"the Defender of Tomorrow"},"Syndra":{"id":134,"key":"Syndra","name":"Syndra","title":"the Dark Sovereign"},"Pantheon":{"id":80,"key":"Pantheon","name":"Pantheon","title":"the Artisan of War"},"Riven":{"id":92,"key":"Riven","name":"Riven","title":"the Exile"},"Khazix":{"id":121,"key":"Khazix","name":"Kha'Zix","title":"the Voidreaver"},"Corki":{"id":42,"key":"Corki","name":"Corki","title":"the Daring Bombardier"},"Caitlyn":{"id":51,"key":"Caitlyn","name":"Caitlyn","title":"the Sheriff of Piltover"},"Azir":{"id":268,"key":"Azir","name":"Azir","title":"the Emperor of the Sands"},"Nidalee":{"id":76,"key":"Nidalee","name":"Nidalee","title":"the Bestial Huntress"},"Kennen":{"id":85,"key":"Kennen","name":"Kennen","title":"the Heart of the Tempest"},"Galio":{"id":3,"key":"Galio","name":"Galio","title":"the Sentinel's Sorrow"},"Veigar":{"id":45,"key":"Veigar","name":"Veigar","title":"the Tiny Master of Evil"},"Bard":{"id":432,"key":"Bard","name":"Bard","title":"the Wandering Caretaker"},"Gnar":{"id":150,"key":"Gnar","name":"Gnar","title":"the Missing Link"},"Malzahar":{"id":90,"key":"Malzahar","name":"Malzahar","title":"the Prophet of the Void"},"Graves":{"id":104,"key":"Graves","name":"Graves","title":"the Outlaw"},"Vi":{"id":254,"key":"Vi","name":"Vi","title":"the Piltover Enforcer"},"Kayle":{"id":10,"key":"Kayle","name":"Kayle","title":"The Judicator"},"Irelia":{"id":39,"key":"Irelia","name":"Irelia","title":"the Will of the Blades"},"LeeSin":{"id":64,"key":"LeeSin","name":"Lee Sin","title":"the Blind Monk"},"Illaoi":{"id":420,"key":"Illaoi","name":"Illaoi","title":"the Kraken Priestess"},"Elise":{"id":60,"key":"Elise","name":"Elise","title":"the Spider Queen"},"Volibear":{"id":106,"key":"Volibear","name":"Volibear","title":"the Thunder's Roar"},"Nunu":{"id":20,"key":"Nunu","name":"Nunu","title":"the Yeti Rider"},"TwistedFate":{"id":4,"key":"TwistedFate","name":"Twisted Fate","title":"the Card Master"},"Jax":{"id":24,"key":"Jax","name":"Jax","title":"Grandmaster at Arms"},"Shyvana":{"id":102,"key":"Shyvana","name":"Shyvana","title":"the Half-Dragon"},"Kalista":{"id":429,"key":"Kalista","name":"Kalista","title":"the Spear of Vengeance"},"DrMundo":{"id":36,"key":"DrMundo","name":"Dr. Mundo","title":"the Madman of Zaun"},"TahmKench":{"id":223,"key":"TahmKench","name":"Tahm Kench","title":"the River King"},"Diana":{"id":131,"key":"Diana","name":"Diana","title":"Scorn of the Moon"},"Brand":{"id":63,"key":"Brand","name":"Brand","title":"the Burning Vengeance"},"Sejuani":{"id":113,"key":"Sejuani","name":"Sejuani","title":"the Winter's Wrath"},"Vladimir":{"id":8,"key":"Vladimir","name":"Vladimir","title":"the Crimson Reaper"},"Zac":{"id":154,"key":"Zac","name":"Zac","title":"the Secret Weapon"},"RekSai":{"id":421,"key":"RekSai","name":"Rek'Sai","title":"the Void Burrower"},"Quinn":{"id":133,"key":"Quinn","name":"Quinn","title":"Demacia's Wings"},"Akali":{"id":84,"key":"Akali","name":"Akali","title":"the Fist of Shadow"},"Tristana":{"id":18,"key":"Tristana","name":"Tristana","title":"the Yordle Gunner"},"Hecarim":{"id":120,"key":"Hecarim","name":"Hecarim","title":"the Shadow of War"},"Sivir":{"id":15,"key":"Sivir","name":"Sivir","title":"the Battle Mistress"},"Lucian":{"id":236,"key":"Lucian","name":"Lucian","title":"the Purifier"},"Rengar":{"id":107,"key":"Rengar","name":"Rengar","title":"the Pridestalker"},"Warwick":{"id":19,"key":"Warwick","name":"Warwick","title":"the Blood Hunter"},"Skarner":{"id":72,"key":"Skarner","name":"Skarner","title":"the Crystal Vanguard"},"Malphite":{"id":54,"key":"Malphite","name":"Malphite","title":"Shard of the Monolith"},"Yasuo":{"id":157,"key":"Yasuo","name":"Yasuo","title":"the Unforgiven"},"Xerath":{"id":101,"key":"Xerath","name":"Xerath","title":"the Magus Ascendant"},"Teemo":{"id":17,"key":"Teemo","name":"Teemo","title":"the Swift Scout"},"Renekton":{"id":58,"key":"Renekton","name":"Renekton","title":"the Butcher of the Sands"},"Nasus":{"id":75,"key":"Nasus","name":"Nasus","title":"the Curator of the Sands"},"Draven":{"id":119,"key":"Draven","name":"Draven","title":"the Glorious Executioner"},"Shaco":{"id":35,"key":"Shaco","name":"Shaco","title":"the Demon Jester"},"Swain":{"id":50,"key":"Swain","name":"Swain","title":"the Master Tactician"},"Ziggs":{"id":115,"key":"Ziggs","name":"Ziggs","title":"the Hexplosives Expert"},"Talon":{"id":91,"key":"Talon","name":"Talon","title":"the Blade's Shadow"},"Janna":{"id":40,"key":"Janna","name":"Janna","title":"the Storm's Fury"},"Ekko":{"id":245,"key":"Ekko","name":"Ekko","title":"the Boy Who Shattered Time"},"Orianna":{"id":61,"key":"Orianna","name":"Orianna","title":"the Lady of Clockwork"},"Fiora":{"id":114,"key":"Fiora","name":"Fiora","title":"the Grand Duelist"},"FiddleSticks":{"id":9,"key":"FiddleSticks","name":"Fiddlesticks","title":"the Harbinger of Doom"},"Rammus":{"id":33,"key":"Rammus","name":"Rammus","title":"the Armordillo"},"Chogath":{"id":31,"key":"Chogath","name":"Cho'Gath","title":"the Terror of the Void"},"Leblanc":{"id":7,"key":"Leblanc","name":"LeBlanc","title":"the Deceiver"},"Zilean":{"id":26,"key":"Zilean","name":"Zilean","title":"the Chronokeeper"},"Soraka":{"id":16,"key":"Soraka","name":"Soraka","title":"the Starchild"},"Nocturne":{"id":56,"key":"Nocturne","name":"Nocturne","title":"the Eternal Nightmare"},"Jinx":{"id":222,"key":"Jinx","name":"Jinx","title":"the Loose Cannon"},"Yorick":{"id":83,"key":"Yorick","name":"Yorick","title":"the Gravedigger"},"Urgot":{"id":6,"key":"Urgot","name":"Urgot","title":"the Headsman's Pride"},"Kindred":{"id":203,"key":"Kindred","name":"Kindred","title":"The Eternal Hunters"},"MissFortune":{"id":21,"key":"MissFortune","name":"Miss Fortune","title":"the Bounty Hunter"},"MonkeyKing":{"id":62,"key":"MonkeyKing","name":"Wukong","title":"the Monkey King"},"Blitzcrank":{"id":53,"key":"Blitzcrank","name":"Blitzcrank","title":"the Great Steam Golem"},"Shen":{"id":98,"key":"Shen","name":"Shen","title":"the Eye of Twilight"},"Braum":{"id":201,"key":"Braum","name":"Braum","title":"the Heart of the Freljord"},"XinZhao":{"id":5,"key":"XinZhao","name":"Xin Zhao","title":"the Seneschal of Demacia"},"Twitch":{"id":29,"key":"Twitch","name":"Twitch","title":"the Plague Rat"},"MasterYi":{"id":11,"key":"MasterYi","name":"Master Yi","title":"the Wuju Bladesman"},"Taric":{"id":44,"key":"Taric","name":"Taric","title":"the Gem Knight"},"Amumu":{"id":32,"key":"Amumu","name":"Amumu","title":"the Sad Mummy"},"Gangplank":{"id":41,"key":"Gangplank","name":"Gangplank","title":"the Saltwater Scourge"},"Trundle":{"id":48,"key":"Trundle","name":"Trundle","title":"the Troll King"},"Kassadin":{"id":38,"key":"Kassadin","name":"Kassadin","title":"the Void Walker"},"Velkoz":{"id":161,"key":"Velkoz","name":"Vel'Koz","title":"the Eye of the Void"},"Zyra":{"id":143,"key":"Zyra","name":"Zyra","title":"Rise of the Thorns"},"Nami":{"id":267,"key":"Nami","name":"Nami","title":"the Tidecaller"},"JarvanIV":{"id":59,"key":"JarvanIV","name":"Jarvan IV","title":"the Exemplar of Demacia"},"Ezreal":{"id":81,"key":"Ezreal","name":"Ezreal","title":"the Prodigal Explorer"}}}

Re: League Tools V3.9 - 03-18-16

Posted: 18 Mar 2016, 17:33
by Ruevil2
Script Updated!

Changes:
-Champ Icons and Skins worked in, converted to RegExMatch
-Tray menu changes
-Spelling error corrected, (Tahm Kench)
-Skins downloaded to folder and named as skin name
-Auto creation of config.ini added

Re: League Tools V3.9 - 03-18-16

Posted: 20 Mar 2016, 23:52
by randomguy9472
I don't know what's changed but I still see no champion guides menu with this update :/

Re: League Tools V3.9 - 03-18-16

Posted: 21 Mar 2016, 10:29
by Ruevil2
randomguy:

This behavior is usually caused by the 'ChampListD' var being empty. Usually from a 404 response in the GetChampList() function. This can happen from a malformed API call, as the call is case sensitive (must be en_US not en_us) and I haven't put much data cleaning logic in there yet. It could also be caused by an invalid region/locale combination, not all locales are available for all regions.

Can you give me a little more information? What server do you play on? NA, EUW etc...

You can also try replacing the dynamic call with a hardcoded standard NA call.
Replace this.

Code: Select all

ChampListURL := "https://global.api.pvp.net/api/lol/static-data/" Reg "/v1.2/champion?locale=" Loc "&api_key=" key
With this.

Code: Select all

ChampListURL := "https://global.api.pvp.net/api/lol/static-data/na/v1.2/champion?api_key=72f7888e-0a65-4f90-aeea-c08f3ae1a6bf"
Let me know if this changes your results at all. Also make sure you are updated to the latest build of AHK.

Re: League Tools V3.9 - 03-18-16

Posted: 22 Mar 2016, 16:35
by Gorgrak
I changed the beginning of the script a bit so that the changeable parameters are *only* loaded from the .ini file. I also changed the script a bit to put all downloaded or created files/folders into a folder the same as the script file's name ;)

Code: Select all

SplitPath, A_ScriptName,,,, ScriptName
IfNotExist %A_ScriptDir%\%ScriptName%\Skins
	FileCreateDir, %A_ScriptDir%\%ScriptName%\Skins
IfNotExist %A_ScriptDir%\%ScriptName%\ChampIcon
	FileCreateDir, %A_ScriptDir%\%ScriptName%\ChampIcon


; Default values of the .ini if it doesn't exist. Change the .ini itself if you want to change the parameters
; lgn is the default login used on Load: 1 = Login1, 2 = Login2 etc.
; QueueWaitTime (in seconds), 300 seconds is 5 minutes, minimum value allowed = 120
IfNotExist %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini
{
e4=
(
[Login1]
Username=blah
Password=blah
[Login2]
Username=
Password=
[Login3]
Username=
Password=
[Region]
Reg=na
[Locale]
Loc=en_US
[DefaultLogin]
lgn=1
[QueueTime]
QueueWaitTime=300
)
FileAppend, %e4%, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini
}

;;;;;;;;;;;;;;;;;;;;;;DON'T EDIT BELOW THIS LINE;;;;;;;;;;;;;;
#SingleInstance, Force
#Persistent
CoordMode,Mouse,Window
CoordMode,Pixel,Window
OnExit, ExitSub
If not A_IsAdmin
    Run *RunAs "%A_ScriptFullPath%"
Confine = True
global ColorA = 0xB36C0F
global cDist = 40
global cDist1 = 20
tsecs = 3
ver = v3.9
Menu, Tray, NoStandard
Menu, Tray, UseErrorLevel
Menu, Tray, Tip, League Tools %ver%
; TrayTip, League Tools %ver%, Finding league launcher.
Sleep, 250

IfExist %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini
{
	Loop,
	{
		IniRead, Login%A_Index%, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, Login%A_Index%, Username
		IniRead, Pass%A_Index%, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, Login%A_Index%, Password
		IfInString, Login%A_Index%, ERROR
		{
			Login%A_Index% := 
			break
		}
	}
	IniRead, Reg, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, Region, Reg
	IniRead, Loc, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, Locale, Loc
	IniRead, lgn, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, DefaultLogin, lgn
	IniRead, QueueWaitTime, %A_ScriptDir%\%ScriptName%\%ScriptName%_config.ini, QueueTime, QueueWaitTime
}

Re: League Tools V3.9 - 03-18-16

Posted: 22 Mar 2016, 18:05
by randomguy9472
Currently playing on NA. It's been working fine this entire time until recently so I'm not sure what changed. I do have 2 additional installations of the League client, one for the Korean servers and one for LAN but they're in entirely different directories and shouldn't affect anything. Regardless they were installed before when the menu was working. My main installation (in the standard directory) is for NA though (in English). I've kept my AHK installation updated as well. I'll try the hardcoded version and get back to you about that.

Re: League Tools V3.9 - 03-18-16

Posted: 22 Mar 2016, 19:49
by Gorgrak
randomguy9472 wrote:I'll try the hardcoded version and get back to you about that.
Hopefully that will fix it.



randomguy9472 wrote:I do have 2 additional installations of the League client, one for the Korean servers and one for LAN but they're in entirely different directories and shouldn't affect anything.
This script can easily be modified to specify a different directory. In fact, you could write the script to have a popup window asking you which installation you want to use and then change the variables to use that particular server's region and locale in the variables. That way you can still have a useful script no matter which region you are playing in.

Re: League Tools V3.9 - 03-18-16

Posted: 23 Mar 2016, 01:15
by randomguy9472
Gorgrak wrote:This script can easily be modified to specify a different directory. In fact, you could write the script to have a popup window asking you which installation you want to use and then change the variables to use that particular server's region and locale in the variables. That way you can still have a useful script no matter which region you are playing in.
I was thinking about that for a while. I actually just set up multiple copies of the script with different sets of hotkeys cuz I was lazy, but a menu would be cool. I'm maybe it could be implemented into the F12 shortcut, so when you refresh the script, you get a installation selection menu, and it just uses whatever you last selected on the script's initial run? I say that because I have mine set to auto start at boot with tasker, and a menu popping up every boot would be annoying. It'd be nice to have each installation use its own config file too for logins.

Re: League Tools V3.9 - 03-18-16

Posted: 23 Mar 2016, 10:01
by randomguy9472
So the hardcoded version worked, but I figured out the problem as well. It was the locale capitalization as you thought. My cfg file uses "en_us" and not "en_US". Is this default in NA? I don't think I've ever changed this.

EDIT

That wasn't the only problem actually. I added a msgbox right after ChamplistURL is determined and it's showing up as . . . data/ERROR/v1.2/ . . . where the region should be.

Here's my System.cfg file for reference:

Code: Select all

DownloadURL=l3cdn.riotgames.com
DownloadPath=/releases/live
Region=NA

EDIT AGAIN

OK, I think I found the issue now. I'm using the config.ini file to store the logins, but not the region/locale. When the "IfExist %A_ScriptDir%\config.ini" block runs, it can't find a Reg key in the ini and replaces the variable with the word ERROR, then later, the "If !Reg" isn't triggered in the "IfExist C:\Riot Games\league of legends\lol.launcher.exe" block. The only reason the same isn't happening to Loc is because of the last Else block in the section below:

Code: Select all

If !Reg
	Reg = na
If !Loc
	Loc = en_US
Else
{
	If InStr(Loc, "_")
	{
		StringSplit, Loc, Loc, _
		StringLower, Loc1, Loc1
		StringUpper, Loc2, Loc2
		Loc = %Loc1%_%Loc2%
	}
	Else
		Loc = en_US
}
all of this tested extensively with msgboxs everywhere.

Quick fix: Replace all "If !Reg" with " If !Reg OR Reg="ERROR" "

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

Posted: 24 Mar 2016, 19:17
by Ruevil2
OK so new update! I really appreciate the contributions you guys have made to this little script! Are there any other requests? I haven't used the new queue all that often cause I mostly play ARAMs. I could also comment up some of it for easier editing.


Changes
Champion and Skin sales code condensed into a function
Champ icons and skins contained into folders
Script refers to it's corresponding INI file
-- %A_ScriptName%_config.ini
Config.ini is now the only method for storing vars
Region and Locale vars now case and ERROR checked

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

Posted: 25 Mar 2016, 15:47
by Gorgrak
Sidenote: I just realized that we are using your API key, Ruevil2? I went ahead and signed up for my own and put it in the script on my computer since it seems potentially bad that everyone who uses this script will be querying the database with your key. I know the limit is like 10 requests within 10 seconds and 500 requests within 10 minutes; however, if this script becomes popular then it is slightly conceivable that 10 people could start the script within 10 seconds of each other or 500 people could startup the script within 10 minutes of each other. Not to mention if you, yourself, use your key for other API querying projects.

Also, should we register the script on the developer site?

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

Posted: 25 Mar 2016, 17:34
by Ruevil2
Gorgrak:

I actually maintain 2 keys, a private and a public one. Using the public key allows me to keep an eye on approximately how active the script is and what regions are being called.
Good news is that calls to the '/api/lol/static-data/{region}/v1.2/champion' endpoint specifically don't count toward the rate limit. If we start requesting other endpoints the rate limit
could become a problem.

I haven't registered the script officially because I thought Riot might take exception to the auto-login and auto-start features.

Here is the last activity report. Seems we are now averaging about 65 calls per day.
Image

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

Posted: 25 Mar 2016, 20:54
by Gorgrak
Well looky there. Awesome.

EDIT1:
Noticed the urlchamp variable needs to be edited. All of them need to read "6.6.1" instead of the "6.2.1" --> this change brings the ddragon API query of the script up-to-date and allows for Aurlion Sol to show his icon picture correctly on the Guide Menu. You will also need to add these lines into the if/else if section:

Code: Select all

if f2 = Aurelion Sol
	urlchamp = http://ddragon.leagueoflegends.com/cdn/6.6.1/img/champion/AurelionSol.png
EDIT2:
There is probably a better way to do the urlchamp variable since the API query listed the version number at the beginning. We could probably just do an additional variable for API version inside the urlchamp variable so that the ddragon image query will always grab from the most recent icon distribution.

EDIT3:
Oh, and then there could be a way to save the version of the image and then error check to see if there is a new image for the champion when a new version of the API comes out (like when they update the champion and change them a lot (like with Tristana last year (was it last year?))). The error check may be able to look at the hdd size of the downloaded picture and compare it to the size of the one up on ddragon?

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

Posted: 28 Mar 2016, 11:51
by Ruevil2
Small update.

Changes:
Slimmed urlchamp
Adjusted for Aurelion Sol
ddragon version updated and now pulled from champ API call

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

Posted: 28 Mar 2016, 13:10
by Gorgrak
Under the "If SKI" section you have:

Code: Select all

If InStr(t, r)
{
	If !(FileExist(A_ScriptDir "\Skins\" Skin ".png"))
		UrlDownloadToFile, %t%, %A_ScriptDir%\%ScriptName%\Skins\%Skin%.png
}
but is should be changed to this:

Code: Select all

	If !(FileExist(A_ScriptDir "\" ScriptName "\Skins\" Skin ".png"))
I also changed up the Tray Menu slightly by deleting all the "LoginOnly" entries, adding a "Start League" option (opens league and doesn't auto-queue), and rearranging the menu slightly to suit my tastes:

Code: Select all

	If Login1
	{
		If RiotPath
		{
			Loop, 1000
			{
				If (Login%A_Index%)
				{
					l := Login%A_Index%
					Menu, Accounts, Add, %l%, Tools
				}
				Else
					break
			}
			Menu, Selections5, Add, 5v5 Ranked, AutoStart
			Menu, Selections5, Add, 5v5 Draft, AutoStart
			Menu, Selections5, Add, 5v5 Blind, AutoStart
			Menu, Selections3, Add, 3v3 Blind, AutoStart
			Menu, Selections, Add, 5v5, :Selections5
			Menu, Selections, Add, 3v3, :Selections3
			Menu, Selections, Add, ARAM, AutoStart
		}
		Else
			TrayTip, League Tools %ver%, League launcher not found. League must be present to use login options., %tsecs%
	}
}

Menu, GuideMenu, NoDefault
if !ErrorLevel
	Menu, Tray, Add, Champion Guides, :GuideMenu
Menu, CSales, NoDefault
if !ErrorLevel
	Menu, Tray, Add, Champion Sales, :CSales
else
{
	Menu, NoSales, Add, No Sales, Sales
	Menu, Tray, Add, Champion Sales, :NoSales
}
Menu, SSales, NoDefault
if !ErrorLevel
   Menu, Tray, Add, Skin Sales, :SSales
else
{
	Menu, NoSales, Add, No Sales, Sales
	Menu, Tray, Add, Skin Sales, :NoSales
}
Menu, Tray, Add
If Login2
	Menu, Tray, Add, Select Account, :Accounts
If !ErrorLevel
	Menu, Tray, Add, Start League, LoginOnly
Menu, Selections, NoDefault
If !ErrorLevel
	Menu, Tray, Add, Auto Start, :Selections
Menu, Tray, Add
Menu, Tray, Add, ScreenEdge Off, Tools
Menu, Tray, Add, Reload Script, ReloadSub
Menu, Tray, Add, Exit Script, ExitSub

TrayTip, League Tools %ver%, League Tools Loaded. Enjoy., %tsecs%
Return

!F12::          ; Alt + F12
ReloadSub:
Reload
Return

and added a short blurb of code into the "Login(u="", p="", installloc="")" section (which was just copied from the beginning of the "Start(t)" section) to allow the Auto Start menu choices to skip logging in if League is already started:

Code: Select all

Login(u="", p="", installloc="")
{
	if WinExist("ahk_class ApolloRuntimeContentWindow")
	{
		WinActivate, ahk_class ApolloRuntimeContentWindow
		WinGetPos,,, w, h, A
		PixelGetColor, b_Play, (w / 2), (h * .025), RGB
		ColDist := Distance(colorA, b_Play)
		If ColDist < cDist1
		{
			TrayTip, League Tools %ver%, League of Legends already open. Skipping login protocol..., %tsecs%
			return
		}
	}
	Run, %installloc%
	WinActivate, ahk_class splashscreenclassname
	Loop, 20

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

Posted: 28 Mar 2016, 18:33
by Ruevil2
Ninja update 2.

Changes:
Shortened and condensed tray menu
Added check for existing league window when logging in
Various other small tweaks