GithubHelp home page GithubHelp logo

oskros / mf_run_counter Goto Github PK

View Code? Open in Web Editor NEW
76.0 5.0 18.0 11.7 MB

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

License: MIT License

Batchfile 0.18% Python 99.82%
grail automode counter diablo diablo2

mf_run_counter's Introduction

MF Run Counter

Run counter for Diablo 2, created by oskros#1889 with ongoing development since August 2019.

You can find a video where the application is described in detail here: https://youtu.be/IV3H3pt6YDE

GUI

How to use

NB: Working on Windows 7 and Windows 10 (I have not tested on any other OS, but probably it wouldn't work)

  1. To run on your computer, go to releases (https://github.com/oskros/MF_run_counter/releases) and download the .exe file from the latest release.

  2. Place the .exe file in your preferred folder (don't place it in a folder that requires admin rights to write to)

  3. You might be prompted by Windows not recognizing the application publisher (I am not going to pay 100$ a year for Windows to recognize me lol). Simply click "more info" and then "Run anyway" when Windows asks. See pictures below

    winblock1 winblock2

  4. You can make the application trusted by following the steps suggested here: https://www.windowscentral.com/how-disable-smartscreen-trusted-app-windows-10

  5. The first time you run the .exe file, a config file is created in the same directory as the .exe, named "mf_config.ini", which can be edited in Notepad. While you can edit settings directly in the config file, I would recommend doing it from within the application. At first run, there is also a "Profiles" folder created, which stores save files for each of your created profiles.

Features

Automode

You can active automode in Options -> Automode. There are two types of automode

  1. Advanced: Uses memory reading of the D2 "Game.exe" process to read from your client when you are in-game. When you enter a game, it will start a new run, and when you exit a game it will stop the run - Only recommended on single player, as it could be deemed cheating on multiplayer servers.
    Advanced automode is patch specific, and is currently supported for 1.13c, 1.13d, 1.14b, 1.14c and 1.14d. It also works together with D2SE.

  2. Simple: Monitors the "latest change time" of your character save file. Your character is saved every time you exit a game, and thus a new run can be started - Unfortunately, there is no way to stop a run with this method and also it has two drawbacks:
    2.a) The game autosaves every 5 minutes, thus you cannot have runs longer than 5 min.
    2.b) The game autosaves every time you die
    To set-up automode, enter the game path to your character save folder and click 'Apply'. Also make sure the character name specified in your profile is exactly the same as your in-game name, otherwise the automode will fail to start.

System wide hotkeys

You are able to customize hotkeys for each of the commands in the application. The hotkeys are system wide, so you do not need to place focus on the application to use them. However, this means that while the application is open, it overrides any other program using this specific hotkey. It is possible to disable a command from having a hotkey by choosing "NO_BIND"
There are 2 hidden hotkeys: CTRL+SHIFT+PgDn and CTRL+SHIFT+PgUp for switching between tabs in the app (eg. if you wanna confirm the drop you just added is in fact saved)

Manual run counting (Optional)

Start a new run by using the assigned hotkey (default ALT+Q). In case a run is already active, this button will end it and start a new run. End the run by using the assigned hotkey (default ALT+W). In case of mistakes, the previous run can be deleted using the assigned hotkey (default CTRL+DEL) If the user desires, the current run timer can be reset using the assigned hotkey (default ALT+R).

Drop logging

You add a drop to the current run (or previous run if no run is currently active) by using the assigned hotkey (default ALT+A). It will then be listed in the "Drops" list for the run where it was found. When adding a drop, the application will try and autocomplete the name of the drop using a full library of all available sets, uniques and runes. In case a drop was added by mistake, it can be deleted by highlighting it and clicking the "Delete selection" button under the "Drops" tab, or by pressing the Delete button on your keyboard while the drop is highlighted (this hotkey is not system wide).

Profiles

In the profile tab it is possible to create a separate run profile for each character and run type (eg. Chaos, Cows, Meph, etc.). In the profile tab you can view each saved session in the archive browser, where it is also possible to save the results to a .txt file or copy to clipboard. Profile data is saved as a .json under the "Profiles" folder that is created the first time you run the program.

Grail logging

In the grail tab you can track your progress in completing the d2 holy grail of collecting all items (and runes). Every time you add a new item that hasn't been found before, you will get a pop-up asking if you wish to add it to your grail! Then it will appear in your found items with a "(*)" in front of the name, to indicate it was a grailer.
You can sync the grail progress made in the run counter with d2-holy-grail.herokuapp.com - Both in terms of syncing the run counter with the webpage, and also upload any progress back to the webpage again!
In order to view your grail progress there is both a "Grail controller" view, which is similar to the one found on herokuapp, but also an "Item table" view, where you see all items in a table with tons of information about each item.
You can also sync your local grail with already found items. Unfortunately, it is not possible to sync with any items added in your profiles prior to MF Run Counter v.1.2.0, sorry!

Session timer

The session timer will run while Diablo is open. It will pause when Diablo is closed.

Pausing

In case you need to take a break from the computer, the counter can be paused by using the assigned hotkey (default CTRL+Space). This will pause both the run timer (if a run is active) and the session timer.

Saving and exporting results

The current session is saved automatically every 30 seconds (to prevent data loss in case of crashes) and also saved automatically when you close the app. You can click the "Archive session" button to reset the session and archive the session results to the profile. In the archive browser, it is possible to save a session or the full profile history to a .txt or .csv file, or copy to clipboard - Example of the .txt file is included below.

    *Statistics*
    Character name: Tsssch
    Run type:       Andy
    Game mode:      Single Player

    Total session time:   00:24:20:0
    Total run time:       00:23:10:0
    Average run time:     00:00:34:7
    Fastest run time:     00:00:23:1
    Number of runs:       40
    Time spent in runs:   95.21%

    *Collected drops*
    Run  2 --- Atma's Scarab
    Run  6 --- Raven Frost 151/18

    *Run times*
    Run  1: 00:00:23:1
    Run  2: 00:00:42:0 --- Atma's Scarab
    Run  3: 00:00:25:0
    Run  4: 00:00:32:1
    Run  5: 00:00:32:3
    Run  6: 00:00:26:7 --- Raven Frost 151/18

Dragging

Window can be dragged on the Diablo 2 banner. Window position is saved in the config file, such that it opens where you closed it.

Automatic check for updates

The program automatically checks if a new version is available on start-up, providing a link to the release pages where you can download it. This features can be disabled under Options->General

Color themes

Three different themes for the application have been created, which the user can choose between under Options winblock1

Extra options

In the Options tab you can turn on or off specific features in the application, and change the colour theme

mf_run_counter's People

Contributors

dependabot[bot] avatar oskros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mf_run_counter's Issues

"failed to execute script main"

hello,

my pc crashed while i was using the mf counter and when i logged back in and tried to run the .exe i started receiving a

Fatal error detected
"Failed to execute script main" error.

it's creating a log file stating

15:26:38,533 root ERROR Expecting ',' delimiter: line 13975 column 27 (char 371371)
Traceback (most recent call last):
File "main.py", line 15, in
File "main_frame.py", line 112, in init
File "main_frame.py", line 274, in sorted_profiles
File "main_frame.py", line 272, in sort_key
File "json_init_.py", line 293, in load
File "json_init_.py", line 357, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 353, in raw_decode
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 13975 column 27 (char 371371)

i'm hoping there's a way to recover the data that was currently being stored? my power went out over the weekend and when i loaded pc back up the run i was in was still there so i'm there's an easy fix to recover?

Bug: crash when running for a long time

I noticed a few similar crashes and stopped to actually read the message. It looks like some variable/property is overflowing if the counter and/or the game is open for too long.

Here's an image of the exception:
image

PS: I was not in a run, though the session time was still ticking, as always.
PS2: I'm usually AFK for some time and come back to this, or I left the game & counter in the background for a long time and it just crashes.

i18n support

thank you for releasing such a good application.

Do you have a plan for i18n support?

I can contribute for i18n.
But I'm not familar with python and i18n framework
If the code is refactor for i18n
I believe there will be more people willing to do related work for i18n

Anyway, when you decided direction for i18n, i can contribute.

Disable hotkeys if Diablo isn't the active window

It's common to leave the game open and do something else (Discord, search something, etc.). When out of the game, it's undesirable to trigger the hotkeys. As it happens, the hotkeys I use in the run counter clash with a few other apps' (and even Windows').

