FFXIV Auto Crafter
2023
I've been an on and off player of FFXIV for years, and there was always one system my friends wanted me to get into: raiding.
And there was always one system that I always leapt to instead: crafting.
Twice a week, my friends would go raiding, and there would always be last minute chatter in our discord as they were getting ready to go. One of their biggest obstacles was finding enough potions and meals for their raiding consumables. They would either have to buy these items from the marketboard, at a very inflated price, or frantically craft what they needed, which they barely had time for.
So I stepped in and began crafting the consumables for them. Unfortunately, they required nearly 400 items a week, and even at my fastest, it still took me about 1 minute to craft the item. And 3 hours and 40 minutes a week of crafting was 3 hours and 40 minutes less dungeon running and story progression for me.
I needed to speed this up.
FFXIV supports some automation with macros which are basically a tool to combine multiple actions. For most late-game crafters, using these is non-negotiable, and I the following two were mine for both potions and dishes.
Macro 1
/ac "Muscle Memory" <wait.3>
/ac "Manipulation" <wait.2>
/ac "Veneration" <wait.2>
/ac "Waste Not II" <wait.2>
/ac "Groundwork" <wait.3>
/ac "Groundwork" <wait.3>
/ac "Final Appraisal" <wait.3>
/ac "Groundwork" <wait.3>
/ac "Innovation" <wait.2>
/ac "Preparatory Touch" <wait.3>
/ac "Preparatory Touch" <wait.3>
/ac "Preparatory Touch" <wait.3>
/ac "Preparatory Touch" <wait.3>
Macro 2
/ac Innovation <wait.2>
/ac "Prudent Touch" <wait.3>
/ac "Prudent Touch" <wait.3>
/ac "Prudent Touch" <wait.3>
/ac "Trained Finesse" <wait.3>
/ac "Basic Synthesis"
Here's an example of the macros in action.
Instead of clicking 19 buttons across 47 seconds, I reduced it to 2 clicks across 47 seconds. While this was a game-changer because it freed me up to chat with my friends in between each macro press, I still had to actively monitor the game for nearly 4 hours each week.
With each subsequent button press, I felt like this could be further automated, even with something as simple as an auto-clicker. So I turned to Python and the PyAutoGUI library.
I wanted this auto crafter to craft as many potions as I had ingredients for without me ever having to touch my mouse or keyboard. PyAutoGUI works by clicking on a specific x and y coordinate on your screen, and so my first order of action was to gather up all of the buttons I needed to click, and then figure out their x and y coord on my screen.
Fortunately, Mac's screenshot tool not only displays the pixel coordinate of the cursor on the screen, but also the dimensions of a selection.
Once I had all of the coordinates figured out, I wrote a first draft that accepted a command line input for the amount of crafting rotations I wanted to run. In my initial testing, I discovered that I needed to add a second click for each step because every now and then the game would fail to register the input.
while (craftingRotationsDesired != 0):
print("Starting" craftingRotationsDesired "rotations")
# synthesis
pyautogui.click(1059, 758)
pyautogui.click(1059, 758)
# wait for animation to finish
time.sleep(2)
# Macro 1 (30 sec for first macro to run + 3 sec ending animation)
pyautogui.click(900, 685)
pyautogui.click(900, 685)
time.sleep(33)
# Macro 2 (20 sec for second macro to run + 2 sec ending animation)
pyautogui.click(981, 685)
pyautogui.click(981, 685)
time.sleep(22)
print("Rotation finished!")
craftingRotationsDesired -=1
The duplication wasn't ideal, and so I abstracted it into a reusable function in my second draft.
def clickFunction(xpos, ypos, count, sleepTime):
for i in range(count):
pyautogui.click(xpos, ypos, count)
time.sleep(sleepTime)
Before finally putting it altogether and letting it run! With this auto crafter, I could now craft overnight, when I was out of the house, or even when I was at home doing something else like cooking. My friends could have as many potions as they needed without any of us having to sacrifice hours and hours of manual labor each week, leaving us more time to run dungeons, progress the story, and raid (for them, not for me still).
Unfortunately, the script could only run for 200 rotations (approximately 3 hours and 20 minutes), because of the in-game max durability of crafting gear. Each crafting rotation consumed ~1% of the 199% durability, and while I could have automated the repair with PyAutoGUI I would have needed to be max level in every single one of my crafting classes in order to successfully repair my gear. Because I had zero interest in the blacksmithing and armorer classes, 2 of the 5 classes needed for repairs, after the rotations finished I had to talk to some of my friends to get them to fix my gear for me. Which they were more than happy to help with.
In the future though, I'd love to extend the script to support this flow, but first I'd need to put in dozens and dozens of hours into leveling...