Jump to content

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

League of Legends AHK Scripts


  • Please log in to reply
19 replies to this topic
Posezion
  • Members
  • 10 posts
  • Last active: May 06 2011 10:01 PM
  • Joined: 03 May 2011
Well, here I was thinking we should post scripts for the popular game "League of Legends". Also, I am releasing my "Posezion's LoL Macros" AHK program, It's kinda over-done with looks more than functionality. It's obviously meant to be used in the game League of Legends, but here's the download link:

<!-- m -->http://www.mediafire...vub2apb7jbq0xzm<!-- m -->

And here's the code:

#InstallKeybdHook
SendMode Event
#UseHook
Menu, Tray, Icon, LoL_Macro_On.ico, , 1
SoundPlay, Welcome.mp3 ,wait


Numpad9::
{
	Send {Enter}
	Sleep 50
	Send re.
	Sleep 50
	Send {Enter}
}
return

Numpad6::
{
	Send {Enter}
	Sleep 50
	Send Care.
	Sleep 50
	Send {Enter}
}
return

Numpad7::
{
	Send {Enter}
	Sleep 50
	Send Top MIA.
	Sleep 50
	Send {Enter}
}
return

Numpad4::
{
	Send {Enter}
	Sleep 50
	Send Mid MIA.
	Sleep 50
	Send {Enter}
}
return

Numpad1::
{
	Send {Enter}
	Sleep 50
	Send Bot MIA.
	Sleep 50
	Send {Enter}
}
return

Numpad8::
{
	Send {Enter}
	Sleep 50
	Send Inc Top.
	Sleep 50
	Send {Enter}
}
return

Numpad5::
{
	Send {Enter}
	Sleep 50
	Send Inc Mid.
	Sleep 50
	Send {Enter}
}
return

Numpad2::
{
	Send {Enter}
	Sleep 50
	Send Inc Bot.
	Sleep 50
	Send {Enter}
}
return

Numpad0::
{
	Send {Enter}
	Sleep 50
	Send Push.
	Sleep 50
	Send {Enter}
}
return

NumpadDot::
{
	Send {Enter}
	Sleep 50
	Send Back.
	Sleep 50
	Send {Enter}
}
return

F11::
{
	Send {Enter}
	Sleep 50
	Send Key Bindings List
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send - Numpad7/4/1 Top/Mid/Bot Mia.
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send - Numpad8/5/2 Inc Top./Mid./Bot.
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send - Numpad0/Dot/9/6 Push./Back./re./Care.
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send - Home/Shift+Home (Program On or Off/Exit program)
	Sleep 50
	Send {Enter}
}
return

F12::
{
	Send {Enter}
	Sleep 50
	Send        "Posezion's LoL Macros" Beta - Info.
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send Version 1.4.57 beta
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send Last Update - 5/03/2011
	Sleep 50
	Send {Enter}
	Sleep 50
	Send {Enter}
	Sleep 50
	Send Press F11 For Key Bindings List
	Sleep 50
	Send {Enter}
}
return

;;Enter:: ;;these two are so the hotkeys are disabled while you team chat or all chat
;;Suspend
;;Send {Enter}
;;return

;;+Enter::
;;Suspend
;;Send +{Enter}
;;return

Home::
Suspend
	If A_IsSuspended
		{
		Menu, Tray, Icon, LoL_Macro_Off.ico, , 1	
		SoundPlay, Deactivated.mp3 ,wait
		}
	else
		{
		Menu, Tray, Icon, LoL_Macro_On.ico, , 1	
    		SoundPlay, Activated.mp3 ,wait
		}
return

+Home::
	SoundPlay, Goodbye.mp3 ,wait
	ExitApp

Enjoy! Hope to see other people's scripts :)

boygamer
  • Guests
  • Last active:
  • Joined: --
Is this a purely game-oriented script, or it could have some other general applications? :lol:

Posezion
  • Members
  • 10 posts
  • Last active: May 06 2011 10:01 PM
  • Joined: 03 May 2011
Purely game oriented. If you like, for all I care, you can use all my MP3's and my codes that go along with them. Have fun with it, just post back with your result, I'd like to see where it heads ;) And if your wondering about the icons, I used Adobe Photoshop CS3 with a windows .ico exporter/importer (I think it was exporter/importer, idk if it was build into CS3)

specter333
  • Members
  • 627 posts
  • Last active: Nov 28 2014 02:22 PM
  • Joined: 15 Jan 2007
Hi Posezion, thanks for sharing your script. I have been looking for game scripts I could convert into a module for my automation script I've been working on.
http://www.autohotke...pic.php?t=71046
Your script looks ideal.

The idea is anyone could pick one of the commands you have written from a drop down list and assign any type of input to run it. Of course they could use HotKeys or HotStrings, Voice Commands, Onscreen Control Pad, Remote Controls...

Would you mind if I converted you script and could you please provide some descriptions of what each command does for those of us who don't know the game?

Thanks again for sharing.

Posezion
  • Members
  • 10 posts
  • Last active: May 06 2011 10:01 PM
  • Joined: 03 May 2011
