Home Tech 23 Best AutoHotKey Script To Make Your Life Easier

23 Best AutoHotKey Script To Make Your Life Easier

Are you tired of repetitive tasks on your computer that waste your time and drain your energy?

You may have to fill out the same forms daily, copy and paste data from one spreadsheet to another, or launch several applications with different shortcuts to start your workday.

Fortunately, there’s a powerful automation tool that can help you streamline your workflow and boost your productivity: AutoHotkey.

In this article, we’ll explore the basics of AutoHotkey and how to use it to create custom scripts that can automate almost any task on your computer.

Whether you’re a developer, a writer, a marketer, or a student, you can benefit from AutoHotkey scripts that can save you time, reduce errors, and make your computer work for you.

Let’s get started!

What Will I Learn?💁 show

What is HotKey?

Before learning the dynamics and intricacy of AutoHotkey, we should first learn “what is hotkey?”.

Hotkeys are a set of keys that allow the user to perform a specific task quickly. They are often referred to as shortcuts. For example, Alt + F4 is used t close a window.

How to Download and Install AutoHotKey Script?

To download AutoHotKey, click here.

Then, click on “DOWNLOAD” and choose the current version.

23 Best AutoHotKey Script To Make Your Life Easier 23 Best AutoHotKey Script To Make Your Life Easier

Now click the downloaded application to install it on your computer. Do Express Installation, and you are good to go.

To use it, you ought to create an AutoHotKey shortcut. 

autohotkey scripts

You need either Notepad or any other text editor to write a program, and after that, you can run it through the AutoHotKey application. 

If you right-click the AutoHotKey application, you will see a list of different features such as:-

autohotkey scripts

  • Run Script is used to run your script with AutoHotKey’s runtime.
  • Compile Script will compile files that contain ATH interpreters and scripts.
  • Edit Script is used to create a file via a text editor. 

Note: When you click “edit script,” your default text editor will pop up, which usually is a notepad.

To end AutoHotKey’s functioning, you need to right-click the green button from your taskbar and the appeared list and click on “exit”. It will end your program.

Features of AutoHotKey:-

Best AutoHotKey Script To Make Your Life Easier

As mentioned earlier, AutoHotKey now is not just a “custom shortcut creating” application. It has different functions, features, and uses. Let’s look at some of its uses.

  • They can be used to redo your keyboard orders, such as QUERTY, Dvorak, etc. 
  • AutoHotKey enables the user to add a signature to an email, message, etc.
  • They allow the user to use a keyboard or a joystick as a mouse cursor.
  • They can make a platform to run Automatic Repetitive Tasks.
  • If you want to add particular punctuation or symbol not available on your keyboard, you can use AutoHotKey.
  • To change previously assigned shortcuts or create new shortcuts.
  • Schedule tasks at a particular time.

How to use AutoHotKey:-

AutoHotkey can be used for many things; in this section, we will create, compile, and run a few of the AutoHotKey tasks.

Keys equivalent in AutoHotkey:-

To write a program in AutoHotKey scripts, you must learn the hotkey equivalents. These are the keywords that you can use instead of the keys present on your keyboard. To do that, you need to need first check all the equivalents from the official website of AutoHotkey.

Here in this subsection, I am going to explain a few of the key hotkeys.

  1.  # is used as a key equivalent of windows.
  2. ! Is used as a key equivalent of Alt.
  3. ^ is used as a key equivalent of Ctrl
  4. + as ky equivalent of Shift
  5. & is used to combine two keys or mouse into a custom hotkey.
  6. < is used to trigger the left key. For example, <^a will trigger the ctrl button, but the left one will get triggered.
  7. > is used to trigger the right key.
  8. <^>! It is used as a key equivalent of AltGr(if your keyboard has AltGr in place of Alt)

For in-depth detail, see AutoHotKey’s official website mentioned earlier.

Best AutoHotKey Scripts: Our Top Pick 👌👌

1. Use AutoHotKey to launch Chrome

AutoHotKey is used to create shortcuts that will save the user time.

Let’s use AutoHotKey to launch Chrome. We will make “Windows + A” a new shortcut for this.

Step 1: Right-click on the “AutoHotKey” icon and click on “edit script”

23 Best AutoHotKey Script To Make Your Life Easier

Step 2: A text editor will open with a few lines of code written in it.

Step 3: Without altering then, you need to type the code written below.

#a::

Run Chrome

return

Step 4: Now save the text and run the application. By right-clicking the application and selecting “Run Script,”.

