Installation
General
pip install aclib.autowin
Work with dm
pip install aclib.autowin[dm]
Work with cv
pip install aclib.autowin[cv]
Add Windows.Graphics.Capture support for cv
pip install zbl
Full installation
pip install aclib.autowin[full]
Usage
# base typing
from aclib.autowin import _Pos, _Size, _Area, _Areas
# base api
from aclib.autowin import BaseWindow, screen, Window
# create win32 application
from aclib.autowin.appwindow import AppWindow
# css typing
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from aclib.autowin.appwindow._typing import _AppCSS
# use opencv
from aclib.autowin.cvwindow import CvWindow # [cv] requires
# use dm plugin
from aclib.autowin.dmwindow import DmWindow # [dm] requires
Examples
from aclib.autowin.cvwindow import CvWindow
# Get window
win = CvWindow.findwindow('游戏窗口标题')
if not win:
raise Exception('not found window')
# Enable Windows.Graphics.Capture(WGC).
# If the target window doesn't support GDI capture, use WGC.
# Run "pip install zbl" with a 64-bit python first.
win.cv_start_wgc()
# Release WGC
win.cv_stop_wgc()
# Show capture to test if cvwindow works or not
cap = win.cvcapture()
cap.show(usebrowser=True)
# Find color
area = (0, 0, 1920, 1080)
target = win.cvfindcolor('ffffff|000000--222222|888888-101010', area)
targets = win.cvfindcolors('ffffff|000000--222222|888888-101010', area)
print(target)
# Set dotsetlib
dlib = CvWindow.DotsetLib.fromfile(r"点阵库路径")
win.cvset(dlib=dlib)
# Find dotset
area = (0, 0, 1920, 1080)
target = win.cvfinddotset('点阵名称', area)
targets = win.cvfinddotsets('点阵名称', area)
print(target)
# Set fontlib
flib = CvWindow.FontLib.fromfile(r"字库路径")
win.cvset(flib=flib)
# Find text
area = (0, 0, 1920, 1080)
target = win.cvfindtext('文本', area)
targets = win.cvfindtexts('文本', area)
line_targets = win.cvocr(area)
print(target)
# use target
print(target.name)
print(target.start)
print(target.center)
print(target.end)
print(target.similarity)
target.click_if_exists()
if not target:
print('not found target')
Metadata
Release files for aclib.autowin 1.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aclib_autowin-1.5.5.tar.gz | 18.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aclib_autowin-1.5.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.3 kB
Release files / aclib_autowin-1.5.5.tar.gz
| Download URL | aclib_autowin-1.5.5.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f290e96768c18ef14c6357f88a2305d046b136507d9cd7c931e57fc7fbef6f3
|
|
BLAKE2b-256 checksum How to use checksums |
0426f826a3dce8df965716a8a8a3d6c58c902650224e781b8d65398368a48fa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.1
|
Release files / aclib_autowin-1.5.5-py3-none-any.whl
| Download URL | aclib_autowin-1.5.5-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7ddf226cf1b10130986dea0791ccbf92c431f6a720f48a875ef4c3f3a861c29
|
|
BLAKE2b-256 checksum How to use checksums |
941af881780e4704b4f7d2a13bda5467c9e0fe5ca0e6f75e4a46f442b5e9896f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.1
|
Security for aclib.autowin 1.5.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.