Absolutely. As said, I don't mind if anyone alters/uses anything from my script.

You'll see Send {Enter} in the scripts, Enter by default is to open the chat window. Send Top MIA. Is when the 3 lanes are missing. Basically, there are 3 lanes in a 5v5 match. Top, mid, bottom. Top Mia/Mid Mia/Bot Mia/ means that the enemy champions are missing so be careful basically. Inc Top/Mid/Bot means Incoming Top/Mid/Bot as in an enemy champion is coming. Care is just to be aware. Re is to basically say Nevermind after a Mia call or a Inc call, meaning if a champ is missing bot you say Bot Mia and if he appears in bottom again you reply with Re. F11 is the key bindings list and F12 is just information about the script. Home is to exit and Shift+Home is to close the program. The top lines of the script are what make the script work in-game. Without the hook it won't send the messages through for some reason.

Keep in mind, enter opens the chat window, and enter re-sends it. It is only a macro program that many LoL people have wanted for so long.

Heres the readme that also points out a small flaw that you may want to pay attention to, along with the binds.

Please take the time to read this file; It is rather important ^_^.
Warning: Program works ONLY for Windows (ie: Windows XP/Vista/7)




Aurthor: Posezion (<!-- e --><a href="mailto:Posezion@hotmail.com">Posezion@hotmail.com</a><!-- e -->)
"Posezion's LoL Macros" Beta
Version 1.4.57 beta
Last Update - 5/03/2011
Release date: May 04, 2011



TL;DR? Scroll down and at LEAST read the !!!IMPORTANT!!!



First, you want to start the program. Press "F12" in the game to basically execute
that the program is running, information about the program, and to see what your
binds are in-game. It will tell you to press "F11" for a list of binds; The program
will tell you the following binds:


Key Bindings List
- Numpad7/4/1 Top/Mid/Bot Mia.
- Numpad8/5/2 Inc Top./Mid./Bot.
- Numpad0/Dot/9/6 Push./Back./re./Care.
- Home/Shift+Home (Program On or Off/Exit program)

If your a tad confused, read the following bind list:

-F12 - Program information
-F11 - Bind list
-Numpad 7 - Top Mia.
-Numapd 4 - Mid Mia.
-Numapd 1 - Bot Mia.
-Numapd 8 - Inc Top.
-Numapd 5 - Inc Mid.
-Numapd 2 - Inc Bot.
-Numapd 0 Push.
-Numapd . (Dot) - Back.
-Numapd 9 - re.
-Numapd 6 - Care.
-Home - Program on/off (Activate/deactivate binds)
-Shift+Home - Exit/close the program.

Keep in mind this program is in beta, thus it is an early release and depending on how
things run, I plan to make changes.




>>>>>> ! ! ! I M P O R T A N T ! ! ! <<<<<<


PLEASE NOTE THAT THE WAY THIS PROGRAM WORKS IS BY SENDING KEY STROKES AUTOMATICALLY.
THAT BEING SAID, MAKE SURE THAT -BEFORE- YOU PRESS ANY MACRO KEYS, YOUR CHAT BOX IS
CLOSED, OTHERWISE IT WILL USE THE KEY ENTER TO OPEN THE CHAT BOX (IN THIS CASE, IF
IT'S OPEN, IT'D CLOSE IT) AND IT WOULD USE ALL LETTERS AND NUMBERS THAT THE MESSAGE
WOULD DISPLAY ON YOUR KEYBOARD, THUS EXECUTING ALL YOUR BASE GAME HOTKEYS. IF YOU
ARE CAREFUL AS TO THIS, THEN THERE SHOULD BE NO PROBLEMS. IF YOU ARE UNCOMFORTABLE
WITH THE IDEA, USE THE HOME KEY TO DISABLE/ENABLE THE USE OF THE LOL MACRO PROGRAM
UNTIL FURTHER NEEDED. THANK


INSTALLATION INSTRUCTIONS: Unzip the folder and place the shortcut wherever desired,
or create a new one, and right click the shortcut, click properties, and click change
icon then browse the Posezion's LoL Macros directory and select the LoL_Macro_Short.ico
to have a shortcut. DO NOT remove any files.



THIS PROGRAM IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY RIOT GAMES COMPANY LLC. AND/OR ITS LICENSORS.


Feel free to continue asking in details about this.

Edit:

Also, if your going to use just the commands, then get rid of the icon and sound scripts. Whether it's disabled/enabled the icon is different and theres also a custom shortcut icon, and the sounds play when it's activated or deactivated, opened or closed, so unless you want to implement those into your overall program, go for it, but otherwise, just erase those scripts.

Edit2: And if you like the idea of mine using the .mp3's, I got my files free from iSpeech.org. You can sign up, get an account, and create any text-to-speech files you want in the free version (Assuming that you will stay under 200 MB I believe it is the limit, although text-to-speech files are like 25 kb tops, lol)

specter333
  • Members
  • 627 posts
  • Last active: Nov 28 2014 02:22 PM
  • Joined: 15 Jan 2007
