League Tools V6.05 - 05-07-18

Post gaming related scripts
randomguy9472

Select Account not working?

19 Jan 2016, 11:27

The select account menu doesn't seem to be functioning properly. I tried messing around with the code a bit but couldn't get it to work. Seems like all three parts of the tools section of the code is getting triggered (judging by the output in the console and that the screen edge lock gets triggered as well). Any fixes for this?
randomguy9472

Select Account not working

19 Jan 2016, 11:30

And, unrelated, but any chance of an update for the new 6.1 queues?
randomguy9472

Select account issue details

19 Jan 2016, 11:40

The console returns this when I select any account:

Code: Select all

225: if A_ThisMenuItem = ScreenEdge Off
231: if A_ThisMenuItem = ScreenEdge On
239: if A_ThisMenu = Accounts, lgn := A_ThisMenuItemPos
243: ClipCursor( Confine, 13, 13, A_screenwidth-13, A_screenheight-13)  
569: VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)  
570: Return,Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
244: Return (0.61)
I would assume that lgn isn't actually being changed cuz when I choose anything from Start League afterwards, it always uses the main account.

Hope this helps.
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3 - 11-28-15

19 Jan 2016, 22:14

New script posted! Check updated pastebin link.

Changelog:
Multiple Logins Adjusted
Regional Changes
--Additional links added to champ menu for Korean and Russian users
Screen Edge now only works inside League game window
Menu adjusts based on variables
No need to enter username or password
--Note: Only Screen Edge and Champ List options will be available
randomguy9472

21 Jan 2016, 14:18

v3.3 fixes the select account issue, thanks!


Some thoughts:

I noticed this in 3.1 too, but auto restart (listed in the features) doesn't seem to be working. The error message comes up stating that another instance is already open, but I have to click on that manually for it to proceed.

I know the hotkeys are there, but could you add an option in the menus to just launch an account without queuing up?

I enjoy the links to the guides, but it's very tedious having to (very slowly) scroll up and down that list. Is there another way to implement this (either the menus or the scrolling) or is this a restriction of AHK? What about putting the champs into submenus alphabetically?

Finally, I noticed you're using Send to input the username and password, and I've had to change it to SendRaw each time I update the script because my passwords use characters such as ^, #, and !, which trigger control, shift, and alt in AHK. Maybe make this default for convenience? Unless there's some reason for using send that I'm missing.

Thanks for your hard work!
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3 - 11-28-15

25 Jan 2016, 22:30

Hey I have posted another update. This requires AHK v1.1.23+ for the champ list to be shown in columns. Auto restart still needs work but I am leaving that until the new champion select is fully rolled out.

Changes:
Champion list separated into columns
Options for Login Only added:
--Selecting a type from this menu will log you in only.
--Type selected loads into F10 hotkey.
Send changed to SendRaw in a couple spots
randomguy9472

26 Jan 2016, 00:35

That champ list is SO much easier to navigate. Thanks again!

I figured since you've given us so much, I should give something back. Played around for a while and managed to get this to work. The purpose of this is so that you can update the script without refilling all your logins each time.:

Code: Select all

;;;;;Login Info
;It is not necessary to use the login portion or the variables. If you
;use the 'Remember Me' option in the client the script will prompt you 
;for the password. This will not be saved in any way.
;To add another login just add another set of vars in the below form
;the script will handle the rest. First three are bound to F7, F8 and F9.
;100 Account Max
;Login# = 
;Pass# = 

;Use an external file to load login info.
UseExternalInfo = True

If UseExternalInfo = False
{
	;Login 1
	Login1 = 
	Pass1 = 

	;Login 2
	Login2 = 
	Pass2 = 
	
	;Login 3
	Login3 = 
	Pass3 = 
}
else
{
	Line := 1
	FileReadLine, test, AccountInfo.txt, %Line%
	While test != "End"
	{
		Account := (Line - 1) // 4 + 1
		Login := Line + 1
		Pass := Line + 2
		FileReadLine, Login%Account%, AccountInfo.txt, %Login%
		FileReadLine, Pass%Account%, AccountInfo.txt, %Pass%
		Line := Line + 4
		FileReadLine, test, AccountInfo.txt, %Line%
	}
}

