Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

League of Legends: Auto Picker (Rek'Sai Release) - 27.11.2014


  • Please log in to reply
68 replies to this topic
Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

Can this be updated for Yasuo?

 

 

I tried manually adding Yasuo's name, but the program did not do anything.

 

As well, all this program does now is press in the middle of the box, and add letters to the word "Search" which doesn't result in any champion.

 

Updated to include Yasuo aswell as fixed the bug with adding letters to Search


Check out ALL My Scripts  ;)


vsdgniuz
  • Members
  • 7 posts
  • Last active: Mar 07 2015 05:46 PM
  • Joined: 19 Jan 2014

Adding this autocomplete function from 'polyethene' makes the GUI champion/position selection so much faster.
 
http://www.autohotke...boxes/?p=125936

 

Run me through this, dont get what its doing.. he says something about if you dont like globals :/

 
What he meant was to use auto-complete to fill in the combobox. This makes selecting the champion very quick.
 
Also the script needs to be run as an administrator to work (atleast for me).
 
So I modded the above code to make it run as administrator and auto-complete the boxes. [Selects champion first, then lane/role]
 
Here's the code- 
 
;League of Legends AHK AutoPicker

;How it works:
;Pick hero you want to be automatically selected for you once you join a game.
;Make sure you own that hero or it resides here http://euw.leagueoflegends.com/news/champion-rotation
;Click 'OK'
;Popup Messagebox will appear to verify which hero you picked.
;Look for game, join game, as you normally would.
;Once at hero selection phase the program will type the hero name you selected and pick it.
;It will continue to try to pick it until it finds a gray color where the hero icon is suppose to be.
;If at anytime you want to close the program simply press F8.


Loop, %0%  ; For each parameter:
  {
    param := %A_Index%  ; Fetch the contents of the variable whose name is contained in A_Index.
    params .= A_Space . param
  }
ShellExecute := A_IsUnicode ? "shell32\ShellExecute":"shell32\ShellExecuteA"
    
if not A_IsAdmin
{
    If A_IsCompiled
       DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
    Else
       DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
    ExitApp
}

#SingleInstance force
myGui("x860 y400", "LoLChampionSelector")


