ok-script 0.0.332__tar.gz → 0.0.333__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ok_script-0.0.332/ok_script.egg-info → ok_script-0.0.333}/PKG-INFO +1 -1
- ok_script-0.0.333/ok/Capture.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.333/ok/OK.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.333/ok/Task.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.333/ok/Util.cp312-win_amd64.pyd +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/analytics/Analytics.py +1 -1
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/Box.py +5 -3
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/Communicate.py +1 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/MainWindow.py +7 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/StartController.py +3 -3
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/debug/Screenshot.py +20 -22
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/Tab.py +3 -1
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/ADBInteraction.py +1 -1
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/BaseInteraction.py +5 -2
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/PostMessageInteraction.py +4 -3
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/PyDirectInteraction.py +10 -5
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/logging/Logger.py +1 -1
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/test/TaskTestCase.py +8 -2
- {ok_script-0.0.332 → ok_script-0.0.333/ok_script.egg-info}/PKG-INFO +1 -1
- {ok_script-0.0.332 → ok_script-0.0.333}/ok_script.egg-info/SOURCES.txt +1 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/setup.py +1 -1
- ok_script-0.0.333/tests/test_box.py +30 -0
- ok_script-0.0.332/ok/Capture.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/OK.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/Task.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/Util.cp312-win_amd64.pyd +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/LICENSE.txt +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/MANIFEST.in +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/README.md +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/emulator_base.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/emulator_windows.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/platform_base.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/platform_windows.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/alas/utils.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/analytics/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/adb/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/adb/nemu_ipc.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/adb/nemu_utils.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/windows/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/windows/d3d11.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/windows/dump.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/windows/utils.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/capture/windows/window.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/color/Color.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/color/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/config/Config.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/config/ConfigOption.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/config/GlobalConfig.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/config/InfoDict.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/config/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/custom_types.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/display.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/display_adapters.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/display_monitors.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/display/windows_types.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/CompressCoco.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/Feature.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/FeatureSet.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/FindFeature.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/feature/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/App.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/MessageWindow.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/TabTitles.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/about/AboutTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/about/VersionCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/about/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/common/OKIcon.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/common/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/common/config.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/common/style_sheet.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/debug/DebugTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/debug/FrameWidget.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/debug/LogWindow.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/debug/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/i18n/GettextTranslator.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/i18n/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/i18n/path.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/i18n/update.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/icon/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/icon/icon.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/DownloadBar.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/Launcher.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/LauncherWindow.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/LinksBar.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/RunBar.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/UpdateBar.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/launcher/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/overlay/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/qss/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/resources.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/settings/GlobalConfigCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/settings/SettingTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/settings/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/start/StartCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/start/StartTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/start/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/ConfigCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndMultiSelection.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/StartButton.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/TaskCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/TaskTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/tasks/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/util/Alert.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/util/InitWorker.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/util/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/util/app.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/util/pip_util.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/BaseWindow.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/Card.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/EmptyCard.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/FlowLayout.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/StartLoadingDialog.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/StatusBar.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/TabWidget.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/gui/widget/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/interaction/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/logging/LogTailer.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/logging/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/ocr/OCR.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/ocr/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/ocr/download_paddle_model.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/delegate.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/export.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/idldsl.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/inspectable.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/roapi.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/types.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/winstring.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/scene/FeatureScene.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/scene/Scene.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/scene/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/stats/StreamStats.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/stats/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/test/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/DownloadMonitor.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/GitUpdater.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/GithubMultiDownloader.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/copy_ok_folder.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/gen_md5.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/init_launcher_env.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/package_full_with_profile.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/package_launcher.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/push_repos.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/update/python_env.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok/util/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok_script.egg-info/requires.txt +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/ok_script.egg-info/top_level.txt +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/setup.cfg +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/tests/__init__.py +0 -0
- {ok_script-0.0.332 → ok_script-0.0.333}/tests/test_updater.py +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -186,7 +186,8 @@ def sort_boxes(boxes: List[Box]) -> List[Box]:
|
|
|
186
186
|
|
|
187
187
|
return cmp
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
sorted_list = sorted(boxes, key=cmp_to_key(compare_boxes))
|
|
190
|
+
return sorted_list
|
|
190
191
|
|
|
191
192
|
|
|
192
193
|
def find_box_by_name(boxes, names) -> Box:
|
|
@@ -222,7 +223,7 @@ def get_bounding_box(boxes):
|
|
|
222
223
|
return bounding_box
|
|
223
224
|
|
|
224
225
|
|
|
225
|
-
def find_boxes_within_boundary(boxes, boundary_box):
|
|
226
|
+
def find_boxes_within_boundary(boxes, boundary_box, sort=True):
|
|
226
227
|
"""
|
|
227
228
|
Find all boxes that are entirely within the specified boundary box.
|
|
228
229
|
|
|
@@ -242,7 +243,8 @@ def find_boxes_within_boundary(boxes, boundary_box):
|
|
|
242
243
|
box.x + box.width <= boundary_box.x + boundary_box.width and
|
|
243
244
|
box.y + box.height <= boundary_box.y + boundary_box.height):
|
|
244
245
|
within_boundary.append(box)
|
|
245
|
-
|
|
246
|
+
if sort:
|
|
247
|
+
within_boundary = sort_boxes(within_boundary)
|
|
246
248
|
return within_boundary
|
|
247
249
|
|
|
248
250
|
|
|
@@ -8,6 +8,7 @@ class Communicate(QObject):
|
|
|
8
8
|
scene = Signal(str)
|
|
9
9
|
draw_box = Signal(str, object, str, object)
|
|
10
10
|
task = Signal(object)
|
|
11
|
+
task_done = Signal(object)
|
|
11
12
|
window = Signal(bool, int, int, int, int, int, int, float)
|
|
12
13
|
loading_progress = Signal(str)
|
|
13
14
|
notification = Signal(str, str, bool, bool)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from PySide6.QtCore import QObject, Signal, Qt, QEvent
|
|
2
2
|
from PySide6.QtWidgets import QMenu, QSystemTrayIcon
|
|
3
|
+
from ok.Util import init_class_by_name
|
|
3
4
|
from qfluentwidgets import FluentIcon, NavigationItemPosition, MSFluentWindow, InfoBar, InfoBarPosition
|
|
4
5
|
|
|
5
6
|
import ok.gui
|
|
@@ -53,6 +54,11 @@ class MainWindow(MSFluentWindow):
|
|
|
53
54
|
self.first_task_tab = self.trigger_tab
|
|
54
55
|
self.addSubInterface(self.trigger_tab, FluentIcon.ROBOT, self.tr('Triggers'))
|
|
55
56
|
|
|
57
|
+
if custom_tabs := config.get('custom_tabs'):
|
|
58
|
+
for tab in custom_tabs:
|
|
59
|
+
tab_obj = init_class_by_name(tab[0], tab[1])
|
|
60
|
+
self.addSubInterface(tab_obj, tab_obj.icon, tab_obj.name)
|
|
61
|
+
|
|
56
62
|
if debug:
|
|
57
63
|
debug_tab = DebugTab(config, exit_event)
|
|
58
64
|
self.addSubInterface(debug_tab, FluentIcon.DEVELOPER_TOOLS, self.tr('Debug'),
|
|
@@ -76,6 +82,7 @@ class MainWindow(MSFluentWindow):
|
|
|
76
82
|
|
|
77
83
|
communicate.executor_paused.connect(self.executor_paused)
|
|
78
84
|
communicate.tab.connect(self.navigate_tab)
|
|
85
|
+
communicate.task_done.connect(self.activateWindow)
|
|
79
86
|
|
|
80
87
|
# Create a context menu for the tray
|
|
81
88
|
menu = QMenu()
|
|
@@ -113,12 +113,12 @@ class StartController(QObject):
|
|
|
113
113
|
'supported_resolution', {})
|
|
114
114
|
supported_ratio = supported_resolution.get('ratio')
|
|
115
115
|
min_size = supported_resolution.get('min_size')
|
|
116
|
-
|
|
116
|
+
resize_to = supported_resolution.get('resize_to')
|
|
117
117
|
supported, resolution = ok.gui.executor.check_frame_and_resolution(supported_ratio, min_size)
|
|
118
118
|
if not supported:
|
|
119
119
|
resize_success = False
|
|
120
|
-
if
|
|
121
|
-
resize_success = ok.gui.device_manager.capture_method.hwnd_window.try_resize_to(
|
|
120
|
+
if resize_to and isinstance(ok.gui.device_manager.capture_method, BaseWindowsCaptureMethod):
|
|
121
|
+
resize_success = ok.gui.device_manager.capture_method.hwnd_window.try_resize_to(resize_to)
|
|
122
122
|
if not resize_success:
|
|
123
123
|
error = self.tr(
|
|
124
124
|
'Resolution {resolution} check failed, some tasks might not work correctly!').format(
|
|
@@ -8,13 +8,13 @@ import cv2
|
|
|
8
8
|
from PIL import Image, ImageFont, ImageDraw
|
|
9
9
|
from PySide6.QtCore import QObject
|
|
10
10
|
from PySide6.QtGui import QColor
|
|
11
|
+
from ok.Util import find_first_existing_file, clear_folder, sanitize_filename, \
|
|
12
|
+
get_relative_path
|
|
11
13
|
|
|
12
14
|
import ok.gui
|
|
13
15
|
from ok.feature.Box import Box
|
|
14
16
|
from ok.gui.Communicate import communicate
|
|
15
17
|
from ok.logging.Logger import get_logger
|
|
16
|
-
from ok.Util import find_first_existing_file, clear_folder, sanitize_filename, \
|
|
17
|
-
get_relative_path
|
|
18
18
|
|
|
19
19
|
logger = get_logger(__name__)
|
|
20
20
|
|
|
@@ -113,29 +113,27 @@ class Screenshot(QObject):
|
|
|
113
113
|
|
|
114
114
|
originl_name = self.save_pil_image(name + '_original', folder, pil_image)
|
|
115
115
|
|
|
116
|
-
if
|
|
117
|
-
# Ensure no fill
|
|
116
|
+
if len(ui_dict) > 0:
|
|
118
117
|
draw = ImageDraw.Draw(pil_image)
|
|
119
118
|
|
|
120
119
|
frame_ratio = 1
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
font=self.pil_font)
|
|
120
|
+
for key, value in ui_dict.items():
|
|
121
|
+
boxes = value[0]
|
|
122
|
+
color = tuple([int(x) for x in value[2].getRgb()]) # Convert QColor to BGR tuple
|
|
123
|
+
for box in boxes:
|
|
124
|
+
width = int(box.width * frame_ratio)
|
|
125
|
+
height = int(box.height * frame_ratio)
|
|
126
|
+
if width <= 0 or height <= 0:
|
|
127
|
+
logger.error(f"box height and width <=0 {box}")
|
|
128
|
+
continue
|
|
129
|
+
x = int(box.x * frame_ratio)
|
|
130
|
+
y = int(box.y * frame_ratio)
|
|
131
|
+
# Draw a rectangle. Arguments are (x, y, width, height).
|
|
132
|
+
# Adjust these values according to the desired size and position.
|
|
133
|
+
draw.rectangle([x, y, x + width, y + height], outline=color, width=2)
|
|
134
|
+
# Put text
|
|
135
|
+
draw.text((x, y + height + 8), f"{box.name or key}_{round(box.confidence * 100)}", fill=color,
|
|
136
|
+
font=self.pil_font)
|
|
139
137
|
self.save_pil_image(name + '_boxed', folder, pil_image)
|
|
140
138
|
return originl_name
|
|
141
139
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from PySide6.QtCore import Qt
|
|
2
2
|
from PySide6.QtWidgets import QVBoxLayout, QWidget, QSizePolicy
|
|
3
|
-
from qfluentwidgets import ScrollArea
|
|
3
|
+
from qfluentwidgets import ScrollArea, FluentIcon
|
|
4
4
|
|
|
5
5
|
from ok.gui.common.style_sheet import StyleSheet
|
|
6
6
|
from ok.gui.widget.Card import Card
|
|
@@ -9,6 +9,8 @@ from ok.gui.widget.Card import Card
|
|
|
9
9
|
class Tab(ScrollArea):
|
|
10
10
|
def __init__(self):
|
|
11
11
|
super().__init__()
|
|
12
|
+
self.name = ""
|
|
13
|
+
self.icon = FluentIcon.GAME
|
|
12
14
|
self.view = QWidget(self)
|
|
13
15
|
self.vBoxLayout = QVBoxLayout(self.view)
|
|
14
16
|
|
|
@@ -20,7 +20,7 @@ class ADBBaseInteraction(BaseInteraction):
|
|
|
20
20
|
super().send_key(key, down_time)
|
|
21
21
|
self.device_manager.device.shell(f"input keyevent {key}")
|
|
22
22
|
|
|
23
|
-
def swipe(self, from_x, from_y, to_x, to_y, duration):
|
|
23
|
+
def swipe(self, from_x, from_y, to_x, to_y, duration, settle_time=0.1):
|
|
24
24
|
self.device_manager.device.shell(f"input swipe {from_x} {from_y} {to_x} {to_y} {duration}")
|
|
25
25
|
|
|
26
26
|
def click(self, x=-1, y=-1, move_back=False, name=None, down_time=0.01, move=True):
|
|
@@ -23,14 +23,14 @@ class BaseInteraction:
|
|
|
23
23
|
def move(self, x, y):
|
|
24
24
|
pass
|
|
25
25
|
|
|
26
|
-
def swipe(self, from_x, from_y, to_x, to_y, duration):
|
|
26
|
+
def swipe(self, from_x, from_y, to_x, to_y, duration, settle_time):
|
|
27
27
|
pass
|
|
28
28
|
|
|
29
29
|
def middle_click(self, x=-1, y=-1, move_back=False, name=None, down_time=0.05):
|
|
30
30
|
logger.debug(f"middle_click {x, y}")
|
|
31
31
|
pass
|
|
32
32
|
|
|
33
|
-
def click(self, x=-1, y=-1, name=None):
|
|
33
|
+
def click(self, x=-1, y=-1, move_back=False, name=None, move=move, down_time=0.05):
|
|
34
34
|
if name is None:
|
|
35
35
|
logger.debug(f"click {x, y}")
|
|
36
36
|
else:
|
|
@@ -41,3 +41,6 @@ class BaseInteraction:
|
|
|
41
41
|
logger.debug(f"right_click {x, y}")
|
|
42
42
|
else:
|
|
43
43
|
logger.debug(f"right_click {name} {x, y}")
|
|
44
|
+
|
|
45
|
+
def on_run(self):
|
|
46
|
+
pass
|
|
@@ -78,7 +78,7 @@ class PostMessageInteraction(BaseInteraction):
|
|
|
78
78
|
def post(self, message, wParam=0, lParam=0):
|
|
79
79
|
win32gui.PostMessage(self.hwnd, message, wParam, lParam)
|
|
80
80
|
|
|
81
|
-
def swipe(self, x1, y1, x2, y2, duration=3):
|
|
81
|
+
def swipe(self, x1, y1, x2, y2, duration=3, settle_time=0.1):
|
|
82
82
|
# Move the mouse to the start point (x1, y1)
|
|
83
83
|
self.move(x1, y1)
|
|
84
84
|
time.sleep(0.1) # Pause for a moment
|
|
@@ -100,8 +100,9 @@ class PostMessageInteraction(BaseInteraction):
|
|
|
100
100
|
# Move the mouse to the end point (x2, y2) in small steps
|
|
101
101
|
for i in range(steps):
|
|
102
102
|
self.move(x1 + int(i * step_dx), y1 + int(i * step_dy), down_btn=win32con.MK_LBUTTON)
|
|
103
|
-
time.sleep(0.
|
|
104
|
-
|
|
103
|
+
time.sleep(0.01) # Sleep for 10ms
|
|
104
|
+
if settle_time > 0:
|
|
105
|
+
time.sleep(settle_time)
|
|
105
106
|
# Release the left mouse button
|
|
106
107
|
self.mouse_up()
|
|
107
108
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import time
|
|
2
2
|
|
|
3
3
|
import pydirectinput
|
|
4
|
-
|
|
5
4
|
from ok.Capture import BaseCaptureMethod
|
|
5
|
+
from ok.Util import is_admin
|
|
6
|
+
|
|
6
7
|
from ok.interaction.BaseInteraction import BaseInteraction
|
|
7
8
|
from ok.logging.Logger import get_logger
|
|
8
|
-
from ok.Util import is_admin
|
|
9
9
|
|
|
10
10
|
logger = get_logger(__name__)
|
|
11
11
|
|
|
@@ -16,6 +16,7 @@ class PyDirectInteraction(BaseInteraction):
|
|
|
16
16
|
|
|
17
17
|
def __init__(self, capture: BaseCaptureMethod, hwnd_window):
|
|
18
18
|
super().__init__(capture)
|
|
19
|
+
self.hwnd_window = hwnd_window
|
|
19
20
|
if not is_admin():
|
|
20
21
|
logger.error(f"You must be an admin to use Win32Interaction")
|
|
21
22
|
|
|
@@ -45,7 +46,7 @@ class PyDirectInteraction(BaseInteraction):
|
|
|
45
46
|
x, y = self.capture.get_abs_cords(x, y)
|
|
46
47
|
pydirectinput.moveTo(x, y)
|
|
47
48
|
|
|
48
|
-
def swipe(self, x1, y1, x2, y2, duration):
|
|
49
|
+
def swipe(self, x1, y1, x2, y2, duration, settle_time=0.1):
|
|
49
50
|
# Convert coordinates to integers
|
|
50
51
|
x1, y1 = self.capture.get_abs_cords(x1, y1)
|
|
51
52
|
x2, y2 = self.capture.get_abs_cords(x2, y2)
|
|
@@ -71,8 +72,9 @@ class PyDirectInteraction(BaseInteraction):
|
|
|
71
72
|
# Move the mouse to the end point (x2, y2) in small steps
|
|
72
73
|
for i in range(steps):
|
|
73
74
|
pydirectinput.moveTo(x1 + int(i * step_dx), y1 + int(i * step_dy))
|
|
74
|
-
time.sleep(0.
|
|
75
|
-
|
|
75
|
+
time.sleep(0.01) # Sleep for 10ms
|
|
76
|
+
if settle_time > 0:
|
|
77
|
+
time.sleep(settle_time)
|
|
76
78
|
# Release the left mouse button
|
|
77
79
|
pydirectinput.mouseUp()
|
|
78
80
|
|
|
@@ -136,3 +138,6 @@ class PyDirectInteraction(BaseInteraction):
|
|
|
136
138
|
|
|
137
139
|
def should_capture(self):
|
|
138
140
|
return self.capture.clickable()
|
|
141
|
+
|
|
142
|
+
def on_run(self):
|
|
143
|
+
self.hwnd_window.bring_to_front()
|
|
@@ -119,7 +119,7 @@ class Logger:
|
|
|
119
119
|
def exception_to_str(exception):
|
|
120
120
|
if exception is not None:
|
|
121
121
|
try:
|
|
122
|
-
stack_trace_str = traceback.format_exc()
|
|
122
|
+
stack_trace_str = traceback.format_exc()
|
|
123
123
|
except Exception as e:
|
|
124
124
|
stack_trace_str = f"Error formatting exception: {e}"
|
|
125
125
|
else:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
1
3
|
from ok.Capture import ImageCaptureMethod
|
|
2
4
|
|
|
3
|
-
import unittest
|
|
4
5
|
from ok.interaction.DoNothingInteraction import DoNothingInteraction
|
|
5
6
|
from ok.logging.Logger import get_logger
|
|
6
7
|
|
|
@@ -18,7 +19,7 @@ class TaskTestCase(unittest.TestCase):
|
|
|
18
19
|
|
|
19
20
|
if TaskTestCase._ok is None:
|
|
20
21
|
from ok.OK import OK
|
|
21
|
-
|
|
22
|
+
self.config['debug'] = True
|
|
22
23
|
TaskTestCase._ok = OK(self.config)
|
|
23
24
|
TaskTestCase._ok.task_executor.debug_mode = True
|
|
24
25
|
TaskTestCase._ok.device_manager.capture_method = ImageCaptureMethod(
|
|
@@ -38,6 +39,11 @@ class TaskTestCase(unittest.TestCase):
|
|
|
38
39
|
|
|
39
40
|
def set_image(self, image):
|
|
40
41
|
self._ok.device_manager.capture_method.set_images([image])
|
|
42
|
+
self.task.next_frame()
|
|
43
|
+
|
|
44
|
+
def set_images(self, *images):
|
|
45
|
+
self._ok.device_manager.capture_method.set_images(images)
|
|
46
|
+
self.task.next_frame()
|
|
41
47
|
|
|
42
48
|
def tearDown(self):
|
|
43
49
|
self.task.reset_scene()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
from ok.feature.Box import Box, sort_boxes
|
|
4
|
+
from ok.logging.Logger import get_logger
|
|
5
|
+
|
|
6
|
+
logger = get_logger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestUpdater(unittest.TestCase):
|
|
10
|
+
|
|
11
|
+
def test_sort_box(self):
|
|
12
|
+
logger.debug("start test_check_for_updates")
|
|
13
|
+
# Create an Updater instance with a mocked config
|
|
14
|
+
box1 = Box(0, 10, 10, 10)
|
|
15
|
+
box2 = Box(10, 10, 10, 10)
|
|
16
|
+
box_list = [box2, box1]
|
|
17
|
+
box_list_sorted = sort_boxes(box_list)
|
|
18
|
+
|
|
19
|
+
# Assert the function returned the expected result
|
|
20
|
+
self.assertEqual([box1, box2], box_list_sorted)
|
|
21
|
+
|
|
22
|
+
box1 = Box(120, 740, 147, 38, name='41乐进', confidence=0.9998183)
|
|
23
|
+
box2 = Box(461, 736, 149, 41, name='41左慈', confidence=0.99900174)
|
|
24
|
+
box_list = [box2, box1]
|
|
25
|
+
box_list_sorted = sort_boxes(box_list)
|
|
26
|
+
self.assertEqual([box1, box2], box_list_sorted)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if __name__ == '__main__':
|
|
30
|
+
unittest.main()
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok_script-0.0.332 → ok_script-0.0.333}/ok/rotypes/Windows/Security/Cryptography/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|