Xuan-Yuan Sword: The Gate of Firmament

Xuan-Yuan Sword: The Gate of Firmament

Not enough ratings
Automating the Grind Achievements
By 辻斬り
Interested in completing the achievements, but dreading the dozens of hours of tedium? This guide is for you. By following this guide, you will complete these achievements without even noticing (quite literally).
   
Award
Favorite
Favorited
Unfavorite
Introduction


This guide is to help people automate the farm for the achievements Pill Popper and Farmer.

You will need AutoHotkey[www.autohotkey.com] for the script. AutoHotkey is open-source scripting language for Windows for various input-based tasks. You can find more information on them from the link to their official website or just generally the internet.

If you have questions, problems or comments, feel free to put them down below.
Script
By now, you should have loaded AutoHotkey from their website as linked in the introduction-section.

IMPORTANT REMINDER: Never ever run scripts you do not fully understand or trust. AutoHotkey itself is just a scripting language, but the scripts themselves can be malicious. The people - like me - writing the scripts can and will say they are safe, but if you don't understand the script, all you have is their word for it.

Now, with that healthy reminder being said, below is the script, with comments added in to help understand what is going on. Tons of breaking points are added for convenience when stopping the script.

#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. ; absolute screen coords used CoordMode, Mouse, Screen ;--------------------------------------------------------------------------- Reload() { ; saves and reloads the game ;--------------------------------------------------------------------------- SendInput {Esc} ; opens overall menu Sleep 2000 ; ensure menu has loaded in SendInput {Up} ; flips from top the bottom option (System) Sleep 1000 ; ensure change has happened SendInput {Enter} ; opens System menu (the radial) Sleep 2000 ; ensure System menu has loaded SendInput {Enter} ; open saving Sleep 1000 ; wait for the menu to open SendInput {Enter} ; press enter to save game Sleep 1500 ; wait for overwrite confirmation popup SendInput {Enter} ; confirm overwrite and save Sleep 1000 ; wait for menu to update SendInput {Esc} ; close save menu Sleep 1000 ; wait for menu to update SendInput {Down} ; move to load option Sleep 1000 ; wait for menu to update SendInput {Enter} ; open loading Sleep 1000 ; wait for the menu to open SendInput {Enter} ; press enter to load game Sleep 1500 ; wait for confirmation popup SendInput {Enter} ; confirm load Sleep 10000 ; wait for the game to load } ;--------------------------------------------------------------------------- UseItems(x) { ; use health and mana potion on target x ;--------------------------------------------------------------------------- SendInput {e} ; health potion Sleep 500 ; wait for update SendInput {%x%} ; choose target Sleep 4000 ; wait the cooldown SendInput {r} ; mana potion Sleep 500 ; wait for update SendInput {%x%} ; choose target Sleep 4000 ; wait the cooldown } ;--------------------------------------------------------------------------- ItemRotation(x) { ; rotate through party members for x times and do UseItems on each ;--------------------------------------------------------------------------- Loop %x% { UseItems("1") ; Yu UseItems("2") ; Qiao UseItems("3") ; Muyue UseItems("4") ; Fengyu } } ;--------------------------------------------------------------------------- CastSpells(s, x) { ; cast spell specified by parameter for x times ;--------------------------------------------------------------------------- SendInput {Tab Down} ; switch to skill radial Sleep 500 ; wait for the update Loop %x% ; loop for designated amount { SendInput {%s%} ; cast the given skill (aka, Frost Smash) Sleep 3000 ; wait for the cooldown } SendInput {Tab Up} ; after loop, release the radial modifier } ^i:: ;init BreakLoop = 0 Loop, { ; quit script after break is called if (BreakLoop = 1) break Reload() ; save the game and reload ; quit script after break is called if (BreakLoop = 1) break Sleep 5000 ; wait for battle to start ; quit script after break is called if (BreakLoop = 1) break ItemRotation(0) ; use items for desired number of rotations ; quit script after break is called if (BreakLoop = 1) break CastSpells("r", 3) ; use Frost Smash enough times to ensure battle finishes ; quit script after break is called if (BreakLoop = 1) break Sleep 6000 ; ensure post-battle is finished SendInput {r} ; clear the post-end screen if it's still there Loop 4 { Sleep 1000 ; wait for updates SendInput {r} ; clear possible level-up screens (up to 4) } Sleep 2000 ; wait back to map } Exit ^b:: ;break BreakLoop = 1

Having installed AutoHotkey, there should be File Explorer option to new->Create AutoHotkey-script. Can also just create .ahk-file manually. Create a script file (make sure it is completely empty), copy all of the above inside, and save. I would personally recommend using a text editor meant for programming, so you have potential support for syntax highlighting and the like. Makes it easier to understand the script, especially if you need to modify it.

