4rtzel / poe-archnemesis-scanner

Tool for Path of Exile game to automatically scan Archemesis inventory and display related information
Apache License 2.0
64 stars 25 forks source link

Script does nothing, just hangs on start #18

Closed cyrilbos closed 2 years ago

cyrilbos commented 2 years ago

Hi, I have tried running both through the release executable and the script after installing the dependencies. Both just hang with no output at all. I am using python 3.10 on Windows 11, running with admin rights. The game is running in the background when I try.

YetAnotherDevWannabe commented 2 years ago

same here

4rtzel commented 2 years ago

Could you run it from the console and see what the program outputs? Maybe you'll spot some kind of error there.

pozibrothers commented 2 years ago

I think I'm encountering the same issue. I'm also running Windows 11 and I get this when trying to run the program from an elevated powershell console:

> .\poe_arch_scanner.exe
Traceback (most recent call last):
  File "poe_arch_scanner.py", line 605, in <module>
  File "poe_arch_scanner.py", line 100, in __init__
  File "poe_arch_scanner.py", line 106, in _update_images
  File "poe_arch_scanner.py", line 117, in _load_image
  File "PIL\Image.py", line 1958, in resize
  File "PIL\Image.py", line 1980, in resize
ValueError: height and width must be > 0
[27628] Failed to execute script 'poe_arch_scanner' due to unhandled exception!

If it helps, I'm running dual 1440p monitors, with PoE running on screen 2, which is set as the main display.

4rtzel commented 2 years ago

The problem is that pillow failed to resize the image. What is your scale value?

pozibrothers commented 2 years ago

The problem is that pillow failed to resize the image. What is your scale value?

I have none set, I'm using Windows default value.

4rtzel commented 2 years ago

Is there a 'settings.ini' file in the tool directory? If so, could you try deleting it and starting the tool again?

pozibrothers commented 2 years ago

It seems that my issue resolved itself after I started the computer again. There was no settings.ini file before staring it again.

Thanks for your help anyways :)

4rtzel commented 2 years ago

Would like to hear from @Vikfr0 and @YetAnotherDevWannabe before closing this issue.

Nchi commented 2 years ago

same issue here, no settings.ini

4rtzel commented 2 years ago

I suspect that the tool somehow calculates the scale as 0. Could you try forcing it to use 0.90 scale factor by creating the settings.ini file in the tool directory with the following content:

[settings]
scanner_window = (150, 300, 600, 620)
image_scale = 0.90
confidence_threshold = 0.94
display_inventory_items = True
display_unavailable_recipes = True
quamtum commented 2 years ago

still same issue, need force set x1=2560,y1=1440 after win32gui.GetWindowRect(hwnd) and win32gui.GetClientRect(hwnd) then can work

4rtzel commented 2 years ago

Alright, it seems that winapi function may return 0 width and height for some reason. Maybe someone with a better winapi knowledge could figure out why that happens. For now, I'll fallback to using screen resolution if that happens.

4rtzel commented 2 years ago

It seems that GetClientRect() may return zero width and height if the game is running in fullscreen. Is that your case @quamtum?

quamtum commented 2 years ago

no , I use windowed fullscreen mode

4rtzel commented 2 years ago

Strange. Anyway, I'll add the code to check if width or height returned as zero and fallback to the screen resolution in that case.

4rtzel commented 2 years ago

Fixed here: 6284bd6

4rtzel commented 2 years ago

New release is out: https://github.com/4rtzel/poe-archnemesis-scanner/releases/tag/v0.1.0. Closing this issue.