Getting Started
When i started making macros roughly 2 years ago (around january of 2024) i had no idea how to code, where to
start, or what to do. I spent many days trying to figure out how to make a macro that would work as intended.
I tried many different libraries and methods, but nothing worked. I was frustrated and confused, and I didn't
know where to turn for help. But I didn't give up. I kept searching, experimenting, and learning. And After
tons of trial and error, I finally stumbled on what actually worked. Now, I'm here to share what I've learned
with you.
Telling someone "don't give up" is like saying "just be happy" it's well meaning but empty. What I really mean
is that giving up isn't failure. Pausing, adapting, or even walking away temporarily can be the smartest move
you could make. It's about finding what works for you, not just pushing through blindly. Look, never quitting
doesn't mean never taking a break, i take many breaks when making macros but sometimes you gotta walk away and
take a break to rethink everything. Sometimes the best breakthroughs come when you least expect them. For
example when I was trying to figure out how to make the mouse movement get registered in roblox games so that
the macro would work as intended, I spent many days trying different libraries such as pydirectinput,
pyautogui, win32api and methods. I was frustrated and confused since none of them worked, but I didn't give
up. I kept searching, experimenting, and learning. And eventually, I found that the solution was right in
front of me... maybe not exactly because if was hidden in a folder named "AutoHotkey" that I had installed a
long time ago. I found that AHK actually made Roblox respond to the mouse inputs, and I was able to create a
macro that worked as intended. Turns out being too stubborn to quit actually works sometimes.
A different story is the on/off switch in the macros. The functionality of just pressing f2 for it to pause
and f3 to completely stop the macro was something I had to figure out on my own and while it seems simple now,
it took me a while to figure out. The main issues i was facing was how to make it ALWAYS work no matter when
you pressed f2 to pause it and then f2 again to resume it. I eventually realized the fix was really obvious,
just yeet the function into its own thread and then use a global variable to check if the macro was paused or
not. This way, no matter when you pressed f2, it would always work as intended.
Tool Recommendations
First, let's define what a tool is... a tool could be anything that helps you make macros, whether it's a
program like Visual Studio Code or a library like pydirectinput or AI; it all comes down to your
preferences. My journey started with Visual Studio Code - a great app to start coding. It's very
user-friendly and has many features that make coding easier, like extensions, themes, a built-in terminal,
and many useful yet easy-to-remember shortcuts like Alt + arrow up/down to move lines up and down and Ctrl +
/ to comment/uncomment lines (very useful when debugging but you don't want to remove your code logic). I
highly recommend using it for your first macros.
Another tool I'd recommend is knowledge. Knowledge is the most important tool you can have when making
macros. Whether it's learning how to use a library, understanding how to code, or just knowing how to
troubleshoot issues, knowledge is key. I recommend reading documentation, watching tutorials, and asking for
help when you need it. The more you know, the easier it will be to make macros that work as intended.
The last tool I'd recommend is AI. I myself have started my coding journey with AI, but instead of just
asking it to write code for me, I analyzed the code it gave me, and if I didn't understand something, I
would ask it to explain why the code should be structured that way and not a different way. This way, I was
able to learn how to code while also getting help with my macros. A great way to learn how to code is to get
AI suggestions on how to fix something in your code. For example, if you have a problem with your code but
have some idea what could cause it but don't know how to code it in, asking AI for help isn't something you
should be ashamed of; it's actually a great way to learn and improve your coding skills if you do it the
right way and not just copy-paste whatever AI gives you and paste error messages back to AI for it to figure
it all out for you.
Step-by-Step Setup
First you need to install the tools that you will need to make the macros. The first tool you need is
Python, which you can download from the official website. Once you have Python installed, you can install
the libraries that you will need to make the macros. The libraries that I recommend are "pydirectinput" for
keystrokes, "pyautogui" for color detection, and "time" for delay. You can install these libraries using
pip, which is a package manager for Python.
To install a library, open a terminal and type pip install library_name. For example, to install
pydirectinput, type pip install pydirectinput, and after you've done that, you can start coding your first
macro. To use the library you just installed, you need to import it into your code. You can do this by
adding the following line at the top of your code: import pydirectinput. This will allow you to use the
functions and methods that are available in the library.
Once you have imported the library, you can start using it to create your macros. For example, you can use
the pydirectinput.moveTo() function to move the mouse to a specific position on the screen, or you can use
the pydirectinput.click() function to click the mouse at a specific position. You can also use the
pydirectinput.typewrite() function to type text into a text field or input box, and there you go, this could
be your very first macro that would click on specific spots on the screen and type some text. But of course,
this is just the beginning. You need many other libraries to make your macros work as intended. I myself use
around 10 different libraries to make my macros possible, but you don't need to use all of them. You can
start with the ones that you need for your first macro and then add more as you go along.
The most important thing is to keep learning and experimenting with different libraries until you find what
works best for you; then you can create a template and start creating all future macros based on that
template (I do that, and as you can see, all of my macros have the same code at the top and bottom).
Yet we can't forget about the code editing software itself; editing in Notepad would definitely be a pain,
so I recommend using Visual Studio Code, but you can use any code editor that you like; it's only a
suggestion. Visual Studio Code is a great code editor that has many features that make coding easier, such
as syntax highlighting, code completion, and debugging tools. It also has many extensions that you can
install to add more features and functionality to the editor. Once you have installed Visual Studio Code,
you can open your Python files and start coding your macros. You can also use the built-in terminal to run
your macros and see the output in the editor.