Macros for Dota 2

Post gaming related scripts
Player
Posts: 5
Joined: 03 Feb 2018, 15:21

Macros for Dota 2

03 Feb 2018, 15:54

Here I share some base scripts for Dota 2 and tips to create your own.

Note: Is using macros in Dota considered has cheating?

It depends, in ranked games it gives you an unfair advantage unless you play an heroe with spammable spells like Bristleback and you don't want to break your keyboard. But macros in pub games should be fine. Using them in arcade game is more permissive especially if the game mode has no penalty for leaving. You can't get banned for using macros since it is considered as key inputs but you can get spectated in a ranked game and the replay can be sent to Valve.

Shortcut and settings

For my main script I always set it to the ` key at the left of the 1 button, in Dota it's used for the score board, remove the shortcut for it. All the abiltiies and items shortcuts are those by default but they must be set to quickcast. If you want to use the Refresher Orb don't include it in the macro because it could be used when you don't want or before your abilities are all used.

Important: each script must finished with the word return especially if you use loops.

For your scripts here are the settings to add at the top:

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

Toggle = 0
SetDefaultMouseSpeed, 2
#MaxThreadsPerHotkey 2


Basic script

This script allow to use all your abilities and items every time a cast animation is over, the order can be messed up because the key stroke are instant and the cast animation cancel the inputs. You can tap or hold the ` key. I recommend using only 5 items in your inventory (zxcv) so you can keep the last two slots unused for your teleporter scroll, heals, arcane boots, etc.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

`::
SendInput, zxcvrqwedf
return


The single loop script

The advantage of using a loop is that you can repeat the input much faster and it starts directly while with a key you must hold it then the macros are repeated shortly after. Do not set the timer too low because it could get laggy and if the keys get spammed too fast while you are stunned or Doomed some actions will get queued and you will get unable to control your heroe. Also the abilities and items not ready sounds will get even louder with a low timing.
I share two looping scripts, the first one can run one loop at a time and the second can run multiple at the same to spam an ability during the entire game for example. Both loops can be exited with Alt + F4.
Note that out of the loop the keys Escape and F1 are pressed. Escape will close the in game chat it case it was opened. Also the tab key is used to select your controlled units and cast their abilities and a right click move all your units at the mouse's position, remove the tab input if you use your controlled units to split push or jungle.

This script spams all your items and abilities, it switches of hero and right click. Each time you want to use a new loop, the loop is disabled, then press the key again to enable the new loop:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



The multiple loop scripts (allow to have different speed for key inputs):

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Some scripts you can use in a loop:

Note: remember to start with the line "SendInput, {esc}{F1}" before entering in a loop. Also add a sleep if you are using the individual loop script, I have indicated the minimum sleep to use at the end of the loop.

Fast right click: it can be useful to pick a bounty rune against enemies, especially invisible ennemies trying to steal it. Minimum sleep 1.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

Click, right


Giff me item: you can enable this loop if someone in your team steals the courrier while you need it to heal up or finish a midas. If the ennemy needs the courrier to survive or get a midas do not use this. You will need to setup a shortcut to deliver your item in the courrier, it this example it uses the "g" key. Minimum sleep 40:



Last hit helper (more like fun animation): this script can help you last hit by spamming the stop and right click, but most of the time it's better to do it manually because you need to enable and disable the script to last hit. You can also use it out of a loop. Caution if you use it in a loop, because if you set the loop to repeat too fast other players can notice that you are using a script. Minimum sleep 50.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

SendInput, s
Click, right


Instapick: quickly picks an heroe, this one picks bristleback. Minimum sleep 75.

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

f7::
SendInput, {esc}{F1}
Toggle := !Toggle
While Toggle{
Click, left, 455, 224
sleep 10
Click, left, 1482, 794
sleep 75
}
return


Complete script that I use:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Scripts you can use (not looped):

This script will quickly buy and healing salve and a mango then call the courrier, you can adjust it to only buy one item and make a dedicated key for each item:

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

MouseGetPos, xpos, ypos
Click, 1730, 1050 ;shop
Click, right, 1655, 414 ;mango
Click, right, 1660, 375 ;salve
MouseMove, %xpos%, %ypos%
SendInput, {esc}g
Return


Using delays:

For other heroes that needs a specific orders to use their items and cast their abilities you need to add a delay between each keystroke and to use the cast animation timing on the wiki: https://dota2.gamepedia.com/Cast_animation
To use them properly you need to trigger in priority every items then abilities without cast animation that you want with a delay of 75 ms then use the abilities with the lowest cast animation time to the highest. A cast animation of 0.3s on the wiki is equal to a sleep of 300 ms, and 1s = 1000 ms, you must add 75 ms after every cast animation so the keys are detected correctly and you are sure the ability has finished to be casted.

I suggest a sleep of 150 after the first ability/target item so it has the time to turn and face the enemy before doing the other inputs, with a blink dagger does that at the second ability/target item. Between each input use a sleep of 75 (0.075s). If there is a cast animation add the delay of 75 to it. For example for Nature Prophet the Sprout cast animation is 0.35s (350) so to summon the treants with Nature's call you need to use a sleep of 0.35s + 0.075s and if this is the first input of the script add 0.15s.

Note that you need to be in range to cast your spells in the order, you can get a blink dagger or aether lens to never miss your abilities.

An example with nature prophet to summon the treants the cast animation of his q is 0.35s and the cast animation of his e is 0.5s:

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

turn = 150
delay = 75

`::
SendInput, {F1}q
sleep turn + 350 + delay
SendInput, e
sleep 500 + delay
SendInput, {F2}
return


Items and ability orders:

Here is the order of the priorities

The first key is F1 to select your heroe or F2 to select the group with your heroe first. Note that if you include F1 or F2 you won't be able to use tab because it will always select your heroe again. You can use the number 1, 2, 3, etc. and create groups with ctrl + number, you can prepare your groups in the demo mode.

There is a delay of 75 ms between each keys.

Pre-initiation:
- Shiva
- Cloak
- Blademail

Initiation:
- Blink dagger

Items with travel speed:
- Ethereal blade
- Nullifier
- Rod of Atos

Turn delay of 150 ms or after the disabling items bellow

Disabling items:
- Orchid
- Scypthe of Vyse
- Diffusal blade

Items active:
- almost every items with an active

Items with an aura:
- Drum of Endurance
- Pipe of Insight

Abilities:
- Every abilities without cast animation then use progressively the ability with the highest cast animation unless they need a specific order of execution like a damage amplification, I suggest to not include summoning units in it but to summon the units in anticipation before the fight (excepted the necronomicons that must be used after blinking because they have no cast animation)

Bonus macros:

You can add a taunt shortcut at the end of a macro if you want.

Auto laugh: it will trigger the laugh of your hero every 14 seconds:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Dance: will make your heroe spins:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Quickly re-enter a lobby after getting kicked:

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

f8::
Toggle := !Toggle
While Toggle{
Click, left, 960, 613
Click, left, 1500, 889
}
return

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 2 guests