steve1316 / granblue-automation-android

Educational application written in Kotlin aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using MediaProjection, AccessibilityService, and OpenCV.
63 stars 11 forks source link

ENOENT: Open Failed when trying to select Combat Script #26

Closed PortablePanda closed 2 years ago

PortablePanda commented 2 years ago

Hello again, when I try to open a combat script, I get the following error message, even after saving in multiple locations with different file names. Is root required to use combat scripts?

image

image

image

steve1316 commented 2 years ago

Ah, my bad!

I think that the bot is not able to open text files in /Android/data/*. I always have my text files in the root of the internal storage.

I definitely need to make the description of the combat script selector more clearer.

PortablePanda commented 2 years ago

No problem! I tried to move it to the root of internal storage, but it's still pointing towards /data/user/0/com.steve1316.granblue_automation_android/cache/primary:[Enter selected file path here].

From my phone's file manager, the path is /Internal storage/GAA Scripts/12 Punch.txt.

steve1316 commented 2 years ago

Moving the scripts to /Internal Storage/ should work. It should not be inside any other folder.

I will look into the issue when I have time. Something to do with converting the URI to actual file path that it thinks the file exists inside the app's cache folder instead of using the actual file path.

PortablePanda commented 2 years ago

Yep, moving to /Internal Storage/ worked! Ty for the troubleshooting, I'll just give all of my scripts a prefix to organize them in the meantime.

steve1316 commented 2 years ago

Took a look at how to solve it, but turns out that Android 11 added a storage restriction for reading files. So unfortunately, leaving the script files in /storage/emulated/0/ will be the way to go. Updated the description of the Combat Script select button to clarify this.