...
Set UseExternalInfo to True and it will read the username and passwords from a AccountInfo.txt located in the same directory. The format of LoginInfo.txt has to match this:

Code: Select all

Account 1:
Username1
Password1

Account 2:
Username2
Password2

Account 3:
Username3
Password3

...

Account n:
Usernamen
Passwordn

End
The content of the "Account" lines don't matter. As long as the Username and password lines are on lines 2,3 ( and 6,7; 10,11; etc.) and the file ends with the End after a blank line, it should be able to detect any number of accounts.


I hope this is useful!
randomguy9472

Re: League Tools V3 - 11-28-15

26 Jan 2016, 00:39

Also, my code is rather unpolished and depends on the precise formatting of the AccountInfo.txt (I scrapped it together while in queue xD) so feel free to tweak it around as you see fit.
randomguy9472

26 Jan 2016, 11:10

It occurs to me now that you could maintain the cleanliness of the user-editable section by leaving the default login stuff as it was and moving the entire Else block to the Do-Not-Edit section under "If UseExternalInfo = True".
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3 - 11-28-15

27 Jan 2016, 01:31

I love the feedback. I started simple because I didn't want to attract the wrath of Rito, the self updating champion script is based on their official API and could be shut down at any time. You know how they are. As for the 6.1 update and new champ select, I basically exclusively play ARAM so the menu hasn't really changed, this might get updated if I feel brave enough to slog through a draft pick :D. Anyways, updates added!

Changes:
Optional .ini script for Login/Password
100 account limit removed
Login Only bug fixed where it would try starting games anyway
randomguy9472

27 Jan 2016, 12:01

Wow, that's a much cleaner way to implement reading from an external file :D


If needed, couldn't you move away from the Riot API by using UrlDownloadToFile and getting the champ list from one of the guide sites? The source code for Mobafire's champion drop down is definitely parsable:

Code: Select all

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

Also, decrementing each additional index value by 1 fixes the empty space under Janna in the champion list:

Code: Select all

If (A_Index = 40) || (A_Index = 79) || (A_Index = 118)
	Menu, GuideMenu, Add, %Champ%, :%Champ%, +BarBreak
I'm glad I can help
randomguy9472

27 Jan 2016, 12:04

Whoops, that does 39 per column, should be 41, 80, 119 for an even 40 ;)
randomguy9472

27 Jan 2016, 12:09

Apparently I can't do math this morning -.-. 41, 81, 121 are the right values for even columns of 40
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3.6 - 02-01-16

01 Feb 2016, 23:34

Hey I updated the champ list and added a few new tweaks. Give it a try!

Changes:
Champion List changes language based on default launcher region.
-Region may also be manually set via the 'Reg' variable
-I won't be doing translations of the rest of the script
--This feature may require the Unicode version of AHK, ASCII as yet untested.
Adjusted Champ list to get rid of empty spaces
Osimodas
Posts: 2
Joined: 01 Feb 2016, 09:02

Re: League Tools V3.6 - 02-01-16

10 Feb 2016, 07:35

Hi !

Your job is really great !
I add new features to your script.

First, i think it's a good idea to add the free champions of the week.
So i use Riot API to collect free champions (i have already do it).

I think it's good to add current sales.
Here my script :

Code: Select all