myGui(position, title)
{
	global thatVar
	global thisVar
	gui, new
	gui, Default
	;gui, Color, 00ABA9
	gui, +LastFound +LabelMyGui
	gui, add, groupbox, w200 h120, LoLChampionSelector
	gui, font, s8, Arial
	gui, add, text, xm12 ym20 section, 
	gui, add, text, yp+17.5 center, Choose The Hero You Want
	gui, Add, ComboBox, vthisVar w120 r10 gAC, |Ahri|Akali|Alistar|Amumu|Anivia|Annie|Ashe|Blitzcrank|Brand|Caitlyn|Cassiopeia|Cho'Gath|Corki|Darius|Diana|Dr. Mundo|Draven
	|Elise|Evelynn|Ezreal|Fiddlesticks|Fiora|Fizz|Galio|Gangplank|Garen|Gragas|Graves|Hecarim|Heimerdinger|Irelia|Janna|Jarvan IV|Jax|Jayce
	|Karma|Karthus|Kassadin|Katarina|Kayle|Kennen|Kha'Zix|Kog'Maw|LeBlanc|Lee|Leona|Lulu|Lux Mage|Malphite|Malzahar|Maokai|Master Yi|Miss Fortune|Mordekaiser|Morgana
	|Nami|Nasus|Nautilus|Nidalee|Nocturne|Nunu|Olaf|Orianna|Pantheon|Poppy|Quinn and Valor|Rammus|Renekton|Rengar|Riven|Rumble|Ryze
	|Sejuani|Shaco|Shen|Shyvana|Singed|Sion|Sivir|Skarner|Sona|Soraka|Swain|Syndra|Talon|Taric|Teemo|Thresh|Tristana|Trundle|Tryndamere|Twisted Fate|Twitch
	|Udyr|Urgot|Varus|Vayne|Veigar|Vi|Viktor|Vladimir|Volibear|Warwick|Wukong|Xerath|Xin Zhao|Yasuo|Yorick|Zed|Ziggs|Zilean|Zyra
	gui, Add, ComboBox, vthatVar w120 r10 gAC, |adc|tank|support|top|jungle|btm|mid
	gui, add, button, yp+50 gDone, OK
	gui, add, button, xp+50  gmyguiclose, Cancel
	gui, add, text, yp+40 xp-45, Press F8 to Close 
	gui, add, text, yp+15, Modded by vsdgniuz 
	gui, add, link, yp+15,  <a href="http://euw.leagueoflegends.com/news/champion-rotation">Click here to see Champion Rotation.</a>
	gui, font, s10, Verdana
	gui, add, text, yp+15 xp+3, Version: 1.5k
	gui, show, % position, % title
	return
	
	AC: 
	AutoComplete(A_GuiControl) 
	Return

	Done:
	{
	gui,submit,nohide
	gui, destroy
	msgbox Hero that will automatically be picked : %thisVar%
	msgbox Position that will be automaticly called: %thatVar%
	Loop
	{
		WinWaitActive ahk_class ApolloRuntimeContentWindow
		{
			PixelSearch, FoundaX, FoundaY, 912, 130, 996, 142, 0xFFFFFF, 0, Fast ;Find Search Box
			if ErrorLevel = 0
			{
			MouseClick, left, 930, 135
			Sleep 10
			Send, %thisVar%
			Sleep, 280
			MouseClick, Left, 325, 212
			Sleep 30
			MouseClick, left, 355, 737
			Sleep 10
			Send, %thatVar%
			Sleep 10
			MouseClick, left, 922, 735
			Sleep, 2000
			}
			PixelSearch, FoundbX, FoundbY, 296, 180, 350, 233, 0x303030, 0, Fast ;Pick Hero
			if ErrorLevel = 0
			{
			ExitApp
			}
		}
	}
	return
	}
	myguiclose:
	{
	ExitApp
	return
	}
}

AutoComplete(ctrl) 
{ 
   static lf = "`n" 
   If GetKeyState("Delete") or GetKeyState("Backspace") 
      Return
   SetControlDelay, -1
   SetWinDelay, -1 
   GuiControlGet, h, Hwnd, %ctrl% 
   ControlGet, haystack, List, , , ahk_id %h% 
   GuiControlGet, needle, , %ctrl% 
   StringMid, text, haystack, pos := InStr(lf . haystack, lf . needle) 
      , InStr(haystack . lf, lf, false, pos) - pos 
   If text !=
   {
      if pos != 0
      { 
         ControlSetText, , %text%, ahk_id %h% 
         ControlSend, , % "{Right " . StrLen(needle) . "}+^{End}", ahk_id %h% 
      } 
   }
}

F8::ExitApp
PS: I am extremely new to autohotkey (or any sort of programming for that matter) and I just joined few existing codes, nothing more. Code is Tested and Working.

Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

idd the autocomplete is a good option, but at the time when I was making the script I felt that it needed to be as easy to understand as possible for everyone what was going on. 

That being said I will probably include the auto-complete in the next update, I wont include the admin since its not necessary at least not for me.

 

Always good to see cool features to add.


Check out ALL My Scripts  ;)


EnricoMakesBank
  • Members
  • 1 posts
  • Last active: Feb 20 2014 01:05 AM
  • Joined: 20 Feb 2014

Selecting "Vi" as your champion of choice is highly problematic. Searching for "Vi" in the champ search box will give you Sivir, Viktor, Vi, and Anivia. In my case, choosing "Vi" with this tool selects Sivir for me. The correct search string is 

^Vi$

 since the search box supports regex. As far as I know, this is the only champion name that requires a special case.



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

Version: 1.04 (26.02.2014)

In preparation for the release of Vel'Koz

 

I decided to update the script and indeed the character list.

 

Fixes:

Names that seem to have been missing have been accounted for and added (report if any mistakes were made there)

Searching for Vi now correctly brings Vi and not Viktor or Sivir

 

Improvements:

