Commit Graph
35 Commits
Author SHA1 Message Date
Randi 4199705fe8 Expanded scope of thread lock in screen::grab() method. 2024-06-13 19:59:35 -04:00
aeon0andmgleed 084bdb6573 feat/cached-img (#734)
* feat/cached-img

* thread safe

* update

* add a force_new param for grab() and enable it for pather, which is more dependent on exact current frame

* use existing img for pather screen object checks

Co-authored-by: mgleed <[email protected]>
2022-06-06 18:07:10 -04:00
mgleedandaeon0 3e6f9a9bf1 Migrate from Python 3.9 to 3.10 (#826)
* migrate from python 3.9 to 3.10, recompiled tesserocr

* cleanup old types, change all Unions to |

* add a few match/case statements

* Update ci.yml

Co-authored-by: aeon0 <[email protected]>
2022-06-05 08:01:28 -04:00
Ezro 1078563f2d Bugfix: Prevent join for NoneType and start_detecting_window() in main.py (#624)
* Prevent join for NoneType and start_detecting_window() in main.py

* Start and stop in the debugger toggle
2022-03-09 23:15:36 -05:00
mgleed c1f2cad291 Bugfix: Game recovery after D2 restart (#620)
* init

* bump version
2022-03-09 19:42:20 -05:00
mgleed 9707fc4563 Enhancement: Cleanup botty startup. Add version to debug log. 2022-03-09 13:30:06 -05:00
Ezro 7056a58958 Enhancement/bugfix: Create find_and_set_window_position in screen.py to be used during testing (#591) 2022-02-26 12:23:26 -05:00
mgleed 9726690c07 Bugfix: Save/exit error (#579)
Fix bug where save/exit routine would pass an empty template match
2022-02-22 23:01:45 -05:00
Ezro 59d0795153 Bugfix: Fix bug with screen offset detection in fullscreen (#573) 2022-02-21 01:18:04 -05:00
mgleed 9b22917660 Refactor: UI overhaul (#558)
Summary of changes:
-Rearranged many UI-related functions across the codebase (particularly in ui_manager.py) into individual components. See src/ui_components/. Functions related to components can be called like if waypoint.use_wp("Arcane Sanctuary"): or loading.wait_for_loading_screen(2.0)
-Removed Screen and TemplateFinder dependencies across the codebase
-Screen functions separated from class
-TemplateFinder made into a singleton
-Added generic ScreenObject UI functions to simply detect UI elements on screen; e.g., detect_screen_object(ScreenObjects.TownPortal), wait_for_screen_object(ScreenObjects.Loading, 2). Also included related functions like select_screen_object_match(template_match) to automatically select the match.
-Consolidated assets. Organized templates folder into components. Adjusted some asset ROI's and alpha channels.
-Changed some template searches to grayscale for speed
-Reworked save/exit routine, should now be more consistent and faster with normal exit, chicken exit, and death exit.
-Got rid of unused and consolidated duplicate game.ini parameters
-spelling fix _last_merc_healh
-NPC manager class removed and replaced with functions
-D2 window detection now runs on its own thread for semi-live window position offsets.
-Character selection reworked. OCR your selected character for fun (not that accurate, lol)
-Simplified game start and difficulty select
-Added a get experience function, but this is not called anywhere yet
-Reworked corpse pickup. pickup_corpse is no longer a necessary argument/parameter throughout the codebase (bot.py, game_controller.py, runs, etc.)
2022-02-20 18:49:04 -05:00
Vladimir Makaev 528400503c Enhancement: Ability to customize window properties to look for when win32 api searching for d2r window (#563) 2022-02-18 12:27:31 -05:00
Vladimir Makaev 47c5e20238 Optimized handling of teleport charges (#476) 2022-02-04 14:59:39 -05:00
aeon0 2905ee5d31 Remove configs (#497)
* remove config window always on top

* remove message highlights

* only use win32api for window offset
2022-01-30 13:26:10 +01:00
aeon0 27f0e3d793 Revert "Add Linting (#487)" (#490)
This reverts commit 5e1a783394.
2022-01-28 18:24:47 +01:00
aeon0 5e1a783394 Add Linting (#487)
* add black linting

* fix linting

* doc update
2022-01-28 17:47:03 +01:00
AlekseyLesnoy 7aef2a6a73 fix window detection with multiple monitors via winapi (#483) 2022-01-28 16:51:52 +01:00
Vladimir Makaev b890ff266f Find D2R window using win32api instead of pattern matching (#453) 2022-01-18 20:32:35 +01:00
aeon0 e099848ed4 Npc serach optimization (#391)
* NPC search optimization

* fix pywin32 version
2022-01-04 12:24:43 +01:00
Matt StiehmandMatt fdfdd81b84 Restart game (#374)
* removed 1920_1080 support

* Update ui_manager.py

Fixed bug...

* Update pather.py

fixed scale factor

* Update i_char.py

* Update game.ini

removed tp locations

* Bump version to v0.4.3

* Bump version to v0.4.3

* added working restart module

* tested and looks stable after refactor

* fixed a few things after looking at PR

* switched things back to search after testing and removed 1s delay in save_and_exit search

* fixed tab select bug where the exit game prompt was up, and also fixed max game length bug on WP use

* Update a5.py

Changing back, as not needed.

* adding requested changes

* keyboard went missing from game_recovery

* missed case where restart fails then loops infinitely

* fixed typo. all tested now

* also removed flag resets since we're recreating hm and dm

Co-authored-by: Matt <[email protected]>
2022-01-04 10:08:50 +01:00
aeon0 d8942f92b4 A2 Pathing + Arcane run + Static for Sorc + Static Tele robustification + Chest class (#348) 2022-01-01 14:15:13 +01:00
aeon0 29a4eaf9b2 Fix static field param (#296) 2021-12-15 23:53:43 +01:00
aeon0 bf7ce99c5f Implement Nihlatak for Sorc (#281) 2021-12-13 18:14:03 +01:00
aeon0 f7b1c834c9 Integrate Trav Run (#221) 2021-12-06 20:40:55 +01:00
aeon0 32dc347e7e Prepare for shop release (#189) 2021-12-03 20:56:20 +01:00
Matt Stiehm 5ef427b85b Removed 1920_1080 support (#149) 2021-11-30 20:56:36 +01:00
reqyl 558be5ab9a Make it possible to initialize Screen ingame (#132)
* Make it possible to initialize Screen ingame

This fixes broken shopping script due to only lobby being supported right now. This also fixes standalone scipts node recorder. Both resolutions are supported

* Use game.ini conf for offset
2021-11-27 16:07:13 +01:00
aeon0 0b318e1131 Add user info about window offset search (#128)
* Bump version to: 0.4.1

* More cmd info regarding offset search

* english
2021-11-27 07:51:29 +01:00
mgleedandaeon0 fdcdd90b43 Auto offset (#120)
* automatically calculate offsets, not-yet working

* space

* space

* float to int

* working

* clean

* clean2

* auto adjust windowed mode depending on screen res and botty res

* clean screen instance, fix tests

* remove test png

Co-authored-by: aeon0 <[email protected]>
2021-11-26 23:26:42 +01:00
aeon0 8f772daf86 Fixes and fail saves (#44)
* remove old discord, add offset_left, fix coordinate clamping

* proper bot thread
2021-11-17 21:12:29 +01:00
aeon0 5750825c9e Support 1280x720 (#19) 2021-11-16 22:58:48 +01:00
aeon0 568378fea8 Revert "clip monitor coordinates" (#38)
* Revert "clip monitor coordinates (#37)"

This reverts commit 40b01fd7c0.

* Update pather.py
2021-11-16 21:57:22 +01:00
aeon0 40b01fd7c0 clip monitor coordinates (#37) 2021-11-16 21:39:45 +01:00
aeon0 9680760ae6 random updates and optimizations 2021-11-12 19:42:09 +01:00
aeon0 90869ebfbb refactor(botty): Add docs, clean up, put all hardcoded px values to .ini 2021-11-06 12:48:19 +01:00
aeon0 a8141b91db initial 2021-11-04 21:24:44 +01:00