Dota macros - Dota scripts AutoHotkey

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

Dota macros - Dota scripts AutoHotkey

03 Feb 2018, 15:54

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

Note: is using macros in Dota considered as cheating?

It depends, macros don't hack the game and won't improve your game sense (knowing where to be, what to do, doing the adequate build), for some heroes like Meepo or Invoker in pub games this should be fine, especially if your MMR is low, those heroes are hard to master and macros can allow you to play them without penalizing your team without having to stick with a basic right clicker in every games. Using them in arcade game is more permissive especially if the game mode has no penalty for leaving.
But in ranked games how fast you use your abilities matter unless you play an hero with spammable spells like Bristleback and you don't want to break your keyboard.

To sum it up: 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.

Shortcuts and recommendations

For my main script I always set it to the ` key at the left of the 1 button, in Dota it is used for the scoreboard, remove the shortcut for it. All the abilities and items shortcuts here are those by default and they are 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 end 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.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

Toggle = 0
SetDefaultMouseSpeed, 2
#MaxThreadsPerHotkey 2


Basic script

This script bellow 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

Note: out of a loop don't forget to set Toggle = 0.

The advantage of using a loop is that you can repeat the input much faster and it is repeated immediately while with a key you must hold it then the inputs 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 be unable to control your hero. Also the abilities and items sound being not ready 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.
Note that before the loop the keys Escape and F1 are pressed. Escape will close the in game chat in case it was opened and F! will select your heroe. In the loop 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. You can also use {F5} to buy your items when you have enough gold, this is useful during a fight especially while securing your base but also to quickly buy your items before dying and avoid losing too much gold.

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 enemies 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 courier while you need it to heal up or finish a Midas. If the enemy needs the courier to survive or get a Midas do not use this. You will need to setup a shortcut to deliver your item in the courier, it this example it uses the "g" key. Minimum sleep 40:



Using shrine (it must not be looped): it will put all your items in the backpack then put them back in their corresponding slot, this allow to reduce your mana and HP pool in order to regen more. Caution if you shrine during a fight you could use the control of your character because the mouse is used and also defensive items like for example a Vanguard will be disabled. Don't forget to use "SetDefaultMouseSpeed, 2" and to delete the line "SendMode Input" to make the mouse move slower and not instantly in order to make the script works:

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



Instapick: quickly picks an heroe, this one picks Bristleback. Minimum sleep 75. Remove the two sleep lines if you use SetDefaultMouseSpeed, 2 (to have a slow moving mouse).

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 an healing salve and a mango then call the courier, you can adjust it to only buy one 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 need a specific order 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, same for items.
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.

I suggest a sleep of 150 after the first target ability so your hero has the time to turn and face the enemy before doing the other inputs.

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' oder.

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:

There is a minimum delay of 75 ms between each:

Pre-initiation:
- Shiva
- Cloak
- Blademail
- Glimmer Cape
- Lotus Orb

Initiation:
- Blink dagger

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

Turn delay of 150 ms or after the disabling items bellow

Strong disablers:
- Scythe of Vyse
- Orchid
- Halberd

Disablers:
- Diffusal blade
- Solar Crest

Items active:
- almost every items with an active including Necronomicon

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.

Bonus macros:

You can add a taunt shortcut at the end of a macro if you want, it is useful with Nukers like Skywrath Mage.

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


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 that is why I put it in the bonus section. Minimum sleep 50 if you loop it.

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

SendInput, s
Click, right


Necronomicon army: this script will spawn 4 necronomicons, you need to be in a shop to remove the cooldown. Also it uses a lot of mana. You need to put in your backpack from left to right: necronomicon, necronomicon, refresher orb.
This script is ideal for pushing in late game if you are full, but also with some heroes for split pushing like Lycan, Nature Prophet and Beastmaster. You can use the army to clear jungle camps quickly.

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

Return to “Gaming”

Who is online

Users browsing this forum: MultiTed and 2 guests