FileDelete lolsales.txt
UrlDownloadToFile, http://lolsales.com, lolsales.txt
FileRead , page , lolsales.txt
FileDelete lolsales.txt
; now the text of the page is in the variable %page%
Loop , parse , page , `n
{
  line := A_LoopField
  outputdebug %line%

  if line contains Champion and skin sale
  {
    Needle = </a
    StringGetPos, pos, line, %Needle%
    if pos >= 0
    OutputVar := StrLen(line)

    finam := OutputVar - pos
    StringTrimRight , datepromos, line, %finam%

    Needle = sale:
    StringGetPos, pos, datepromos, %Needle%
    StringTrimLeft, datepromos, datepromos, %pos%
    StringTrimLeft, datepromos, datepromos, 6

    StringSplit, datesplit, datepromos, - , .  ;

    StringSplit, datedebut, datesplit1, . , .  ;
    datededebut =  %datedebut1%%datedebut2%%datedebut3%

    StringSplit, datefin, datesplit2, . , .  ;
    datedefin =  %datefin1%%datefin2%%datefin3%

    FormatTime, DateDay , , ddMMyyyy

    if (DateDay >= datededebut and DateDay <= datedefin)
    {
      promoscours = 1
    }else{
      if (DateDay < datededebut){
          promoscours = 2
      }

      if (DateDay > datedefin){
          promoscours = 0
      }
    }

    if promoscours = 1 
    {
        Needle = '>
        StringGetPos, pos, line, %Needle%
        if pos >= 0
          OutputVar := StrLen(line)

        finam := OutputVar - pos
        StringTrimRight , FNN, line, %finam%

        StringTrimLeft, FNN, FNN, 9
        break 
    }
  }
}
;MsgBox, %FNN%

FileDelete lolsales.txt
UrlDownloadToFile, %FNN%, lolsales.txt
FileRead , page , lolsales.txt
FileDelete lolsales.txt
; now the text of the page is in the variable %page%

Loop , parse , page , `n
{
  line := A_LoopField
  outputdebug %line%
  if line contains champions
  {
    Needle = </s
    StringGetPos, pos, line, %Needle%
    OutputVar := StrLen(line)

    finam := OutputVar - pos
    StringTrimRight , FNN, line, %finam%


    Needle = ">
    StringGetPos, pos, FNN, %Needle%
    StringTrimLeft, FNN, FNN, %pos%
    StringTrimLeft, FNN, FNN, 2

    mapafe = 1
  }

  if mapafe = 1
  {
    if line contains skins
    {
    Needle = </s
    StringGetPos, pos, line, %Needle%
    OutputVar := StrLen(line)

    finam := OutputVar - pos
    StringTrimRight , SKI, line, %finam%


    Needle = ">
    StringGetPos, pos, SKI, %Needle%
    StringTrimLeft, SKI, SKI, %pos%
    StringTrimLeft, SKI, SKI, 2
    IMGSKI = ""
    counter = 0
    mapafe = 2
    }
  }

  if mapafe = 2
  {
    counter := counter + 1
    if counter > 2
    {
      Needle = " wid
      StringGetPos, pos, line, %Needle%
      OutputVar := StrLen(line)

      finam := OutputVar - pos
      StringTrimRight , IMG, line, %finam%


      Needle = src
      StringGetPos, pos, IMG, %Needle%
      StringTrimLeft, IMG, IMG, %pos%
      StringTrimLeft, IMG, IMG, 5
      StringSplit, word_array, SKI, `,, .  ;
      supp := counter - 3
      champ := % word_array%supp%
      if champ = 4
        champ = Champion sales : `n%FNN%
      FileDelete skin%supp%.png
      UrlDownloadToFile, %IMG%, skin%supp%.png
      SplashImage, skin%supp%.png, b fs18, %champ%
      Sleep, 4000
      SplashImage, Off
      FileDelete skin%supp%.png
    }
    if counter > 6 
      break
  }

}

if promoscours = 2
  MsgBox, No current sales

;MsgBox,Skins : %SKI%

