Yeah but how to do you get that into an auto macro?
The macro that was linked yesterday has a version with lapis refills built into it already. Not sure how to truly set it up from scratch nor would I ever care enough to try lol.
I can briefly describe how it works. Basically the macro cycles indefinitely through a series of strategic clicks. So imagine looking at all the screens that you will ever encounter on your macro run. Mostly this means the combat screen, the friend select screen, the manage party screen where you click depart, and the mission select screen. But there are others. For example, if the game crashes you'll be back at Android "desktop". If you need to refresh lapis you'll have the lapis purchase screen up. If your items fill up you might end up on the items screen. If you don't have a full friends list, you might get a request at the end of combat to accept or decline a friend request.
So now imagine, for each of those scenarios (and I may have even missed some), where you need to click to do the next action. On the combat screen you need to click your attacking unit. On the lapis refresh screen you need to click "Yes". On the mission select screen you need to choose Earth Shrine - Entrance. etc etc.
Imagine you have a sheet of paper that is the size of your game window, and for each of these scenarios, you draw the region you need to click. For the combat screen you would draw 2 rectangles, for example. One for each of 2 characters. For the lapis refresh screen, you would draw a rectangle only for the yes button. For the manage party screen you want to click the depart button. All of this is on one sheet of paper so the rectangles are overlapping.
Now imagine each of those screens and look at all the places that you
must not click. On the manage party screen, for example, you can't click on any of your party members. You can't click on your esper's square or your friend's square. Doing any of those would break the macro because it would take you to a screen that the macro doesn't know about. On the combat screen you don't want it clicking the menu or options button. You don't want it single targeting enemies. Etc.
So for each of those places where you must never click, erase that entire region from your piece of paper.
What you're left with represents all the places where clicks need to happen. But to make the macro fast, you want as few clicks as possible. If two regions overlap (for example choosing the mission from the mission select screen and clicking Yes on the refill lapis window), you can do it with 1 click. So from here, you just have to look at what's left and find the minimum number of clicks and location of said clicks to cover all regions.
After that, you make the macro run through these clicks in a blazing fast loop.
What you're left with is a macro that is resumable (i.e. you can stop it anywhere and resume it anywhere), and will go as fast as your machine goes. If it crashes during combat, it will start up the app again (because one of the clicks it cycles through is right on top of the app's icon on the desktop) and put you back into the middle of the battle you crashed in. And it never clicks on anything that breaks the macro.