23 Best AutoHotKey Script To Make Your Life Easier

Step 5: After clicking “Run script” you will see an “H” in green color on your taskbar, which confirms that your code is running in the background.

Step 6: Click “Windows + A”  and your chrome will be launched. 

Now let us understand the code in detail. Let us understand it line-by-line.

“#a::”: This line defines the hotkey. ‘#’ is used as a short form of Windows, and ‘a’ is a button assigned to be used as a shortcut with the windows key. The Double colon “::” is used to signify the dawn of an action block.

Now let us examine the second line, which gives a command to launch Chrome by the “Run Chrome” line. 

The last line, “return” is used to terminate the code. “Return” will always be written at the end of the code you can have any number of actions before it.

So, this was the basic command you can use to start with AutoHotKey.

2. Use AutoHotKey to make an AutoCorrect program

If you are a typist or an article writer like me then you might want to use autocorrect software. How good would it be if you could create one for yourself? AutoHotKey allows you to do that.

Now you have to download the AutoHotkey script from here. Just go to the website, select the code, copy and paste it to a notepad file and then save it using “.ahk” extension. 

And you are good to go; enjoy your custom-made Autocorrect tool.

3. Use the Script to Launch the Website quickly

There are a few websites that you use a lot; for some of you, it might be Google, Facebook, Instagram, etc. What if you can create a shortcut that will do that for you? So, I will use “Ctrl + Shift + R” to do that with the help of the script.

Use the script below to open your favorite website with just a few keyboard strokes.

; Launch Technicalustad

^+r::Run “www.technicalustad.com” ; use ctrl+Shift+r

return

Just save the file with a “.ahk” extension, and you are good to go. You don’t have to write the exact code. This was just an example. You can use any other key and its assigned symbols.

4. Use AutoHotkey to reassign Function Keys

I don’t know about you but I do not use any functional key other than “F5” to refresh the screen. With the help of the AutoHotKey, you can reassign these function keys to make them useful. You can do dozens of things with them, like launching a folder, launching a website, etc.

Now let’s reassign F4 as a button to Launch the Games folder stored on my laptop.

To do that, you have first to copy the location of that folder. Afterward, write this program.

;Launch games

F4::Run “D:\games”

return

Now your functions are not just there to glorify your keyboard; they have some work as well.

5. Use AutoHotKey to Move a folder Up in file explorer

If you wanted to move up a folder in a file explorer, you could do that in the previous versions of Windows, you just have to click the backspace, and you are good to go. But in the advanced version of windows, backspace is used to move back in history.

But with the help of AutoHotKey, we will give you some nostalgic feeling but differently. We will use your mouse’s middle button as a “move-up” button.

Here is the code that you need to write to do that.

; Click your Mouse’s middle button to move up in file explorer

#IfWinActive, ahk_class CabinetWClass

~MButton::Send !{Up} 

#IfWinActive

return

6. Use AutoHotKey Script to Adjust Volume

It is very annoying to grab your mouse and then go to the bottom of your screen and then adjust the mouse(if your keyboard does not have the mouse adjusting button).

We can use AutoHotKey to create a custom button or ourselves self which will allow us to have a button that can control your mouse’s volume. 

To do that, follow this:-

; Custom volume rocker

+1:: Send {Volume_Up} ;shift + 1

+2:: Send {Volume_Down} ;shift + 2

break::Send {Volume_Mute} ; Break key mutes

return

Note: It is advised to use Numbers + and – for increasing and decreasing the volume since I do not have those buttons that’s why I used them.

7. Use AutoHotKey Script to remap Shift

Well, this might not be of great use to you but let’s give it a shot. So, we are going to swap the shift with capslock. To do that follow the script prescribed below:-

; Shift acts as Capslock

Shift::Capslock

Return

8. Use AutoHotKey to remap Capslock

After swapping Capslock for the shift, we are going to vice-versa. To remap the Capslock button, use the script prescribed below.

; Capslock acts as Shift

Capslock::Shift

Return

As you can there is not much of a difference between the two codes, we have just swapped the entities, and you will be able to use capslock as the shift.

9. Use AutoHotKey to Show or Hide known file extension

So, you have downloaded something, unsure whether it is a pdf or not. If you want to check the extension of that file, you should have an extension checker. We are going to create one with the help of the AutoHotKey.

Type this script and save it with “.ahk” extension.

; WINDOWS KEY + Y TOGGLES FILE EXTENSIONS