As many have asked for and indeed worked themselves into their scripts,

AutoComplete function

Lane Caller

has been added to the script.

Vel'Koz has been added to the name list.

 

Lanes you can automatically call(default):

ADC

Support

Top

Jungle

Mid

#SingleInstance force
myGui("x860 y400", "League of Legends AHK AutoPicker")

myGui(position, title)
{
	global thatVar
	global thisVar
	gui, new
	gui, Default
	gui, +LastFound +LabelMyGui
	gui, add, groupbox, w200 h150, LOL AutoPicker
	gui, font, s8, Arial
	gui, add, text, xm12 ym20 section
	gui, add, text, yp center, Choose the hero to play..
	gui, Add, ComboBox, vthisVar w120 r10 gAC, Aatrox|Ahri|Akali|Alistar|Amumu|Anivia|Annie|Ashe|Blitzcrank|Brand|Caitlyn|Cassiopeia|Cho'Gath|Corki|Darius|Diana|Dr. Mundo|Draven|Elise|Evelynn|Ezreal|Fiddlesticks|Fiora|Fizz|Galio|Gangplank|Garen|Gragas|Graves|Hecarim|Heimerdinger|Irelia|Janna|Jarvan IV|Jax|Jayce|Jinx|Karma|Karthus|Kassadin|Katarina|Kayle|Kennen|Kha'Zix|Kog'Maw|LeBlanc|Lee|Leona|Lucian|Lissandra|Lulu|Lux|Malphite|Malzahar|Maokai|Master Yi|Miss Fortune|Mordekaiser|Morgana|Nami|Nasus|Nautilus|Nidalee|Nocturne|Nunu|Olaf|Orianna|Pantheon|Poppy|Quinn|Rammus|Renekton|Rengar|Riven|Rumble|Ryze|Sejuani|Shaco|Shen|Shyvana|Singed|Sion|Sivir|Skarner|Sona|Soraka|Swain|Syndra|Talon|Taric|Teemo|Thresh|Tristana|Trundle|Tryndamere|Twisted Fate|Twitch|Udyr|Urgot|Varus|Vayne|Veigar|Vel'Koz|Vi|Viktor|Vladimir|Volibear|Warwick|Wukong|Xerath|Xin Zhao|Yasuo|Yorick|Zac|Zed|Ziggs|Zilean|Zyra
	gui, add,text, yp+25 center, Choose the lane to call..
	gui, Add, ComboBox, vthatVar w120 r10 gAC, ADC|Support|Top|Jungle|Mid
	gui, add, button, yp+30 gDone, OK
	gui, add, button, xp+30  gmyguiclose, Cancel
	gui, add, text, yp+40 center, F8 TO CRASH PROGRAM
	gui, add, text, yp+15 xp+17.5, Made by Sanctus
	gui, add, link, yp+15 xp-45,  <a href="http://euw.leagueoflegends.com/news/champion-rotation">Click here to see Champion Rotation.</a>
	gui, font, s10, Verdana
	gui, add, text, yp+15 xp+3, Version: 1.04 (26.02.2014)
	gui, show, % position, % title
	return
	
	AC: 
	AutoComplete(A_GuiControl) 
	Return

	Done:
	{
	gui,submit,nohide
	gui, destroy
	msgbox Hero that will automatically be picked : %thisVar%
	msgbox Position that will be automaticly called: %thatVar%
	Loop
	{
		WinWaitActive ahk_class ApolloRuntimeContentWindow
		{
			PixelSearch, FoundaX, FoundaY, 912, 130, 996, 142, 0xFFFFFF, 0, Fast ;Find Search Box
			if ErrorLevel = 0
			{
			MouseClick, left, 930, 135
			Sleep 10
			Send, %thisVar%
			Sleep, 280
			MouseClick, Left, 325, 212
			Sleep 30
			MouseClick, left, 355, 737
			Sleep 10
			Send, %thatVar%
			Sleep 10
			MouseClick, left, 922, 735
			Sleep, 2000
			}
			PixelSearch, FoundbX, FoundbY, 296, 180, 350, 233, 0x303030, 0, Fast ;Exit Script
			if ErrorLevel = 0
			{
			ExitApp
			}
		}
	}
	return
	}
	myguiclose:
	{
	ExitApp
	return
	}
}