Hope you will appreciate my job.
(sorry if there are mistakes, i'm French, ;) )
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3.6 - 02-01-16

12 Feb 2016, 20:15

Salut mon ami! I'm sorry if my french is bad, it has been a long time. Great ideas, I am looking into adding them into the script. I should be posting an update in the next couple days. Stay tuned!
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3.7 - 02-19-16

19 Feb 2016, 13:21

Update 3.7:

-More languages added
- Based on locale instead of region for greater language choices
- Locale comes from default launcher locale - it can be hard set via script or config.ini
- Not all locales are available in all regions
-Added Champion titles in champ list
-Adjusted color sensitivity
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

Re: League Tools V3.7 - 02-19-16

25 Feb 2016, 21:07

My launcher finally updated to the new system. Updating and altering options and should have an update in the next day or two. Any thoughts? Are the languages working properly? You guys are terrible with feedback :D

The language thing ended up being a lucky find and that's why I haven't done full script translations. If anyone would like to help with their native language I would be happy to include it.

GL HF GG
Ruevil2
Posts: 167
Joined: 14 Jul 2014, 10:39

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

29 Feb 2016, 20:53

Update posted.

Updates:
Auto Login Adjusted for 6.1 queue, 5v5 is still work in progress to be all the way to accept game
Champion sales
Skin sales
List adjustments
Minor tweaks
Osimodas
Posts: 2
Joined: 01 Feb 2016, 09:02

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

05 Mar 2016, 09:46

Hi !

U do an amazing job !
I have some improvements to ur script.

First u can collect the champion and skin sales thanks to the official website.
Like that, u can ajust the page depending on the local and the language of the user.

Here is my script :

Code: Select all

whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "http://euw.leagueoflegends.com/fr/news/store/sales", true)
whr.Send()
whr.WaitForResponse()
page1 := whr.ResponseText