Modifications
  • Adjust sleeps according to the performance of your computer, if necessary
  • Adjust number of times actions are taken (ItemRotation and CastSpells)

Secure your save files

As can be seen from the script, it relies on saving and reloading to respawn the same enemy, meaning it will access your saves. If something unexpected happens (e.g. character dies, you run out of items, you face a rare spawn) it may throw the script off the loop and cause unwanted results.

So, back you saves up beforehand, just in case. Additionally, each time you put it running, give it a new save file to work with.

Trust me, don't be dumb like me and lose 30 hours of accumulated progress because character fell through the ground, probably due to large number of repetitions without interruptions (aka, it probably slowly sinks into the ground each reload or similar).

Usage

Find out the specific spawn locations of enemies by loading the game around enemy routes. Your position is ready when loading a game results in an enemy instantly noticing you and initiating a battle. With that done, command the script.
  • Press ctrl+i to start (i for init)
  • Press ctrl+b to stop (b for break)
Since the script has breaking points sprinkled everywhere, stopping should be relatively smooth despite the length of each full loop.

Choosing enemies
  • Only fight solitary enemies, or unwanted encounters will cause issues.
  • Do not fight in areas which have rare enemies, as they mess the automation (this includes the frogs in Bloodseal Path, as they take ages to kill compared to the rest)
Achievements-specific preferences in their respective sections.

Pill Popper


Pill Popper requires you to use 1000 potions in battle, and AI using them does not count.
Using potions yourself during the game can reduce this grind a lot. The time it takes to complete this is regardless rather lightweight compared to Farmer though.

By the time I finished Jianmu, right before entering point of no return, I had around 500-600 used.
Took about 2-3 hours to go from that to 1000.

Key points

Choose enemies that are strong enough but not too strong.
  • Enemies should be able to do some damage to you
  • Fight should last reasonably long
  • AI should be able to finish the battle on its own, as you will be using potions

Make sure to stock up on enough potions before grinding.
The script obviously uses up a lot of potions, but depending on how tough of a fight you pick to repeat, the AI may also end up using a lot of them, so having surplus is important.

For number of item rotations, pick lowest value that is definitely longer than the length of the fight you're repeating.
Set it to ItemRotation parameter. In most cases this is likely 2 (for 8 characters and 16 items total), in practice resulting in around 8-12 potions used each fight on average.

CastSpells should be removed or commented out with a semicolon for this grind.
Setting it to 0 will result in the TAB inside rotating your map character, which can be fun too (lol). Setting it to above zero is also possible but not really useful. Used character is not guaranteed anyways unless manually commanded, since attempting to use items while stunned will switch characters.

Farmer


This is the main dish out of the two; manual grind from about level 60 takes around 30-40 hours even when using best EXP sources. Big yikes.

Automation is even slower since it cannot adapt the same way. I can't estimate too accurately since the in-game clock stopped working properly along the way, only counting few minutes every night (I'm not kidding). Basing on my Steam hour count, I'd estimate 70-90 hours for me personally but I opted for more stable fights instead of higher EXP sources, so this could likely be cut down a fair bit. Regardless, be prepared for several nights (and perhaps days as well during work or something) to complete this one.

Key points

Choose enemies that give most EXP possible while not causing variations or taking too long to fight. No rare or significantly tankier enemies in the area. My personal setup can be found from a below section.

Make sure to stock up on enough potions before each grind session. No matter how strong you are, you will always use at least a fair bit of mana potions. Tough fights can take up to 200 or more of both potions per hour, while at minimum you will always be using about 100 mana potions per hour.

Set Muyue to be the battle character.
Should be given, but Frost Smash is the key here; good damage, relatively low cooldown. This is what the script will be using.

Set number of spells used to whatever guarantees finishing the fight, even if AI doesn't contribute. This includes taking possible tankier spawns into consideration. Set the value to CastSpells second parameter. For me this value was three, but for tougher fights it could be 5 or even more.

ItemRotation should be removed or commented out with a semicolon for this grind. Unlike Pill Popper, here we never want to use items ourselves, instead focusing on finishing fights as quickly as possible.

My setup

I used Autumn Stone Realm for my grind, specifically the enemy in the first intersection of the area.



It isn't the highest EXP area around (about 2500 per fight, compared to below 5000 the higher sources give), but it has other merits to it:
  • Fights are fast (3 spells tops), so the yield per time isn't too bad in the end
  • There are no rare enemies
  • Tankiest enemy in the area is the map enemy in this specific location, meaning it will always spawn. This makes fights very consistent.
As mentioned, my value for CastSpells parameter was 3.

That's it, good luck!