Permission errors on all actions

Whenever I try to do anything with the run counter, whether it is to start a new run or even try to close it, in most cases it will crash. It is impossible to keep it open for more than ~20 seconds. Here is the traceback:
21:03:25,450 root ERROR (<class 'PermissionError'>, PermissionError(13, 'The process cannot access the file because it is being used by another process.', None, 32), <traceback object at 0x000002B61EFC9F80>)
Traceback (most recent call last):
File "tkinter_init_.py", line 1883, in call
File "tkinter_init_.py", line 804, in callit
File "master_frame.py", line 460, in autosave_state
File "master_frame.py", line 541, in SaveActiveState
File "modules\grail.py", line 169, in save_grail
File "utils\other_utils.py", line 57, in atomic_json_dump
File "contextlib.py", line 120, in exit
File "site-packages\atomicwrites_init
.py", line 169, in open
File "site-packages\atomicwrites_init
.py", line 202, in commit
File "site-packages\atomicwrites_init_.py", line 99, in replace_atomic
File "site-packages\atomicwrites_init_.py", line 79, in replace_atomic
File "site-packages\atomicwrites_init
.py", line 76, in _handle_errors
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process.

I am running both the game and the run counter as admin. Using win10.

Feature: have session timer only accumulate run times

I AFK a lot while playing, doing runs here and there when I have some free time at night (but leaving the game open), so a lot of my "session" time was not actually spent playing. If I could have this counter be just the sum of all my runs it'd be great.

Exception thrown during startup

23:09:57,2 root ERROR 'utf-8' codec can't decode byte 0xc2 in position 2: invalid continuation byte
Traceback (most recent call last):
File "main.py", line 15, in
File "master_frame.py", line 156, in init
File "modules\mf_timer.py", line 35, in init
File "modules\mf_timer.py", line 78, in _update_timers
File "modules\mf_timer.py", line 93, in _update_session_time
File "modules\mf_timer.py", line 90, in is_game_open
File "memory_reader\reader_utils.py", line 158, in one_of_processes_exists
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 2: invalid continuation byte

Feature: in SP, pause timer when the game is paused

First of all, thanks for this project! It's great!

So, as the title says, in single-player it'd be great if the timer stopped when we hit ESC. Not sure if it's possible at all with your current memory reader, but thought I'd open this issue.

If it's trivial, feel free to give me some direction and I could do it myself.

Any chance of supporting wine/linux

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.