xenesty / AkashaScanner

A Genshin Impact tool to export achievements, characters, artifacts, and weapons.
MIT License
84 stars 11 forks source link

New "quality of life" artifact page changes break the artifact scanner #43

Open maddiesh opened 7 months ago

maddiesh commented 7 months ago

When attempting to scan artifacts, the new (as of 4.3) artifact auto-lock screen is opened, causing Akasha scanner to crash.

Steps to reproduce the behavior:

  1. Run Akasha scanner with admin privileges
  2. Click artifact scanner
  3. Update artifact game data
  4. Open artifact page in Genshin according to instructions
  5. Click "start"

Screenshot of the error upon crash: image

Full Exception text: ** Exception Text ** System.IO.IOException: Cannot get item count at AkashaScanner.Core.Scappers.EquipableScrapper3.GetItemCount() in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Scrappers\EquipableScrapper.cs:line 126 at AkashaScanner.Core.Scappers.EquipableScrapper3.Run(TaskQueue tasks, C config) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Scrappers\EquipableScrapper.cs:line 32 at AkashaScanner.Core.Scappers.EquipableScrapper3.Execute(C config) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Scrappers\EquipableScrapper.cs:line 101 at AkashaScanner.Core.Scappers.BaseScrapper2.Start(C config) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Scrappers\BaseScrapper.cs:line 100 at AkashaScanner.Ui.Pages.Scanners.ArtifactScanner.HandleSubmit() in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Ui\Pages\Scanners\ArtifactScanner.razor:line 74 at AkashaScanner.Ui.Partials.Scanner.b42_0() in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Ui\Partials\Scanner.razor:line 122 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at AkashaScanner.Ui.Partials.Scanner.HandleSubmit() in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Ui\Partials\Scanner.razor:line 120 at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) at Microsoft.AspNetCore.Components.WebView.IpcSender.<>cDisplayClass9_0.b1() at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.InvokeAsync(Action workItem) at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.<>c.<.cctor>b8_0(Exception exception)

akrios-d commented 7 months ago

I commented off the ScrapPlan.Activate(); (EquipableScrapper line 31) and built from source, that worked for me, just remember manually sort before parsing

Zeiin commented 7 months ago

I commented off the ScrapPlan.Activate(); (EquipableScrapper line 31) and built from source, that worked for me, just remember manually sort before parsing

This worked for me as well. Seems GenshinInventoryNavigation.cs needs to be updated to support that the artifact screen has its sort button in a different location and also has a new sort UI which lets you pick an option.

AdrianPramadipta commented 7 months ago

I commented off the ScrapPlan.Activate(); (EquipableScrapper line 31) and built from source, that worked for me, just remember manually sort before parsing

im a beginner at coding, i havent learn C#, i understand how to copy the source and comment the specific line of code, but how do you make it into an application file like the one in https://github.com/xenesty/AkashaScanner/releases/latest in the zipfile afterwards?

blvz commented 7 months ago

@AdrianPramadipta you need to install the .NET SDK and build the project from command line.

cd path\to\AkashaScanner
dotnet build
dotnet publish -c Release

If you can't do it, let me know and I'll upload it for you, but it'd be better if you built it yourself.

YourAlly commented 7 months ago

I commented off the ScrapPlan.Activate(); (EquipableScrapper line 31) and built from source, that worked for me, just remember manually sort before parsing

This worked for me as well. Seems GenshinInventoryNavigation.cs needs to be updated to support that the artifact screen has its sort button in a different location and also has a new sort UI which lets you pick an option.

I wonder what the new values are supposed to be so that it doesn't hit the new QoL button

akrios-d commented 7 months ago

I commented off the ScrapPlan.Activate(); (EquipableScrapper line 31) and built from source, that worked for me, just remember manually sort before parsing

This worked for me as well. Seems GenshinInventoryNavigation.cs needs to be updated to support that the artifact screen has its sort button in a different location and also has a new sort UI which lets you pick an option.

I wonder what the new values are supposed to be so that it doesn't hit the new QoL button

I have done some work on it already, but the issue is the new interface is not just select the order, if it's already selected it will change it.

e.g. if you re select image this one being already descending, that will go to asceding

blvz commented 7 months ago

the new interface is not just select the order, if it's already selected it will change it

I'd rather just ask people to have it on descending before clicking "start". It's not a big deal and it's the default anyway.

YourAlly commented 7 months ago

I'd rather just ask people to have it on descending before clicking "start". It's not a big deal and it's the default anyway.

I agree on this lol

Joaos98 commented 6 months ago

@AdrianPramadipta you need to install the .NET SDK and build the project from command line.

cd path\to\AkashaScanner
dotnet build
dotnet publish -c Release

If you can't do it, let me know and I'll upload it for you, but it'd be better if you built it yourself.

I'm also having the same problem with the scanner, and when i tries to do this i get a bunch of CS0449 errors when running the build command, can't figure out how to solve it.

ecpgieicg commented 6 months ago

A low effort workaround is to manually move the cursor immediately after the screen in focus switches to genshin. That will bypass the sorting part with the original build.

blvz commented 6 months ago

A low effort workaround is to manually move the cursor immediately after the screen in focus switches to genshin. That will bypass the sorting part with the original build.

I wish I was this smart.

@Joaos98 sorry, I was traveling and just got back. See if this solution works for you. If not, I'll upload my build.

Peckchamp14 commented 6 months ago

@blvz can you upload your build please?

Joaos98 commented 6 months ago

A low effort workaround is to manually move the cursor immediately after the screen in focus switches to genshin. That will bypass the sorting part with the original build.

This worked for me to fix the error during the scan, but then i got a different error when trying to export in GOOD format for the Genshin Optimizer, i eventually gave up.

blvz commented 6 months ago

@Peckchamp14 There you go. I'm not responsible if your computer turns into a lizard.

https://mega.nz/file/RgtVzSrb#2k-TlOjAXyiVKA4eCDQqgYm-AtAzaRESiCPnt4Rf9Zk

YourAlly commented 6 months ago

In the meantime, what are the good scanners to use as alternative?

Peckchamp14 commented 6 months ago

check out this site for some scanners https://frzyc.github.io/genshin-optimizer/#/scanner

akrios-d commented 5 months ago

i'll keep up the repository working for those that like this tool. Also did a bugfix for parsing Xianyun