oskros / MF_run_counter

MF run counter developed for Diablo 2. Allows users to collect stats about their run times and found items, and can track your holy grail progress
MIT License
80 stars 18 forks source link

Any chance of supporting wine/linux #14

Open AndyHoang opened 1 year ago

AndyHoang commented 1 year ago

Im understand that its was mentioned that only window is tested and support.

Although I want to shoot for my luck if there're any tweak so that MF_run_counter can be used by running with Wine.

I tried it and got an error on extraction data, and some wine version show problem on permission while create a folder. Any insight you can provide I can bypass this problem?

do see a lot of python, hopefully it can compile into a bigass bundle instead of not extraction data for installer? (This is my guess)

Screenshot_20221103_231908

Thank a bunch.

oskros commented 1 year ago

If you want to try and make it work, I would recommend cloning the repository and trying to run the python code directly rather than running the compiled version. I expect it to require quite a bit of work though :/

AndyHoang commented 1 year ago

Thank for your comment, so I take a wild guess on the python version is 2.7?

Im think im pretty close the target, but getting a few errors running the python code:

Installing requirement.txt https://gist.github.com/AndyHoang/9b83db1c49516808bacc84eb366f0861

Running the main.py

▶ wine ../Python27/python.exe main.py
wineserver: using server-side synchronization.
002c:fixme:winediag:LdrInitializeThunk Wine TkG (staging) 6.17 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please don't report bugs about it on winehq.org and use https://github.com/Frogging-Family/wine-tkg-git/issues instead.
ERROR:root:invalid syntax (tk_dynamic.py, line 264)
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    from utils import tk_utils
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 2, in <module>
    from utils import tk_dynamic as tkd
  File "C:\MF_run_counter-1.4.9\utils\tk_dynamic.py", line 264
    super().__init__(*args, **kwargs, cursor=cs)
                                    ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    raise e
  File "C:\MF_run_counter-1.4.9\utils\tk_dynamic.py", line 264
    super().__init__(*args, **kwargs, cursor=cs)
                                    ^
SyntaxError: invalid syntax
00fc:fixme:msvcrt:__clean_type_info_names_internal (1EA66C1C) stub
00fc:fixme:msvcrt:__clean_type_info_names_internal (1E7BA8D4) stub
00fc:fixme:msvcrt:__clean_type_info_names_internal (1E2719D0) stub

Update:

I tried python 3.7, passed installing libs got this error:

▶ wine ..../windows/py.exe  main.py
wineserver: using server-side synchronization.
002c:fixme:winediag:LdrInitializeThunk Wine TkG (staging) 6.17 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please don't report bugs about it on winehq.org and use https://github.com/Frogging-Family/wine-tkg-git/issues instead.
0104:err:winediag:ntlm_check_version ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0104:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
0104:fixme:font:find_matching_face Untranslated charset 255
0104:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0104:fixme:imm:ImmReleaseContext (0001007A, 06E51578): stub
Traceback (most recent call last):
  File "main.py", line 18, in <module>
    raise e
  File "main.py", line 15, in <module>
    MasterFrame()
  File "C:\MF_run_counter-1.4.9\master_frame.py", line 155, in __init__
    self.profile_tab = Profile(self, parent=self.tabcontrol)
  File "C:\MF_run_counter-1.4.9\modules\profiles.py", line 21, in __init__
    self._add_new_profile(first_profile=True)
  File "C:\MF_run_counter-1.4.9\modules\profiles.py", line 82, in _add_new_profile
    profile = tk_utils.registration_form(master=self.main_frame, coords=(xc, yc), first_profile=first_profile)
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 120, in registration_form
    reg_form = RegistrationForm(master, coords, first_profile)
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 47, in __init__
    geom = get_displaced_geom(master, 290, 185, coords[0], coords[1])
  File "C:\MF_run_counter-1.4.9\utils\tk_utils.py", line 28, in get_displaced_geom
    mon = get_monitor_from_coord(master.root.winfo_rootx(), master.root.winfo_rooty(), disable_scaling=master.disable_scaling)
  File "C:\MF_run_counter-1.4.9\utils\other_utils.py", line 27, in get_monitor_from_coord
    monitors = libs.screeninfo.get_monitors(disable_scaling=disable_scaling)
  File "C:\MF_run_counter-1.4.9\libs\screeninfo\screeninfo.py", line 38, in get_monitors
    raise ScreenInfoError("No enumerators available")
libs.screeninfo.common.ScreenInfoError: No enumerators available
00fc:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFA, 0072F358

Update:

method enumerate_monitors() for each of the implementation seem not to has parameters, but being passed with disable_scaling kwargs. Only window.py implementation has this kwargs

I got _get_monitors(Enumerator.Windows,disable_scaling=True) the error *** ValueError: Procedure probably called with not enough arguments (4 bytes missing)

Appreciate if there're any insight

oskros commented 1 year ago

I think I was running the code originally with 3.7 or 3.8 - can't fully remember. I just tested a fresh install on a windows machine with python 3.9, and that works fine at least

It looks like your error is related to the screeninfo package not being able to identify the operating system correctly. I can't really tell you why that happens.

To test whether the code works without screeninfo, just

then you can test whether the rest works.

AndyHoang commented 1 year ago

Thanks I made it work as you suggest. I can run it, start counting, some feature is not working (not trying automode), but at least it can record my sessions now.

There would be some improvement needed for it to run out of the box, I guess. There're 2 thing left I would to love hear from your suggestion so that I can dig this app deeper:

bviktor commented 11 months ago

To me it starts up on Ubuntu 22.04, but there's a related bug:

https://bugs.winehq.org/show_bug.cgi?id=49334

For this reason, it needs to be run with sudo. Then it runs:

image

But yeah, hotkeys don't work, which kinda defeats the purpose. I mean if you switch from Alt + Q to Ctrl + Q it does work, but only when the window is active. Oh and always on top won't work either. So... :D

oskros commented 11 months ago

To me it starts up on Ubuntu 22.04, but there's a related bug:

https://bugs.winehq.org/show_bug.cgi?id=49334

For this reason, it needs to be run with sudo. Then it runs:

image

But yeah, hotkeys don't work, which kinda defeats the purpose. I mean if you switch from Alt + Q to Ctrl + Q it does work, but only when the window is active. Oh and always on top won't work either. So... :D

Well yeah I would need to rewrite a ton of things and I have no knowledge of linux, so unfortunately if you really want to use the app I guess running D2 + run counter in a virtual machine would be your best bet