Loop , parse , page1 , `n
{
  line := A_LoopField
  if line contains Promotion sur champions et skins
  {
    if line contains title 
    {
    	 Needle = title="
         StringGetPos, pos, line, %Needle%
         if pos >= 0
         OutputVar := StrLen(line)
         finam := OutputVar - pos
         StringTrimRight , datepromos, line, %finam%
         Needle = href="
         StringGetPos, pos, datepromos, %Needle%
         StringTrimLeft, datepromos, datepromos, %pos%
         StringTrimLeft, datepromos, datepromos, 6

         StringTrimRight, datepromos, datepromos, 2

         StringTrimRight, datesale, datepromos, 2
         Needle = skins-
         StringGetPos, pos, datesale, %Needle%
         StringTrimLeft, datesale, datesale, %pos%
         StringTrimLeft, datesale, datesale, 6
         StringSplit, datesplit, datesale, - , .  ;

         FormatTime, DateDay , , ddMMyyyy
         StringTrimRight, dateyear, DateDay, 4

         StringTrimLeft, datedebut1, datesplit1, 2
         StringTrimRight, datedebut2, datesplit1, 2
    	 datededebut =  %datedebut2%%datedebut1%%dateyear%

    	 StringTrimLeft, datefin1, datesplit2, 2
         StringTrimRight, datefin2, datesplit2, 2
    	 datedefin =  %datefin2%%datefin1%%dateyear%

    	 FormatTime, DateDay , , ddMMyyyy

    	if (DateDay >= datededebut and DateDay <= datedefin)
    	{
    		promosoffi = http://euw.leagueoflegends.com%datepromos%
     	 	break
    	}else{
			promoscours = 0
    	}
    }	    
  }	
}

if promosoffi {

	whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
	whr.Open("GET", promosoffi, true)
	whr.Send()
	whr.WaitForResponse()
	page2 := whr.ResponseText
	SKI = 1
	URLPROMOS = 1
Loop , parse , page2 , `n
{
  line := A_LoopField
  outputdebug %line%

  if line contains articlebanner.champskinsale
  {
  	Needle = " rel=
    StringGetPos, pos, line, %Needle%
    if pos >= 0
    OutputVar := StrLen(line)
    finam := OutputVar - pos
    StringTrimRight , imgpromos, line, %finam%
    Needle = href="
    StringGetPos, pos, imgpromos, %Needle%
    StringTrimLeft, imgpromos, imgpromos, %pos%
    StringTrimLeft, imgpromos, imgpromos, 6

  	FileDelete promos.png
    UrlDownloadToFile, %imgpromos%, promos.png
    SplashImage, promos.png, b fs18, Promos en cours
    Sleep, 2000
   	SplashImage, Off
    FileDelete promos.png
    promos = 1
    counter = 0
  }

  if promos = 1 
  {
  	 if line contains articlebanner.champskinsale 
  	 {

  	 } 
  	 else
  	 {
  	 	if line contains img
  	 	{
  	 			counter := counter + 1
  	 			Needle = " />
    			StringGetPos, pos, line, %Needle%
    			if pos >= 0
    			OutputVar := StrLen(line)
    			finam := OutputVar - pos
    			StringTrimRight , imgpromos, line, %finam%
    			Needle = src="
    			StringGetPos, pos, imgpromos, %Needle%
    			StringTrimLeft, imgpromos, imgpromos, %pos%
    			StringTrimLeft, imgpromos, imgpromos, 5
    			Needle = .jpg
    			StringGetPos, pos, imgpromos, %Needle%
    			if pos >= 0
    			OutputVar := StrLen(imgpromos)
    			finam := OutputVar - pos
    			StringTrimRight , imgpromos, imgpromos, %finam%
    			UrlDownloadToFile, %imgpromos%.jpg, champ.jpg
  	 	}

  	 	if line contains <h4>
  	 	{
  	 		if line not contains promo 
  	 		{
  	 			if line contains </h4> 
  	 			{
  	 				Needle = </h4>
    				StringGetPos, pos, line, %Needle%
    				if pos >= 0
    				OutputVar := StrLen(line)
    				finam := OutputVar - pos
    				StringTrimRight , champpromos, line, %finam%
    				Needle = <h4>
    				StringGetPos, pos, champpromos, %Needle%
    				StringTrimLeft, champpromos, champpromos, %pos%
    				StringTrimLeft, champpromos, champpromos, 4
    				lineok = 1
  	 			}
  	 		}
  	 	}

  	 	if line contains <a
  	 	{
  	 		if line contains champions
  	 		{
  	 			champURL = %champURL%|%URLchamp%
  	 			champok = 1
  	 			counter = 0
  	 		}	
  	 	}

  	 	if champok = 1
  	 	{
  	 		counter := counter + 1
  	 		if counter = 2
  	 		{
  	 			champok = 0
  	 			lineok = 1
  	 			champpromos = %line%
  	 		}
  	 	}

  	 	if line contains strike
  	 	{
  	 		Needle = </strike>
    		StringGetPos, pos, line, %Needle%
    		if pos >= 0
    		OutputVar := StrLen(line)
    		finam := OutputVar - pos
    		StringTrimRight , champrp, line, %finam%
    		Needle = ">
    		StringGetPos, pos, champrp, %Needle%
    		StringTrimLeft, champrp, champrp, %pos%
    		StringTrimLeft, champrp, champrp, 2

    		Needle = </p>
    		StringGetPos, pos, line, %Needle%
    		if pos >= 0
    		OutputVar := StrLen(line)
    		finam := OutputVar - pos
    		StringTrimRight , champsrp, line, %finam%
    		Needle = /strike> 
    		StringGetPos, pos, champsrp, %Needle%
    		StringTrimLeft, champsrp, champsrp, %pos%
    		StringTrimLeft, champsrp, champsrp, 8

    		strikeok = 1
  	 	}

  	 	if strikeok = 1
  	 	{
  	 		SKI = %SKI%|%champpromos% : %champsrp%
  	 		URLPROMOS = %URLPROMOS%|%imgpromos%.jpg
  	 		SplashImage, champ.jpg, b fs18 ctTeal, %champpromos% : `n%champrp% => %champsrp%
    		Sleep, 2000
   			SplashImage, Off
    		FileDelete champ.jpg
    		imgok = 0
    		lineok = 0
    		strikeok = 0
  	 	}
  	 }
  }

}
}
Then, i think it can be great to create the ini file if the user dont have it.

Code: Select all

IfNotExist, %A_ScriptDir%\config.ini
{
F1=%A_scriptdir%\config.ini
e4=
(Ltrim Join`r`n
[Login1]
Username=login1
Password=password1
[Login2]
Username=login2
Password=password2
 )
 Fileappend,%e4%`r`n,%f1%
}
I think u can also add the free champion of the week. (I also add the splashscreen of the champ :))

Code: Select all

GetFreeChamp(apikey)
{
	global ChampCount
	GameURL = https://euw.api.pvp.net/api/lol/euw/v1.2/champion?freeToPlay=true&api_key=%apiKey%
	ComObjError(0)
    	WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
    	WebRequest.Open("GET", GameURL)
    	WebRequest.Send()
    	str := WebRequest.ResponseText(), ComObjError(0)
	StringReplace, str, str, `",,All	;"
	StringReplace, str, str, `,, %A_Space%,All
	StringReplace, str, str, id, id, UseErrorLevel
	ChampCount := ErrorLevel
	Pos = 1
	Loop, %ChampCount%
	{
		Sleep 50
		Pos := (RegExMatch(str, "id:(.*?)\sactive:", Champs, Pos)) + 2
		If (A_Index = 1)
		{
			ChampName := GetChampById(Champs1,apikey)
			NameList = %ChampName%
		}
		else
		{
			ChampName := GetChampById(Champs1,apikey)
			NameList = %NameList%|%ChampName%
		}
		StringReplace, ChampName, ChampName, Cho'Gath, Chogath
		StringReplace, ChampName, ChampName, Dr. Mundo, DrMundo
		StringReplace, ChampName, ChampName, Jarvan IV, JarvanIV
		StringReplace, ChampName, ChampName, Fiddlesticks, FiddleSticks
		StringReplace, ChampName, ChampName, LeBlanc, Leblanc
		StringReplace, ChampName, ChampName, Kha'Zix, Khazix
		StringReplace, ChampName, ChampName, Kog'Maw, KogMaw
		StringReplace, ChampName, ChampName, Rek'Sai, RekSai
		StringReplace, ChampName, ChampName, Vel'Koz, Velkoz
		StringReplace, ChampName, ChampName, Lee Sin, LeeSin
		FileDelete splash%ChampName%.png
		IMG = http://ddragon.leagueoflegends.com/cdn/img/champion/splash/%ChampName%_0.jpg
      		UrlDownloadToFile, %IMG%, splash%ChampName%.png
      		SplashImage, splash%ChampName%.png, b fs18, %ChampName%
      		Sleep, 2000
     		SplashImage, Off
      		FileDelete splash%ChampName%.png
	}
	Sort, NameList, D`|
	return NameList
}
Finally, i suggest adding an icon of champion on the menu guide. I have already do it and it's pretty nice.
Image

Code: Select all

if displayicon = 1
{
	if Champ = Wukong
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/MonkeyKing.png
	else
		urlchamp = http://ddragon.leagueoflegends.com/cdn/6.2.1/img/champion/%Champ%.png

	if directoryexist = 1
	{	
		filenotexist = 0
		If( InStr( FileExist("ChampIcon"), "D") )
		{
						
		}else{
			FileCreateDir, ChampIcon
		}

		IfNotExist, ChampIcon\%Champ%.jpg
			filenotexist = 1

		if filenotexist = 1 
		{
      			UrlDownloadToFile, %urlchamp%, ChampIcon\%Champ%.png
			Menu, GuideMenu, Icon, %Champ%, ChampIcon\%Champ%.png,,25
			filenotexist = 0
		}
		else
		{
			Menu, GuideMenu, Icon, %Champ%, ChampIcon\%Champ%.png,,25
		}
	}
	else
	{
		FileDelete logo.png
      		UrlDownloadToFile, %urlchamp%, logo.png
		Menu, GuideMenu, Icon, %Champ%, logo.png,,25
		FileDelete logo.png
	}
}
GG for ur great job !
Attachments
AHK-ChampionIcons.PNG

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 3 guests