#y::

RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt

If HiddenFiles_Status = 1 

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 0

Else 

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 1

WinGetClass, eh_Class,A

If (eh_Class = “#32770” OR A_OSVersion = “WIN_VISTA”)

send, {F5}

Else PostMessage, 0x111, 28931,,, A

Return

Now just use Windows + Y, and you are good to go.

10. Use AutoHotKey to view or hide hidden files Quickly

Hidden files have this nack of becoming translucent, eventually cluttering up your work. If you want to control their visibility, you can do that with the help of this script.

; WINDOWS KEY + H TOGGLES HIDDEN FILES

#h::

RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden

If HiddenFiles_Status = 2 

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1

Else 

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2

WinGetClass, eh_Class,A

If (eh_Class = “#32770” OR A_OSVersion = “WIN_VISTA”)

send, {F5}

Else PostMessage, 0x111, 28931,,, A

Return

Whenever you want to either view or hide a hidden file, press Windows + H

11. Use AutoHotKey to disable Lock Keys

There are three Lock keys, Capslock, scroll lock, and Numbkey. Most of us do not use them. So, why not disable them? To disable Lock Keys, use this script.

; Set Lock keys permanently

SetNumlockState, AlwaysOn

SetCapsLockState, AlwaysOff

SetScrollLockState, AlwaysOff

return

12. Use AutoHotKey Script to empty the Recycle bin

Let’s make clearing junk from the recycle bin as easy as ever for you. To use AutoHotKey for clearing junk files, you can use the following script.

; Empty trash

#Del::FileRecycleEmpty ; win + del

return

Now, whenever you want to clear the recycle bin, just click “Windows + Delete,” and you are ready.

13. Use AutoHotKey to make a duplicate Chromebook search bar

A Chromebook has a search button that allows users to search any highlighted line. If you don’t have a Chromebook and want to use that feature on your keyboard, you can do that via AutoHotKey. 

Here is the command by which you can imitate Chromebook’s search button. 

^+b:

 Send, ^b

 {

Sleep 50

 Run, https://www.google.com/search?q=%clipboard%

 Return

}

Just type this program in your text editor and save it with “.ahk” extension. Now, you just have to click “Ctrl + Shift + b”

14. Use AutoHotKey to keep a Window always on the top

If you are writing on a presentation consisting of 50 slides, and out of nowhere, your boss comes up to you and asks you to replace a few hundred words from your ppt. Now, do not panic; I’ve got you covered; just go open the “find and replace” window and pin it on top and screen and then thank me!

To do that, use the following script.

;select the desired program or window and press Ctrl + Space

^SPACE::

Winset, Alwaysontop, , A

Return

Now just select the desired window and click “Ctrl + Shift” to pin that particular window and you are good to go.

15. Use AutoHotKey to use the Numpad as a mouse

Even though you can use your keyboard as a mouse but it’s too complicated and slow. Therefore it is better to make an AutoHotkey script to convert your Numpad into a mouse. So, let’s do it.

Download the script from here

And you are golden.

16. Use AutoHotKey to suspend AutoHotkey

According to many philosophers, you can not defeat anger with anger, but here you can. I am going to teach you how you can temporarily suspend AutoHotKey via AutoHotKey.

There are moments when you need to stop your AutoHotKey while running a program. So, here is the script that you can use to stop AutoHotkey.

; Suspend AutoHotKey

#CapsLock::Suspend ; Win + CapsLock

return

Now just press Win + Capslock, and you are good to go.

17. Use AutoHotkey Script to Paste into a command line

If you are a constant user of the command prompt, you might have already addressed the issue that the usual “Ctrl + V” does not work in it(before Windows 10). With the help of AutoHotKey, we will make sure that this shortcut works in the command prompt as well.

To do that, use the script written below:-

#IfWinActive ahk_class ConsoleWindowClass

^V::

SendInput {Raw}%clipboard%

return

#IfWinActive

Just save it with “.ahk” extension and you are good to go.

18. Use Autohotkey to do a lot more

Now that you know how it works, you might want to dig a little deeper into the world of Scripts to that, you should check the official AutoHotKey website.

It is not as difficult and complex as other programming languages like python, java, etc. You just need to learn a few of its symbols and shortcuts, and you are good to go.

AutoHotkey script to press key:-

Here is an example of an AutoHotkey script that will press the “A” key every 5 seconds:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the “A” key every 5 seconds
SetTimer, PressA, 5000
return

PressA:
Send {A}
return

To use this script, you will need to have AutoHotkey installed on your computer. To run the script, simply double-click the script file. The “A” key will then be pressed every 5 seconds until you stop the script.

AutoHotkey scripts copy-paste:-

Here is an example of an AutoHotkey script that will copy and paste the text “Hello, world!” every 5 seconds:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Copy and paste the text “Hello, world!” every 5 seconds
SetTimer, PressCopyPaste, 5000
return

PressCopyPaste:
Send ^c
Sleep, 500
Send ^v
return

To use this script, you will need to have AutoHotkey installed on your computer. To run the script, double-click the script file. The text “Hello, world!” will then be copied and pasted every 5 seconds until you stop the script.

AutoHotkey script roblox:-

It is possible to automate operations in Roblox with AutoHotkey. Still, it’s crucial to remember that doing so often violates the rules and puts your account in danger of being banned or otherwise penalized.

Here is an example of an AutoHotkey script that could be used to automate movement in Roblox:-

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the W key every 500 milliseconds to move forward
SetTimer, PressW, 500
return

PressW:
Send {W}
return

This script will cause the “W” key to be pressed every 500 milliseconds, which will cause your character to move forward in the game. To stop the script, right-click the AutoHotkey tray icon and select “Exit.”

AutoHotkey scripts for games:-

Some examples of tasks that could be automated with AutoHotkey in games include:-

  • Moving the mouse to a specific location on the screen
  • Pressing specific keys or combinations of keys repeatedly
  • Clicking the mouse button at specific intervals
  • Sending a text or chat messages in the game

1. Here is an example of an AutoHotkey script that could be used to automate movement in a game that uses the WASD keys for movement:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the W key every 500 milliseconds to move forward
SetTimer, PressW, 500
return

PressW:
Send {W}
return

This script will cause the “W” key to be pressed every 500 milliseconds, which will cause your character to move forward in the game. To stop the script, right-click the AutoHotkey tray icon and select “Exit.”

2. Rapid fire script for a game that uses the left mouse button for shooting:-

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the left mouse button every 100 milliseconds to shoot rapidly
SetTimer, PressLeftMouseButton, 100
return

PressLeftMouseButton:
Send {LButton}
return

3. Script to spam the chat in a game that uses the Enter key to send chat messages:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Send the text “Hello, world!” every 5 seconds
SetTimer, PressEnter, 5000
return

PressEnter:
Send {Enter}
Send Hello, world!{Enter}
return

4. Script to move the mouse to the top-left corner of the screen every 10 seconds:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Move the mouse to the top-left corner of the screen every 10 seconds
SetTimer, MoveMouseToTopLeft, 10000
return

MoveMouseToTopLeft:
MouseMove, 0, 0
return

5. Script to spam the space bar every 500 milliseconds, which could be used to jump repeatedly in a platformer game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the space bar every 500 milliseconds
SetTimer, PressSpaceBar, 500
return

PressSpaceBar:
Send {Space}
return

6. Script to spam the F key every 1 second, which could be used to use a specific ability or item in a game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the F key every 1 second
SetTimer, PressF, 1000
return

PressF:
Send {F}
return

7. Script to automatically pause the game when the user moves the mouse outside the game window and unpause it when the mouse is moved back inside the window:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Pause the game when the mouse is moved outside the window, and unpause it when the mouse is moved back inside
~LButton::
MouseGetPos, x, y
WinGetPos, WinX, WinY, WinW, WinH, A
if (x < WinX or x > WinX + WinW or y < WinY or y > WinY + WinH)
{
Send {Escape}
}
else
{
Send {Escape}
Sleep, 200
Send {Escape}
}
return

8. Script to spam the left mouse button every 50 milliseconds, which could be used to attack rapidly in an action game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the left mouse button every 50 milliseconds
SetTimer, PressLeftMouseButton, 50
return

PressLeftMouseButton:
Send {LButton}
return

9. Script to spam the right mouse button every 1 second, which could be used to use a specific ability or item in a game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the right mouse button every 1 second
SetTimer, PressRightMouseButton, 1000
return

PressRightMouseButton:
Send {RButton}
return

10. Script to move the mouse to a specific location on the screen and click the left mouse button every 5 seconds:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input

11. Script to spam the “E” key every 500 milliseconds, which could be used to interact with objects in a game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the E key every 500 milliseconds
SetTimer, PressE, 500
return

PressE:
Send {E}
return

12. Script to spam the “Q” key every 1 second, which could be used to use a specific ability or item in a game:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Press the Q key every 1 second
SetTimer, PressQ, 1000
return

PressQ:
Send {Q}
return

I will recommend you to watch this video on AutoHotkey; it’s really helpful.

FREE Tool to Automate Your Repetitive and Boring Tasks | AutoHotkey

Is AutoHotKey Safe?

AutoHotKey is another programming language, and like other programming languages(java, C++, Python, etc.), it is vulnerable to Malware. So, some malware is written in script like any other language. Therefore, you need a good anti-virus or anti-malware to protect your script from hackers.

My anti-virus depicts AutoHotKey or its script as malware; what should I do?

Look, an AutoHotkey file is just a file at the end of the day. So, it can be infected by a virus or malware. But most of the time, these notifications are fake; there is a high chance that your antivirus has mistaken it for a virus, which we call a false positive.

If you want to confirm whether your program is infected, you can upload the script on online platforms such as Jotti or Virustotal as they can scan the complete script or program and tell you whether your program is infected.

Afterward, suppose the program is safe and secure. In that case, you should report the error to your Antivirus manufacturer as it will help you in the long run and also help other users and manufacturers.

If you are using compressed compile scripts such as UPX(default for AutoHotKey 1.0 but not 1.1) or MPRESS(optional for Autohotkey 1.1) then the chances of receiving a False Positive is very high. Because the default AutoHotKey installer comes without a compressor, compiled scripts are compressed by default.

Could you get banned for using AutoHotKey scripts?

AutoHotKey will not get you banned because it is just another programming language. But many of us use AHK scripts to make cheat codes of a game and whatnot. 

Here are the two most basic criteria for banning:-

1. The user should have broken the gaming rules. The manufacturer of a particular game has the right to ban any user; he doesn’t need a reason for that.

So, if you are using cheats in the game and the publisher knows about it, there is a high chance that you might end up being banned from that particular game or a particular series of games. For example, if you have used cheats in FIFA 19, you might get banned from all the seasons of FIFA.

2. Anti-Cheat software is one of the biggest enemies of gamers nowadays, as because of the advancement in Artificial Intelligence, developers can easily depict the wrongdoing of their gamers because of anti-cheat software and block them.

So, AHK can not ensure you will not get banned, as it was made for a legitimate purpose. It is up to you how you want to use it.

But if you are using  cheats in offline games or games which do not have good anti-cheat software, then you might get away with AHK

Gmod Bhop script autohotkey

Creating and using scripts for automatic Bunny Hopping (Bhop) in Garry’s Mod (Gmod) can give players an advantage.

Still, it’s important to note that using scripts for automation may be against the game’s terms of service or server rules. I encourage you to check the specific rules of the server you’re playing on before using any scripts.

Assuming you have a basic understanding of AutoHotkey, here’s an example script that you can use as a starting point for a Gmod Bhop script:-

#IfWinActive, Garry’s Mod

$Space::
Loop
{
GetKeyState, state, Space, P
if state = U
break
Send, {Space}
Sleep, 10
}
return

#IfWinActive

This script essentially creates a hotkey for the Spacebar. When the Spacebar is pressed down, it enters a loop that repeatedly sends the Spacebar key press every 10 milliseconds as long as the Spacebar is still held down. The loop breaks when the Spacebar is released.

To use this script:-

  1. Install AutoHotkey from the official website (https://www.autohotkey.com/).
  2. Create a new text file and paste the script into it.
  3. Save the file with a .ahk extension (e.g., “bhop.ahk”).
  4. Double-click the .ahk file to run the script. The AutoHotkey icon should appear in your system tray.
  5. Run Garry’s Mod.
  6. Press and hold the Spacebar to trigger the Bhop script.

Here’s an alternative example of a Gmod Bhop script using AutoHotkey:-

#IfWinActive, Garry’s Mod

$Space::
SetTimer, Bhopping, 10
return

$Space Up::
SetTimer, Bhopping, Off
return

Bhopping:
GetKeyState, state, Space, P
if state = U
return
Send, {Space}
return

#IfWinActive

In this script, the Spacebar is used as the trigger key for the Bhop script. When the Spacebar is pressed down, it starts a timer that repeatedly sends the Spacebar key press every 10 milliseconds until the Spacebar is released (lifted up).

To use this script, follow the steps mentioned in the previous response.

Please remember to respect the rules and regulations of the game and the server you’re playing on.

How to end the AutoHotkey script

To end an AutoHotkey script, you have a couple of options:-

System Tray Icon:-

    • AutoHotkey scripts typically run in the background and display an icon in the system tray (near the clock on the taskbar).
    • Locate the AutoHotkey icon in the system tray (it looks like a green “H”) and right-click on it.
    • From the context menu, select “Exit” or “Exit (Script Name)” to terminate the script.

Task Manager:-

      • If you are unable to find the system tray icon or it is not visible, you can use the Task Manager to end the AutoHotkey process.
      • Press Ctrl+Shift+Esc to open the Task Manager.
      • Switch to the “Processes” or “Details” tab (depending on your version of Windows).
      • Look for the AutoHotkey process in the list (it may be named “AutoHotkey.exe”).
      • Select the process and click on the “End Task” or “End Process” button to terminate it.

AutoHotkey script to hold down mouse button

Here’s an example of an AutoHotkey script that will hold down the left mouse button when a specific hotkey is pressed, and release it when the hotkey is released:-

; Press F1 to start holding down the left mouse button
F1::
Click down left
KeyWait F1
Click up left
Return

In this script, we define the hotkey as F1. You can change it to any key you prefer by replacing F1 with the desired key name.

When you press the hotkey, the script uses the Click down left command to simulate holding down the left mouse button. The KeyWait F1 command pauses the script until the hotkey is released. Once the hotkey is released, the script uses the Click up left command to release the left mouse button.

You can save this script with an .ahk extension (e.g., hold_mouse_button.ahk) and run it using AutoHotkey. Make sure you have AutoHotkey installed on your computer before running the script.

Autohotkey wow script

Here’s a basic example of an AutoHotkey script for automating actions in World of Warcraft (WoW):-

#IfWinActive World of Warcraft ; Only activate the script when WoW is in focus

; Press F1 to simulate a mouse click at the current cursor position
F1::
MouseClick, left
return

; Press F2 to send a predefined text message
F2::
Send, Hello, how are you?
return

; Press F3 to perform a sequence of keystrokes
F3::
Send, /targetenemy
Sleep, 500
Send, /cast Fireball
return

; Press F4 to toggle a rapid fire mode (repeatedly presses left mouse button)
F4::
toggle := !toggle
While toggle
{
Click
Sleep, 50
}
return

#IfWinActive ; Reset the window condition

; Press Esc to exit the script
Esc::ExitApp

This script provides some basic functionality that you can expand upon according to your needs. It includes examples for simulating mouse clicks, sending text messages, executing a sequence of keystrokes, and toggling a rapid-fire mode.

Remember to run the script as administrator for it to work properly with WoW.

Here are a few more examples of AutoHotkey scripts for World of Warcraft:-

Fishing Bot:- This script automates the process of fishing in WoW by repeatedly casting and reeling in the fishing line.

#IfWinActive World of Warcraft

F1::
Send, 1 ; Cast fishing line
Sleep, 2000 ; Wait for the fish to bite
Send, 2 ; Reel in the fish
Sleep, 1000 ; Wait for the fish to be caught
return

Esc::ExitApp

Mount Up:- This script allows you to mount up quickly by pressing a hotkey. It assumes you have a mount spell bound to the number 1 key.

#IfWinActive World of Warcraft

F1::
Send, 1 ; Cast mount spell
Sleep, 2000 ; Wait for the mount to be summoned
return

Esc::ExitApp

Buff Macros:- This script provides macros for quickly casting buffs on yourself or your group members. You can customize the hotkeys and spells according to your preferences.

#IfWinActive World of Warcraft

F1::
Send, /cast [target=player] Power Word: Fortitude ; Cast Fortitude on yourself
return

F2::
Send, /cast [target=party1] Power Word: Shield ; Cast Shield on party member 1
return

F3::
Send, /cast [target=party2] Renew ; Cast Renew on party member 2
return

F4::
Send, /cast [target=party3] Divine Spirit ; Cast Divine Spirit on party member 3
return

F5::
Send, /cast [target=party4] Prayer of Healing ; Cast Prayer of Healing on party member 4
return

Esc::ExitApp

These examples showcase different automation scenarios, such as fishing, mounting up, and casting buffs. You can customize them further or create your own scripts based on your specific needs and in-game activities.

Autohotkey spacebar spam script

Here’s a simple AutoHotkey script that will spam the spacebar when a specific hotkey is pressed:-

; Replace F1 with your desired hotkey
F1::
SetTimer, SpamSpacebar, 10 ; Adjust the delay (in milliseconds) between each spacebar press
return

F1 Up::
SetTimer, SpamSpacebar, Off
return

SpamSpacebar:
SendInput, {Space}
return

To use this script:-

  1. Install AutoHotkey from the official website (https://www.autohotkey.com/).
  2. Create a new text file and save it with a .ahk extension (e.g., spacebar_spam.ahk).
  3. Open the file in a text editor and paste the above script into it.
  4. Save the file and double-click on it to run the script.

Now, when you press the specified hotkey (F1 in this example), it will start spamming the spacebar. To stop the spamming, release the hotkey.

You can customize the hotkey and the delay between each spacebar press by modifying the F1 and 10 values in the script, respectively.

Please note that using scripts to spam inputs in certain scenarios, such as online games or applications with usage restrictions, may violate those platforms’ terms of service or rules. Use such scripts responsibly and in accordance with the applicable rules and regulations.

📗FAQ’s

What language are AutoHotkey scripts written in? 

AutoHotKey Scripts are written in C++ programming language. Any programmer with substantial knowledge of this language can change the plain text in any text editor.

Once done, you cannot use these scripts on the system unless you have a proper tool to run them; hence make sure you have it available to execute the scripts. 

What Is an AHK File?

An AHK file is the one with.AHK extension known to be as the AutoHotKey script. These files are used to automate tasks on the Windows system. The codes written on these scripts are human-readable plain text.

You can download any text editor, such as Notepad, to make any changes to it, and you will need AutoHotkey to run the commands. 

Does AutoHotkey handle Excel? 

There are multiple examples where you can AutoHotKeys scripts to automate workflow on Excel.

For example, you can Detecting Used Range, Manipulate columns, SPSS to Excel graphs in seconds, Automate sales emails, and so much more can be done with this set of tools. You can learn how to do this work with the help of multiple tutorials available on the web. 

Is AutoHotkey easy to learn?

Yes, AutoHotKey is much easier to learn than any other programming language. You can start with AutoHotKey to learn the basics and get your concept clear even before learning C++ and Java.

However, in the end, it all depends on the purpose you are looking to learn the language. While some prefer to go with C++, you can give AutoHotKey a try. 

Which is better, AutoHotkey or AutoIt?

Both have a different set of features and usage. If you are a beginner, you can start with AutoHotKey to learn the basics, and also it is much easier and user-friendly.

You can use it for quick keystrokes. On the other hand, AutoIt is meant for complicated automation and might be a bit difficult to execute. 

Can AutoHotkey record keystrokes?

No, AutoHotKey does not have an in-built feature to record keystrokes. However, you can use third-party tools that might do the job the as you want. 

Are AHK scripts detectable?

The detection of an AHK script can be affected by various variables, such as the activities the script is taking specifically, the security measures in place on the system, and how sensitive the program or system is to unwanted automation.

Antivirus software or other security measures may occasionally detect and block AHK scripts if they are thought to be malicious or hazardous.

In other instances, AHK scripts might be picked up by applications or other systems created to spot and stop unwanted automation.

AHK scripts are not necessarily easy to find or difficult to find, it should be noted. Depending on the precise activities being taken and the security precautions in place on the system, a script may or may not be picked up.

Utilizing different techniques or technologies for task automation can be worthwhile if you are worried that your AHK scripts will be discovered.

Is AHK its own language?

AutoHotkey (AHK) does indeed have its programming language. AHK is a free, open-source scripting language for Windows that can automate processes. Chris Mallett created it in 2003; it has grown to be a well-liked option for automating operations in Windows.

AHK scripts can automate various operations, including simulating keystrokes and mouse movements, interacting with windows and controls, and reading and writing to files.

They are written in plain text and can automate many functions. You can run the AutoHotkey executable, which reads and runs AHK scripts, to execute them.

There are numerous resources for learning the language and creating AHK scripts and a sizable and vibrant user community for AHK.

A forum for discussing AHK and seeking assistance from other users may be found on the official AutoHotkey website (https://www.autohotkey.com), which also offers comprehensive documentation and examples.

Is AutoHotkey a script?

Yes, users can automate operations in Windows using AutoHotkey (AHK), a script-based programming language.

Plain text AHK scripts can be used for various activities, such as imitating keystrokes and mouse movements, interacting with windows and controls, and reading and writing files.

What can I use AutoHotkey for?

AHK scripts can be employed to carry out a variety of operations, such as imitating keystrokes and mouse movements, interacting with windows and controls, and reading and writing to files.

For instance, AutoHotkey is frequently used for:-

Automating repetitive tasks:- Filling out forms and data entry are two examples of time-consuming or manual chores that can be automated using AHK scripts.

Creating custom hotkeys and hotstrings:- To quickly access frequently used features or information, users can construct custom hotkeys and hotstrings using AHK.

Remapping keys and buttons:- Users can modify the keyboard or mouse’s input devices to fit their needs by using AHK scripts to change the functions of specific keys or mouse buttons.

Controlling windows and programs:- Users can automate actions like resizing and moving windows or opening and shutting programs by using AHK scripts to handle windows and programs.

Reading and writing to files:- Users can automate processes like data import and export by reading and writing to files using AHK scripts.

These are just a few jobs that can be carried out automatically utilizing AHK. You can find more information and resources about using AutoHotkey to automate tasks in Windows on the official AutoHotkey website (https://www.autohotkey.com/) and in the AHK documentation (https://www.autohotkey.com/docs/).

Is AutoHotkey malware?

No, AutoHotkey is not malware. With simple scripts and the free, open-source software AutoHotkey, users may automate monotonous chores in Windows. It is not harmful software, and it is widely regarded as safe.

How do I run a script automatically?

There are several ways you can run a script automatically in Windows:-

1. Place a shortcut to the script file in your startup folder after creating the shortcut. By doing this, the script will start up automatically each time you log in to your computer.

2. Employing Task Scheduler, set the script to run. By doing so, you can decide when and how frequently the script should execute.

3. You can tell AutoHotkey to run a script automatically whenever it is launched by using the “#Automatic” directive.

4. The “OnEvent” command in AutoHotkey can be used to define an event and the script that should be executed in response if you have written a script you want to run whenever it happens.

What language is AHK similar to?

AutoHotkey (AHK) is a scripting language based on the C programming language. It is similar to C++ and C# in terms of syntax and structure.

Is using AutoHotkey Bannable?

It is generally not considered bannable to use AutoHotkey in and of itself.

It is crucial to remember that some online platforms can have specific guidelines or rules regarding using automation software like AutoHotkey.

For instance, the rules of some online games might forbid the use of third-party software that offers participants an unfair edge over their rivals.

Can Minecraft detect AutoHotkey?

Minecraft can identify the use of AutoHotkey or other third-party programs that let players automate specific game behaviors.

Is AutoHotkey a security risk?

AutoHotkey is generally considered safe to use and is not considered a security risk.

Is AutoHotkey a keylogger?

AutoHotkey is not a keylogger but can be used to create keyloggers or other programs that track keyboard input.

Can AutoHotkey record keystrokes?

Yes, AutoHotkey can be used to record keystrokes.

With AutoHotkey, you can record keystrokes and communicate the recorded keystrokes to another application or window by using the “GetKeyState” and “Send” functions, respectively.

Additionally, the “SetTitleMatchMode” function and the “Hotkey” command allow you to choose which window you wish to track keystrokes in and create hotkeys that, when pushed, perform certain actions.

AutoHotkey script extension

The scripts are written in the Autohotkey script language and have a file extension. .ahk.

AutoHotKey vs AutoIT:-

Both AutoHotkey and Auto IT are scripting languages. They are very similar to each other. AutoIT was the source from which AutoHotKey was derived. They both are designed to work on Microsoft’s Windows platform.

Comparing both syntaxes shows that AutoIt has a more structured format than AutoHotKey(it depends on your taste).

But in my opinion, AutoIt is a bit more complex than AutoHotkey. AutoHotKey is more powerful than AutoIT as it better manages hotkeys linked to simple actions.

So, now the question is, which one is better for you? The answer depends on your need; if you create a full-fledged automation program, you might want to use AutoIT because it has a better structure.

On the other hand, AutoHotkey is better if you create a few shortcuts for your keyboard because of its simple coding.

Conclusion

In conclusion, AutoHotkey scripts can be incredibly useful for automating tasks, boosting productivity, and improving your overall computer experience.

This powerful scripting language allows you to create custom scripts to streamline your workflow, automate repetitive tasks, and even add new features to your favorite applications.

Whether you’re a programmer looking to simplify your coding process or a power user seeking to optimize your daily routine, AutoHotkey scripts are a valuable tool worth exploring.

So don’t hesitate to dive in, experiment with different scripts, and see how this versatile language can transform how you use your computer.