AutoHotkey Dota 2 Invoker Script with Gui
RPAWR-cosmetic-divider

How to make your own Invoker script in Dota 2

With the power of AutoHotkey, it’s an easy task to automate games, to make shortcuts for different spells for example. It’s easy to learn the AutoHotkey language and I highly recommend it to you, you can have a lot of fun, not just in games, you can also make shortcuts everywhere in you daily routine. This means a lot of saved time in the long term. In this article you can take a quick look at how you can learn to control this hero. I also made a long video about the entire process. You can learn how you can make a fancy Gui and how you can use AutoHotkey in games.

This video I’ve created guides you trough all the necessary steps. Including how to create a Gui and how to use functions that will allow you control your spells by hotkeys. I’ve tried to explain everything, if you have any questions don’t hesitate to contact me.

AutoHotkey Dota 2 Invoker Script with Gui

I attached the PSD (Photoshop) file in case you would like to modify the pictures. The layers are named properly, you can find the file in the zip file.

AutoHotkey Dota 2 Invoker Script with Gui
RPAWR-cosmetic-divider

How can I use it?

There are two possible way to use the script:
You download the script in a compiled format (exe)
You create an ahk file and use it with installed AutoHotkey

Download this zip file for the Graphics and the compiled EXE, AHK file or the PSD file

I recommend to download it if you are not familiar with AutoHotkey yet

Forget Plugin - DIY

RPAWR-cosmetic-divider

The full AutoHotkey code

The following code can be copied, you can create your own .ahk file.

#NoEnv
#Persistent
#SingleInstance, Force
SendMode, Input
SetWorkingDir, %A_ScriptDir%
SetTitleMatchMode, 2
SetTitleMatchMode, Fast

; ========================================================================

global states:= ["qqq","www","eee"]
global i

; ========================================================================

Gui_Invoker()

; ========================================================================

^q::Invoker_Spell("Coldsnap")
^w::Invoker_Spell("GhostWalk")
^e::Invoker_Spell("IceWall")
^r::Invoker_Spell("EMP")
^a::Invoker_Spell("Tornado")
^s::Invoker_Spell("Alacrity")
^d::Invoker_Spell("DeafeningBlast")
^f::Invoker_Spell("SunStrike")
^3::Invoker_Spell("SpiritForge")
^4::Invoker_Spell("ChaosMeteor")

CapsLock::Invoker_ChangeState()

F12::ExitApp

; ========================================================================

Gui_Invoker(){
	
	Gui, +LastFound +AlwaysOnTop +ToolWindow -Caption
	Gui, Color, EEFFFF
	WinSet, TransColor, EEFFFF 225
	
	Width:= 64	
	GuiCommand:= ["w" Width " ys","w" Width],
	Path:= A_ScriptDir . "\img\"
	
	Gui, Add, Picture, % GuiCommand[2], % Path "Cold-Snap.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Tornado.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "EMP.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Ice-Wall.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Ghost-Walk.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Alacrity.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Chaos-Meteor.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Deafening-Blast.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Sun-Strike.png"
	Gui, Add, Picture, % GuiCommand[1], % Path "Forge-Spirit.png"
	
	Gui, Show, y43
	hwnd_Gui:= WinExist()
	WinSet, ExStyle, ^0x20, ahk_id %hwnd_Gui%
	
	return
}

Invoker_Spell(spell){
	
	Spells:= [ ["ColdSnap", 	"qqq"]
		,     ["GhostWalk", 	"qqw"]
		,     ["IceWall", 	"qqe"]
		,     ["EMP", 		"www"]
		,     ["Tornado", 	"wwq"]	
		,     ["Alacrity", 	"wwe"]
		,     ["DeafeningBlast","qwe"]
		,     ["SunStrike", 	"eee"]
		,     ["SpiritForge", 	"eeq"]
		,     ["ChaosMeteor", 	"eew"] ]
	
	loop % Spells.Length(){
		if InStr(Spells[A_Index][1],spell){
			SendInput(Spells[A_Index][2] "r" states[i]) 
			return
		}
	}
}

Invoker_ChangeState(){
	i++
	(i=4) ? (i:= 1) : i
	SendInput(states[i])
	return
}

SendInput(hotkeys){
	SendInput, %hotkeys%
	return
}
RPAWR-cosmetic-divider

The code explanation

RPAWR-cosmetic-divider

Work in progress…

; >> SOON >>
divider bar
divider bar
divider bar

RPAWR-cosmetic-divider

If you are interested in saving yourself a lot of time, check AHK.

Autohotkey is an automation tool, easy to learn, powerful!

You can check my favorite editors here.