Ah I see, absolutely no rush here. Take whatever time you need! I will test the update later when I get a bit of free time.
Edit: Got a chance to test the new script, however just as you edited later there is still some funky stuff going on. I attached another video just for reference and to try and make your work easier.
This is on an emulator running 720x1280, my phone also had similar behavior at 1080x1920.
Huh. That's something different. Looking at it. I really need to get this hammered out.
EDIT- Aha, I see now. I tell the script to loop through the region definition function until it finds units that are ready. At the top of that code, I define the individual unit regions, and when I do that, I add an offset to account for the aspect ratio. So, it works great the first time the function is called, (the unit regions are pretty accurate), but the second time it runs through (because no ready units were found the first time), it adds the offset again. Realistically, none of that should be getting done until units are found ready.
Man, I'm getting rusty. Anyhow, I'll get that fixed (easy enough), but I think I'm going to try to define the region by using reference points on the screen; the bottom of the Esper orb, and the top of the Auto button. This way, no matter what resolution you're running at, the smart-battle region will be properly defined. If those images can't be found, I'll fall back on the existing method.
Last Edit: Sept 2, 2017 22:56:43 GMT by noncecents
That method definitely sounds like a good clean way to properly define that region!
However, quick question. If repeat is used as the option, would there even be a need to identify the smart-battle region? Assuming that the smart-battle region doesn't include identifying the Repeat button itself alongside each unit and the associated pieces.
That method definitely sounds like a good clean way to properly define that region!
However, quick question. If repeat is used as the option, would there even be a need to identify the smart-battle region? Assuming that the smart-battle region doesn't include identifying the Repeat button itself alongside each unit and the associated pieces.
The reason is that if you click Repeat and there are units who don't have any action to perform (generally because they haven't performed any action to repeat), the turn does not end. So I need to be able to find those units within the unit region and click on them to make the turn end. Though, come to think of it, I could accomplish the same just by using the Auto button. (EDIT3 - For the time being, I've just changed the script to find and click units on the bottom half of the screen, so this should skip the whole region definition process and improve the speed of Repeat without worrying about Auto staying on and breaking the repeat).
In a similar vein of thought, I've added a second unit check after the first turn of an Arena battle where the enemy strikes first; thus if your team recovers any of your units (particularly if you chose to use the optional set of actions for enemy first strike), then they won't be ignored the next round.
Anyhow, the code should be fixed; I've checked it on the native resolution as well as the other two you've mentioned. I've also set ALL manually-defined regions to use aspect-ratio correction. I think most were moved by Sikat over to his existsL (really neat function which learns region positions to speed up subsequent image checks), but this might correct a few of the other possible problems with images not being found. Or it might break something else.
EDIT - Oh, I'm stupid, it won't since there is a new image file. I'll get a new dropbox link up momentarily; I think I just got Arena auto-battle working.
EDIT 2 - Yep, Arena auto-battle should be all set now too. Added a few new options such as the ability to set the minimum MP. Also, in the custom battles, you should be able to set your team with auto abilities individually now.
EDIT 3 - And updated again. I found some edge cases that got corrected and I improved the consistency of scrolling when searching for skills.
It works awesome! Out of 5 fresh runs, only one went a bit rogue this which is why I did 5 fresh runs as subsequent runs all worked perfectly. By fresh run I mean stopping the script at the end of a single arena fight, then starting it again at the Setup screen.
It is VERY minor and I did not encounter it more than once as I stated. When going first it seems like there is a chance for smart-battle to kick in and click on units (which I'm assuming the script deemed not linked to a repeat action) after the initial repeat button click as soon as you load into the arena match.
Update: I've gotten to run it many more times throughout the day and not once has this happened again. I'll just go ahead and chalk it up to some funky processing on my end.
In other words, it runs perfectly! Thank you so much for the updates.
Edit: One other SUPER minor thing, refilling lapis option seems to click elsewhere when refilling arena orbs so it just loops OK button -> Use Lapis -> and finally, I'm assuming the No button. However this might just be a good thing.
Last Edit: Sept 4, 2017 6:39:45 GMT by variations: further testing done
It works awesome! Out of 5 fresh runs, only one went a bit rogue this which is why I did 5 fresh runs as subsequent runs all worked perfectly. By fresh run I mean stopping the script at the end of a single arena fight, then starting it again at the Setup screen.
It is VERY minor and I did not encounter it more than once as I stated. When going first it seems like there is a chance for smart-battle to kick in and click on units (which I'm assuming the script deemed not linked to a repeat action) after the initial repeat button click as soon as you load into the arena match.
Update: I've gotten to run it many more times throughout the day and not once has this happened again. I'll just go ahead and chalk it up to some funky processing on my end.
In other words, it runs perfectly! Thank you so much for the updates.
Edit: One other SUPER minor thing, refilling lapis option seems to click elsewhere when refilling arena orbs so it just loops OK button -> Use Lapis -> and finally, I'm assuming the No button. However this might just be a good thing.
Hah, I just noticed it lock up on one of my Arena battles. I'm guessing in particular situations the enemy turn goes on long enough that it breaks out of a long wait I have set up to wait for our turn. I mean, King is annoying enough without the asshole breaking the script! I'll look into it.
In fact, since I've moved to GitHub, that link is always the latest version. But, that's not all! The script now automatically downloads updates. You DO have to enable Network Functions in AnkuLua Settings to make it work (in fact, for the script to work at all, but I've reached out to the AnkuLua author about that), but I hope to have it at a point soon where you can simply disable Network Functions to avoid updates. It'll even re-download the image directory if I issue an update which contains new images or skill icons.
Also, the Chain Helper Manual mode is now working. I'm interested to see how well it works in practice.
EDIT - Fixed a couple bugs (including the Arena thing), which was only happening when the enemy struck first. Also fixed another bug which was affecting timed skill casts.
Tested Chain Helper Manual mode in 1080 x 1920 and it's working well. I'm hopeful for other resolutions. Also, I added error-handling for Network Functions being disabled in AnkuLua. Now, you can simply disable Network Functions in AnkuLua Settings to prevent auto-updates to FFBEAutoZ, and enable it when you would like to have them.
Speaking of which, with Network Functions enabled, you can download those bugfixes within seconds right now.
On maranda coast run in repeat mode; my caracter doesnt attack the boss and stuck.
Btw chain work great.
I'll look into Maranda; I think I actually reported that same bug to Sikat or Tinotk a long time ago, before I was involved in working on this project! I don't remember if it ever got fixed or if maybe I'd just implemented a workaround that never got added to the branch I'm working on now.
Chaining is super easy to do when Chain Helper is used in conjunction with this tool right now: ffbe-chain.com/chain
It'll find the best chain combo and then you can just input the frames as they're listed.
I am finding however that I cannot get my Chain Helper to hit those max theoretical chain counts though; not sure whether to blame it on my emulator or my code though. A lot of those max theoretical combos require perfectly-timed spark chains, and I'm thinking that the couple of milliseconds that my script spends pressing the buttons is still too long to make it work absolutely perfectly. Either that or the emulator registers the clicks just slightly too slow.
I'm glad to hear it's working well, but I'll see if there's anything I can do to account for it. Might just have to call it "good enough".
I have come across a few bugs that I need to fix. Here's a current running list of known issues:
Check Block icon; seems to be having problems matching Improvement: try press Repeat again after first Repeat and IsReady = True. Only THEN click. Possible the Repeat brought a unit back to Ready. Issues with finding correct MP in some cases (Example DV's "Sword 27" Dual Slash is often read as 7 MP, not 27). Changing Esper seems to fix, so issue is likely to do with region encompassing the MP value properly. Possible scroll bug; sometimes scrolling while looking for skills pops back a small amount. May be related to the scroll moving out of the sb_reg and letting go; but intermittent so also possibly related to emulator. Seeing it less when Nox is set to 4 CPUs. Possible Arena detect High Ratio issue (sometimes?). Maybe a race condition here. Check for condition where all skills on screen are useable during smartbattle_choose(). Script will lock up if all spells displayed have "Insufficient Mana". (New) Units stuck at Exploration boss battles when on Repeat; don't engage boss. (New) Issue with Lapis refresh of orbs looping through buttons My goal is to implement support for using Limit Burst when ready, DualCast if it can be found, immediate casts (for things like an Esuna that we want to do to bring a unit back so we can use its abilities), and targeted casts. This will take a bit of work, and given how busy I've been recently, I haven't been able to get to it. I'll let you all know if/when I've found time to get it implemented. Eventually when it's all working well, you should just see them show up as options
Last Edit: Sept 29, 2017 4:35:40 GMT by noncecents
apokalipse , I isolated the issue with Maranda Coast. I'm embarrassed I spent far more time looking at the code than I should have; the problem was simply that Gumi had changed the text that appears before you fight the boss!
Anyhow, I was planning on doing a few quick tests and then pushing the change out before maintenance tonight, but I miscalculated when it was (it was earlier than usual) and so I didn't get a chance to run through the typical gamut of tests beforehand. I wouldn't feel right pushing something out without being certain that it's going to work alright and then going to bed for 8 hours.
So I'll get it pushed out tomorrow at some point. This should be the last round of bug-fixing type stuff before I get serious about implementing use-LB-when-ready and Dualcast for my next major build.
Thanks for being patient!
Last Edit: Sept 29, 2017 4:32:35 GMT by noncecents
No problem, i checked ur github all time and we have time.
Can i try to add one idea: it will be possible to add a custom setting (like custom exploration) to save the custom skill selection? Because some time i change my character.
Hey noncecents , thanks for the update. I have two issues that I have encountered so far.
1. Using repeat for the arena almost never hits repeat when it is enabled the first time, it hits it immediately as soon as the button is visible (while disabled) and then proceeds to just wait for the next time.
2. This second one is not tied to just repeat (I'm assuming here, from our previous conversations, it is just the fallback happening), but with dungeon farm and any kind of continuous auto battle option enabled in settings - this can be either just "all mission" or "all quest." What will happen with repeat, since there will never be an action saved for each new friend unit you bring in, it will hit auto to get them to attack. As previously stated if you have either continuous auto battle option enabled in settings it'll just keep auto on overriding the repeat saved actions that you set up. For now I disabled it and auto does not stick through allowing repeat to work as it should. Update: Even with continuous auto battle off there is a slight chance of auto overriding repeat behavior.
If you want a recording of either let me know, likewise if I was not fully clear in explaining certain things let me know as well I'll be more than happy to help!
Last Edit: Dec 16, 2017 23:43:40 GMT by variations
Thanks for the reports, I'll look into it. I didn't test Repeat in Arena as I should have, so I wasn't aware of that behavior.
My intent for this script was for it to run with Continuous Auto Battle disabled, but I may change the behavior so that's not necessary.
I just ran into the Auto button getting pushed again and breaking repeat. I'm going to have to fix that, but it probably won't be tonight (sorry!). Hopefully by tomorrow.
I originally just told it to click the Friend unit but for some reason it didn't work as intended. The Auto press was a lazy way of fixing the problem and I'm paying for it now with these new issues. I'm going to see if I can come up with a reliable solution.
EDIT - Couldn't sleep, so it all got fixed instead. Let me know if there are any problems.
Last Edit: Dec 18, 2017 13:57:10 GMT by noncecents
Recently I have been farming explorations, Fire Shrine in specific, and the script will get stuck if there is a connection error popup right after refilling with lapis when selecting the exploration.
No rush, feel free to get to it whenever you get a chance. I'll see about putting in a quick band aid for myself and then update when you push a fix.
Update1: It seems to only happen sometimes, I'll see if I can better assess what causes it. It'll be a bit hard since I usually leave it running on a VM but I'll see what I can do. Update2: This occurs with regular dungeon farming as well, twice now I've had to hit OK when farming. It'll just get stuck on the connection error pop up after refilling with lapis.