How to Code Your Own Macros | AHK

  Рет қаралды 34,353

Adam Schadow

Adam Schadow

3 жыл бұрын

In this video I show you how you can use Autohotkey programming language to create your own scripts. These macro scripts are ideal to avoid hours of training to press a certain button combination or automate a tedious process.
This is the site where you can download AHK:
www.autohotkey.com/
Here is the list of all special keys in AHK: www.autohotkey.com/docs/KeyLi...
My discord: / discord

Пікірлер: 71
@AdamSchadow
@AdamSchadow 3 жыл бұрын
This is just a very simple starting guide. There is a lot more that you can do with AHK and some of it I will cover in future videos.
@damians7030
@damians7030 Жыл бұрын
my left ear enjoyed this
@FanMan_jpg
@FanMan_jpg Жыл бұрын
my left ear really enyojed this video
@user-ez3og4vw8m
@user-ez3og4vw8m 2 ай бұрын
my left ear is hearing really well what your saying you know
@jephq161
@jephq161 Жыл бұрын
tysm i kinda just reverse engineered what you did to use it for something else, but alot of other guides were not using like the send{} thing so it didnt work for me, still helping a year later!
@AdamSchadow
@AdamSchadow Жыл бұрын
Yeah its really sad that there are not many guides for ahk.
@brokovnik
@brokovnik Жыл бұрын
my right ear shriveled up
@someguynamedadam777
@someguynamedadam777 7 ай бұрын
This video was very helpful, Thanks!
@elperrete69
@elperrete69 3 күн бұрын
awesome tutorial man thx
@zoteiscool2134
@zoteiscool2134 2 жыл бұрын
This guide is very informative. Also, I saw you click File->Save, but there's a hotkey for that, you can just click ctrl+s which is a super useful thing when it comes to coding.
@AdamSchadow
@AdamSchadow 2 жыл бұрын
ofc I know about ctrl+s but I rather dont use that when making a video.
@zBPC
@zBPC 2 жыл бұрын
Easier than i thought, subbed
@TheDevourerOfGods
@TheDevourerOfGods Жыл бұрын
So I got a very simple script working, but after a minute of running it, it was gone. I checked in my folder and it just deleted itself. EDIT: It was my damn Antivirus automatically deleting it. I had to change some settings so it wouldn't do that.
@urnotagamer1
@urnotagamer1 7 ай бұрын
How do I create a macro that counts up from 1 (X+1)
@c00l3r4
@c00l3r4 2 жыл бұрын
alternatively, you can use while loops
@GhostGaming-123-u6w
@GhostGaming-123-u6w Жыл бұрын
Thanks because i was recently playing lifeboat network prisons someone killed me and i lost all my good stuff, so now im lookin to bring terror to lifeboat.
@areyouseriousholmes
@areyouseriousholmes Жыл бұрын
is there a way to not type in every key click?
@skysvi
@skysvi Жыл бұрын
how can i turn off?
@DellesTheFirst
@DellesTheFirst Ай бұрын
So is it bad my left headphone stopped working?
@thefrieber_362
@thefrieber_362 2 жыл бұрын
it's too hard, or impossible to make an efficient keyboard listener in C# Win forms, i'll give ahk a try
@1Conan348
@1Conan348 Жыл бұрын
Hey I have a question. How can I make it that my mouse goes from the Chat in the left corner to the middle of the screen without moving it?
@AdamSchadow
@AdamSchadow Жыл бұрын
You can use MouseMove command.
@MinymanPlays
@MinymanPlays 3 ай бұрын
my left ear thought this video make my brain feel weird help
@AdamSchadow
@AdamSchadow 3 ай бұрын
Go watch the newer ahk2 videos where I also improved the audio.
@typischtraum7792
@typischtraum7792 Жыл бұрын
I tried to Macro something with Mousemovement involed in Minecraft,but when i try it out the sensitivity goes Nuts on my Homescreen the macro works completly fine but in Minecraft it just does not work any ideas why?
@AdamSchadow
@AdamSchadow Жыл бұрын
The thing is converting the movement of a cursor in a 2d space to actual rotation of a character in 3d is not very simple so I would recommend you to at first try to just do it inside the minecraft menus like making a autocrafing scrip. All u need to do is give it the command to click at the right position and make sure the clicks are at least 50miliseconds long.
@typischtraum7792
@typischtraum7792 Жыл бұрын
@@AdamSchadow ty
@solan2915
@solan2915 Жыл бұрын
i want to make a script for when i press "c" it will send it to "2" then back to "c" but i think this creates an infinite loop or something so can i make this work?
@AdamSchadow
@AdamSchadow Жыл бұрын
If you put $ infront of a hotkey like you see me do in some of my scripts it will not be able to trigger itself.
@solan2915
@solan2915 Жыл бұрын
@@AdamSchadow tsym for still replying to comments
@solan2915
@solan2915 Жыл бұрын
@@AdamSchadow hey also how do you make it so you dont right click? for some reason my script makes me right click
@sakkoloppi6311
@sakkoloppi6311 Жыл бұрын
Can i make it HOLD DOWN 2 buttons at a time? If yes could you tell me how 😅
@AdamSchadow
@AdamSchadow Жыл бұрын
Yes ofc lets say you want to hold down a and b fo 3 seconds when you press c just do: c:: Send {a down} Send {b down} Sleep 3000 Send {a up} Send {b up}
@sakkoloppi6311
@sakkoloppi6311 Жыл бұрын
@@AdamSchadow Ahh thank you!! Im no good at coding but im trying to make my self a simple macro. ❤
@yohailev2846
@yohailev2846 7 ай бұрын
hey man i have a problem with my code #Persistent SetTimer, CheckColor, 100 ; Set the timer to check every 100 milliseconds CheckColor: If GetKeyState("z", "P") ; Check if the 'z' key is pressed { ; Get the color of the middle of the screen PixelGetColor, color, % A_ScreenWidth // 2, % A_ScreenHeight // 2 ; Check if the color is not orange (adjust RGB values as needed) if !(color = 0xFFA500) { Click ; Press the left mouse button } } return im trying so when i press and hold the key z the script will look for the color orange if theres is the color orange on the middle of my screen nothing happens it keeps on searching until there isnt the color orange on my screen then it presses left click now my code just keeps on pressing left click repetedly il be glad if you could help
@AdamSchadow
@AdamSchadow 7 ай бұрын
There are multiple things wrong pls contact me on discord since this is not the best place to explain it all. Here is some pseudo code of how it should probably look like: maxthreads per hotkey 2 ; this prevents you from launching several instances for the one hotkey z:: PixelGetColor, color, % A_ScreenWidth // 2, % A_ScreenHeight // 2 if (color = 0xFFA500){ ; checks if the middle is orange while (color = 0xFFA500){ PixelGetColor, color, % A_ScreenWidth // 2, % A_ScreenHeight // 2 } ; this just does nothing when the middle is orange click } return
@whatsuuup1195
@whatsuuup1195 Жыл бұрын
How do i get it to repeat it?
@AdamSchadow
@AdamSchadow Жыл бұрын
Use a loop.
@gaming_primate
@gaming_primate Жыл бұрын
can anyone pls help me with a macro for prison mining that automatically aims downwards whenever the mine resets?
@AdamSchadow
@AdamSchadow Жыл бұрын
Can you be a bit more precise what the macro is supposed to do?
@gaming_primate
@gaming_primate Жыл бұрын
@@AdamSchadow hello sir!! i m a minecraft op prison player, what i mean by mine resets is that the player looks straight in front everytime the mine reloads so constantly dragging the mouse down is painful so can u help me with a script that automatically makes the player look down?
@AdamSchadow
@AdamSchadow Жыл бұрын
@@gaming_primate you can use the mouse move command www.autohotkey.com/docs/v1/lib/MouseMove.htm
@I_don_t_kn0w
@I_don_t_kn0w 8 ай бұрын
I wanna create a macro that if i press mouse5 it "send" 2 times "a", but how do i write "mouse5" in that software?
@AdamSchadow
@AdamSchadow 8 ай бұрын
XButton2 www.autohotkey.com/docs/v1/KeyList.htm
@I_don_t_kn0w
@I_don_t_kn0w 8 ай бұрын
@AdamSchadow i actually wanted to use if and else, but it says that my else has no matching if
@AdamSchadow
@AdamSchadow 8 ай бұрын
@@I_don_t_kn0w I recommend you to ask google www.autohotkey.com/docs/v1/lib/IfExpression.htm
@I_don_t_kn0w
@I_don_t_kn0w 8 ай бұрын
@@AdamSchadow thanks
@xjxux
@xjxux Жыл бұрын
cool
@skysvi
@skysvi Жыл бұрын
how can i bind a key?
@100Bucks
@100Bucks Жыл бұрын
Ahk is simple. if you wanted a to be be. You would write this in the code. a::b That simple, or if you wanted to merge keyboard keys together. Like control+alt+delete using the A key. a:: sendinput {control down} sendinput {alt down sendinput {delete} sendinput {control up} sendinput {alt up} return. That's how you merge keys together, but there's a problem with this. Each hotkey you use, you lose it for normal using. Example, a is being used to run the script. You can avoid this and not lose any keys with a different method. You can write a hold button script. I'll use shift as a hold button and a has a trigger button. #if getkeystate ("shift", "P") a:: sendinput {control down} sendinput {alt down} sendinput {delete} sendinput {control up} sendinput {alt up} return Only holding shift down and pressing a will trigger the script. Last method is using one single key to use multiple scripts with a Morse code method. Meaning if you press that key a certain amount of times, it triggers the script. I'll make a 2 to script example only using A key. Pressing a twice will trigger hi. Pressing a three times will trigger bye. Please forgive me if I write the script wrong and it doesn't work. This script is very hard to remember. a:: if(Mario > 0) { Mario += 1 } else { Mario := 1 } SetTimer, MarioBros, 400 return MarioBros: if(Mario = 2) { send hi } if(Mario = 3) { send bye } SetTimer, MarioBros, off Mario := 0 return Press a twice will trigger by, pressing a 3 times will trigger bye. This script is perfect for a USB foot pedal because you can put many script within this one key usage. Or if you had a 3 key or 2 key mini keyboard. This script I love the best because the amount of task is unlimited with 1 keyboard. You cannot duplicate this script and assigned to a different key. You would have to write a completely different script if you wanted another hotkey for multi purposes. To easily make a new hotkey. Copy and paste the script. Replace Mario with a different word. Replace MarioBros with a different word. Then assign your new hotkey at the top. Again, please forgive me if this script doesn't work. I always get an error on else. Best script ever.
@KillaRai9
@KillaRai9 Жыл бұрын
I can't get the script to run
@AdamSchadow
@AdamSchadow Жыл бұрын
You need to give me more information but for now you can read this: www.autohotkey.com/docs/v1/Program.htm
@lizmono754
@lizmono754 2 жыл бұрын
how can i loop
@AdamSchadow
@AdamSchadow 2 жыл бұрын
www.autohotkey.com/docs/commands/While.htm
@ChaoticNightmares1
@ChaoticNightmares1 3 ай бұрын
left only mic ?? whyyyyy
@AdamSchadow
@AdamSchadow 2 ай бұрын
Idk why but obs decided to screw me over but there is a newer guide I made for ahk v2.
@KamilKamil-qx8ny
@KamilKamil-qx8ny Жыл бұрын
and how to make it repeat over and over again?
@AdamSchadow
@AdamSchadow Жыл бұрын
Watch the advanced guide but in short you will need a while loop.
@KamilKamil-qx8ny
@KamilKamil-qx8ny Жыл бұрын
@@AdamSchadow And what is the command for pausing and disengaging it
@AdamSchadow
@AdamSchadow Жыл бұрын
@@KamilKamil-qx8ny when the condition in the loop turns false it stops or you can use break inside the loop to stop it.
@KamilKamil-qx8ny
@KamilKamil-qx8ny Жыл бұрын
@@AdamSchadow I know it, but when I give it a pause, I can't turn it on again and nwm how to do it
@AdamSchadow
@AdamSchadow Жыл бұрын
@@KamilKamil-qx8ny you can use keywait to wait for the user to press something.
@justragnar8667
@justragnar8667 Жыл бұрын
people who are deaf on their left ear aint gonna hear this, maybe fix that next vid
@AdamSchadow
@AdamSchadow Жыл бұрын
I already fixed it turns out sometimes obs defaults to recording my microphone in stereo for no reason without any warning.
@nability
@nability 7 күн бұрын
My right ear is lonely :(
@AdamSchadow
@AdamSchadow 6 күн бұрын
I'm sorry but I will make some newer guides since ahk2 exists now.
@XDRex64
@XDRex64 8 ай бұрын
GET OUT OF MY LEFT EAR AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@AdamSchadow
@AdamSchadow 8 ай бұрын
Sry for that you can go blame obs devs for their shitty default settings.
@LuminosityZero
@LuminosityZero 9 ай бұрын
my left ear enjoyed this
Can AI Code Minecraft? Watch ChatGPT Try
8:06
BadGameDev
Рет қаралды 1,2 МЛН
Macro Tutorial for Minecraft
8:07
Cloud Wolf
Рет қаралды 22 М.
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 17 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 41 МЛН
Can your Keyboard do THIS?? - Make ANY key a MACRO!
12:54
Linus Tech Tips
Рет қаралды 1,9 МЛН
MAKE AIMBOT IN 10 MINUTES
12:34
cazz
Рет қаралды 875 М.
DIY 87-Key Macro Keyboard - Because he has too many keyboard shortcuts!
10:41
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,4 МЛН
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 710 М.
How To Make a Custom Minecraft Skin For Java and Bedrock
8:01
Shulkercraft
Рет қаралды 1,7 МЛН
AHK is easy to use: AutoHotKey file tutorial
7:36
iwanPlays
Рет қаралды 380 М.
The Many Uses of AutoHotKey
13:42
SoCitrusing
Рет қаралды 83 М.
I tried Discord Bot Makers...
14:19
FaceDev
Рет қаралды 113 М.
low battery 🪫
0:10
dednahype
Рет қаралды 1,8 МЛН
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 331 М.
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,8 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 8 МЛН