圖色識別,自動操作滑鼠/鍵盤(可後臺運行),將一切重複的事,抽象為函數,自動運行。
Project description
HappyLife
HappyLife 解決重複無聊的事情,自動操作滑鼠/鍵盤,打遊戲刷副本/日常任務;線上課程定期機器人驗證。
不做重複的事,體驗有趣的事,讓人生更輕鬆。
安裝方法:
pip install HappyLife
依賴關係
安裝HappyLife會自動安裝依賴套件
使用教學
後臺操作(綁定窗口後,可以後臺運行,但窗口不能最小化,使用者可做別的事情)
from auto import Bw # 引入類別
# 綁定夜神模擬器方法 bw = Bw("夜神模擬器")
# 綁定雷電模擬器方法(需額外綁定子窗口) bw = Bw('雷電模擬器'); bw.bind_child_window(0)
bw.img_click(bw,'0.png') # 點擊圖片 bw.img_drag(bw,'1.png','2.png') # 拖拽圖片,滑鼠從圖片1座標拖拽到圖片2座標的位置 bw.lclick(55,64) # 左鍵單擊 bw.lclick2(55,64) # 左鍵雙擊 bw.rclick(55,64) # 右鍵單擊
前臺操作(必須在當前窗口,才能運行,使用者無法做別的事情,通常後臺操作無效時才會使用此方法)
from auto import Fd # 引入類別
Fd.img_click('1.png') # 點擊圖片 Fd.img_drag('1.png','2.png') # 拖拽圖片,滑鼠從圖片1座標拖拽到圖片2座標的位置 Fd.lclick(55,64) # 左鍵單擊 Fd.lclick2(55,64) # 左鍵雙擊 Fd.rclick(55,64) # 右鍵單擊 Fd.keypress(65) # keypress(按鍵代碼,按下X秒後自動鬆開) Fd.key_down(65) # 按鍵按下,key_down(按鍵代碼) Fd.key_up(65) # 按鍵鬆開,key_up(按鍵代碼)
# 打開檔案/資料夾/網址 Fd.open_file("D:\\code\\123.py") Fd.open_file("C:\\Program Files (x86)\\Windows Defender") Fd.open_file("http://www.j4.com.tw/big-gb/")
- 如果使用前臺操作,無法自動操作滑鼠鍵盤,請用系統管理員身份啓動腳本
依序執行任務的方法
# 要執行的任務列表 tasks = [ (img_click, "81.png"), (img_click, "82.png"), (img_click, "83.png"), (img_click, "84.png") ] # 按照順序執行任務 execute_tasks_in_sequence(tasks)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
happylife-1.1.0.tar.gz
(11.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
HappyLife-1.1.0-py3-none-any.whl
(10.9 kB
view details)
File details
Details for the file happylife-1.1.0.tar.gz.
File metadata
- Download URL: happylife-1.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21bc5430c0e24821b31f503a7a44fa769386cc7470085800c33af81636f94acc
|
|
| MD5 |
8ef6e1c3d83997a8be93dd23058a1de8
|
|
| BLAKE2b-256 |
f29e6c3961601aa89c2a53e39dcc2d0778b96a57472b6aaa4ebacc1c3b2e857d
|
File details
Details for the file HappyLife-1.1.0-py3-none-any.whl.
File metadata
- Download URL: HappyLife-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6374f37ce4d589e9fef5d936f99107a0a5ed2e111850bb2fa17d52d12a26e6c8
|
|
| MD5 |
6b360eaa272be6adc2d805ced128b206
|
|
| BLAKE2b-256 |
74ce3041700acfddc1d4b6af9c10d02a867d82ce0bcd2200a2693dd2d98b7bc7
|