;AutoComplete Section
AutoComplete(ctrl) 
{ 
   static lf = "`n" 
   If GetKeyState("Delete") or GetKeyState("Backspace") 
      Return
   SetControlDelay, -1
   SetWinDelay, -1 
   GuiControlGet, h, Hwnd, %ctrl% 
   ControlGet, haystack, List, , , ahk_id %h% 
   GuiControlGet, needle, , %ctrl% 
   StringMid, text, haystack, pos := InStr(lf . haystack, lf . needle) 
      , InStr(haystack . lf, lf, false, pos) - pos 
   If text !=
   {
      if pos != 0
      { 
         ControlSetText, , %text%, ahk_id %h% 
         ControlSend, , % "{Right " . StrLen(needle) . "}+^{End}", ahk_id %h% 
      } 
   }
}

;Crash Script
F8::ExitApp

I do not deem any other lane calling necessary but go ahead and edit the script for your own needs.

 
As usual if any bugs or mistakes are found, reply to the post or send me a pm, so I can fix in a jiffy.

Check out ALL My Scripts  ;)


ROZAY
  • Members
  • 1 posts
  • Last active: Feb 28 2014 10:56 AM
  • Joined: 28 Feb 2014

This is not working for me. I did everything. Is there a certain button I need to press? I have it open and i verified and it wont select the champions for me or call my role. Do I need to be in fullscreen mode? 



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

This is not working for me. I did everything. Is there a certain button I need to press? I have it open and i verified and it wont select the champions for me or call my role. Do I need to be in fullscreen mode? 

Not quite sure what to tell you m8, works fine here and probably for most people

 

Circumstances it might not work:

You re-sized the client (Only works in the default size else locations its searching for aren't there anymore)

Another program is blocking it

Some people need Admin privileges

The Sleep times aren't large enough (try setting them to at least 50 and recheck) line 46-54

The program wasn't running :D

 

Please do let me know if you figure out why it wasn't working


Check out ALL My Scripts  ;)


Silveirinha
  • Members
  • 3 posts
  • Last active: Mar 04 2014 02:05 AM
  • Joined: 02 Mar 2014

Worked very well.

Any reason to spam the chat 2 or 3 times?

 

EX:

you: ADC

Other: Mid

you: ADC

Other : sup

you: ADC



Silveirinha
  • Members
  • 3 posts
  • Last active: Mar 04 2014 02:05 AM
  • Joined: 02 Mar 2014

Duplicate...

Sorry



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

Worked very well.

Any reason to spam the chat 2 or 3 times?

 

EX:

you: ADC

Other: Mid

you: ADC

Other : sup

you: ADC

 

Shouldn't be any reason to but if you want to theres nothing stopping you :)

 

just paste this 2 times

Send, %thatVar%

Sleep 10

at line 55


Check out ALL My Scripts  ;)


Silveirinha
  • Members
  • 3 posts
  • Last active: Mar 04 2014 02:05 AM
  • Joined: 02 Mar 2014

Shouldn't be any reason to but if you want to theres nothing stopping you :)

 

just paste this 2 times

Send, %thatVar%

Sleep 10

at line 55

 

No, no ...
I meant is that the script behaves this way with me.
I wish he were not so.



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

Strange.. theres no reason it should.. :p


Check out ALL My Scripts  ;)


Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

http://promo.euw.lea...s.com/en/braum/

 

Script updated, adding Braum to the fold.


Check out ALL My Scripts  ;)


iCaal
  • Members
  • 2 posts
  • Last active: May 14 2014 12:23 PM
  • Joined: 13 May 2014

First time here . How to use it ?

I saved all your code as .ahk but got error at 009:Gui, new
Help ?



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

http://ahkscript.org/download/

 

^reinstall AHK from the installer from this link,

 

theres some issues with the one from autohotkey.com :S


Check out ALL My Scripts  ;)