Thank you for the help with this. I have already made the module, I'll upload it in a minute, but I didn't included the keyhook lines because from what I understood from the manual they are default in an AHK script. If it doesn't work I may have to find a way to include them.

The text to speech you were talking about can be accomplished in my same script I'm adding your game script to, all in AHK with no size limit. You can add it in the same subroutine as your game commands if desired. Just first choose the game module and add the command then choose the speech module and add a phrase, it's pretty simple.

If you don't mind installing and giving my script a try I would appreciate your trying out the LoL module and seeing if it functions like it should. I haven't included any game modules yet because I'm one of those people who get motion sickness when playing these types of games. :roll: But I think if I could get some modules built it would help out a lot of gamers who aren't up to writing their own scripts.

Edit:
Ok here is the LoL module for download, separate from the main App so it needs to be imported.
http://www.autohotke... of Legends.zip
Download and unzip this anywhere, open EasyAutoEdit by pressing Control+F12 assuming Easy Automation AHK is running. Under the file menu choose "Import New Module", browse to the module and click the "Import" button. I just found out that I haven't finished importing of the help (.txt) file yet so it needs to be manually copied to the help folder.

Once it's imported chose the LoL module from the commands drop down list. It should be self explanatory on how to use it.

The commands I kept are listed on the module, all others I cut. For instance Easy Automation AHK is designed to always be running in the background so there is no need to have an exit routine. I did however suggest in the help file to use IfWinNotExist at the top of the subroutine so the commands would only be active while playing the game. I'm still considering using the binding list but it will be somewhat complicated and while I was writing this I didn't know where the list would be viewed. It will take reading an ini file to be able to get the bindings but should be doable with some work.

Thanks again for letting me use this and if you don't want to go to the trouble of installing and trying my script I understand.

Another Edit:
Just fixed the import of help files and uploaded a new script. Now when you import the module the help file is automatically imported.

OceanMachine
  • Members
  • 790 posts
  • Last active: Aug 23 2013 02:10 PM
  • Joined: 15 Oct 2007
I am working on an in-game GUI overlay for Lol that will offer things like chat buttons, a dragon/baron timer, alert messages, etc.

I have written an overlay DLL that should enable you to actually overlay a customisable GUI over any D3D9 game (including LoL), and handle GUI events with an external program (in this case AHK, but it could be any language that is capable of loading a DLL and processing WM_COPYDATA messages).

Basically the DLL I have written is a framework for GUI overlay (using the CEGUI system) and I am using AHK as the scripting language to load the DLL and handle the events, and using LoL as an example game that it can be used with.

I am just doing some testing to check it works OK, then I plan to release both the DLL and the AHK script. Does this sound like it might be useful? (i.e. a GUI in-game rather than hotkeys)? Of course hotkeys can be used as well as a GUI, but I thoguht some people may also like the option of having clickable buttons on the screen.

octal
  • Members
  • 100 posts
  • Last active: Aug 31 2014 09:54 AM
  • Joined: 21 Feb 2011
Sounds interesting to me, I've never tired but I'm guessing you can't just make the overlays with ahk?

EDIT: Nevermind stupid question.

nobody_9102891
  • Guests
  • Last active:
  • Joined: --
Your program is pretty neat, but it severely lacks in the field of customization. Either I'm missing something easy (and if I am, then why hasn't it been made more-clear?) or your program doesn't allow for changing the default 'words' you get when you press a hotkey.

Basically I ask that you make this program 500x more useful by writing a clear 'tutorial' or guide on how to modify the text content of this program so that we can get some more usefulness out of it than simply saying "MIA."

That's nice and all, but perhaps we'd like to say our own custom things, eh?

  • Guests
  • Last active:
  • Joined: --
I don't think that is a fair criticism. Anyone using AHK for anything should be bright enough to be able to find the phrase they want to change and change it. Not rocket surgery.

Deo
  • Members
  • 199 posts
  • Last active: Jan 31 2014 03:19 PM
  • Joined: 16 May 2010
nice
a topics like that bring a flows of fresh gamerish blood on ahk forums and make it a bit more popular.
two suggestions:
- make a one function for all those sleep-send-sleep patterns
- a small gui to customize hotkeys/text

i was thinking to make something similar when i played LOL, glad you realized the idea ;)

gorio
  • Guests
  • Last active:
  • Joined: --
any idea on how to make a code that autotypes after you made an assist to a champion? it's like assist streak. and after death the assist streak will reset. and death streaks.

is this possible?

Deo
  • Members
  • 199 posts
  • Last active: Jan 31 2014 03:19 PM
  • Joined: 16 May 2010
it is possible by checking assist counter on the screen

octal
  • Members
  • 100 posts
  • Last active: Aug 31 2014 09:54 AM
  • Joined: 21 Feb 2011
I made an autoTF app. Based on the hotkey it will auto select the right card.

Also got a HUGE app coming out for Lol written in AutoHotkey.

gorio
  • Guests
  • Last active:
  • Joined: --
so as the assist increases the autohotkey automatically types in a phrase. any idea or script in your mind on how to do that?