xenesty / AkashaScanner

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

Error exporting data to GOOD format #22

Open evearellie opened 1 year ago

evearellie commented 1 year ago

The program scanned my artifacts, characters, and weapons perfectly, but now it's giving me a very weird error that prevents the program from working when I try and export, and I don't know how to fix it.

When I hit "export" on the GOOD format tab, it gives me this popup: image

this is the relevant text under the details I think? "See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.Collections.Generic.KeyNotFoundException: The given key 'Invalid' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at AkashaScanner.Core.Exporters.GoodExporter.Export(String& output, IDataFile1 weaponFile, IDataFile1 artifactFile, IDataFile1 characterFile) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Exporters\GoodExporter.cs:line 110 at AkashaScanner.Ui.Pages.Exports.GoodExports.HandleSubmit() 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.<>c__DisplayClass9_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)"

I've tried like 5 times now, restarted my laptop. closed an reopened the program multiple times, but nothing works.

xenesty commented 1 year ago

Oops, that's my bad. It means that there are one or more artifact cannot be identified and stored as "Invalid" artifacts. Maybe you can open the artifact json files under "ScannedData" to manually edit those invalid artifacts out? Will fix this ASAP so that it will show a warning instead of crashes.

Lkkenji commented 1 year ago

I don't know if its only for me, but apperently The scanner gives "Invalid" to all Hp percent main stat, hope it helps!

acefalobi commented 9 months ago

I was getting this so I cloned and debugged the code and found out that using Windows Auto SDR makes the image from Graphics.CopyFromScreen look blown out (see screenshots) and hard for the OCR to get the correct text especially for main stats.

So you can also check to see if you have Auto SDR on.

Bitmap with Auto SDR on image

Bitmap without Auto SDR on image