Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script does nothing, just hangs on start #18

Closed
cyrilbos opened this issue Feb 12, 2022 · 17 comments
Closed

Script does nothing, just hangs on start #18

cyrilbos opened this issue Feb 12, 2022 · 17 comments
Labels
bug Something isn't working

Comments

@cyrilbos
Copy link

cyrilbos commented Feb 12, 2022

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
Copy link

same here

@4rtzel 4rtzel added the bug Something isn't working label Feb 12, 2022
@4rtzel
Copy link
Owner

4rtzel commented Feb 12, 2022

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

@pozibrothers
Copy link

pozibrothers commented Feb 12, 2022

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
Copy link
Owner

4rtzel commented Feb 12, 2022

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

@pozibrothers
Copy link

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
Copy link
Owner

4rtzel commented Feb 12, 2022

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

@pozibrothers
Copy link

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
Copy link
Owner

4rtzel commented Feb 12, 2022

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

@Nchi
Copy link

Nchi commented Feb 12, 2022

same issue here, no settings.ini

@4rtzel
Copy link
Owner

4rtzel commented Feb 12, 2022

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
Copy link

quamtum commented Feb 12, 2022

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

@4rtzel
Copy link
Owner

4rtzel commented Feb 13, 2022

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
Copy link
Owner

4rtzel commented Feb 13, 2022

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

@quamtum
Copy link

quamtum commented Feb 13, 2022

no , I use windowed fullscreen mode

@4rtzel
Copy link
Owner

4rtzel commented Feb 13, 2022

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
Copy link
Owner

4rtzel commented Feb 13, 2022

Fixed here: 6284bd6

@4rtzel
Copy link
Owner

4rtzel commented Feb 13, 2022

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

@4rtzel 4rtzel closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants