Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9a9853f
added kha_lastz
khahv Feb 27, 2026
c45770b
add some function
khahv Feb 27, 2026
e3e09d0
complete fight boomer function
khahv Feb 27, 2026
8164b4d
add pin login function
khahv Feb 27, 2026
a19941e
testing multi scale match
khahv Feb 27, 2026
4286ea5
using fixed resolution approach -> work perfect
khahv Feb 27, 2026
82bbe3c
update new functions
khahv Feb 28, 2026
6821b60
add doc and attack_detector logic
khahv Feb 28, 2026
4420af3
update debug
khahv Feb 28, 2026
a375ecc
ignore logs
khahv Feb 28, 2026
55968fa
attack detector with turnon shield automatically
khahv Feb 28, 2026
5d24b57
enhance shield activate and logout dectector
khahv Feb 28, 2026
0d97d3d
enhance treasure click
khahv Mar 1, 2026
3e26fbd
working stable
khahv Mar 1, 2026
bcd0c69
update config and main logic; disable FightBoomer, add CollectZGoldFu…
khahv Mar 1, 2026
ad66088
backup v1
khahv Mar 1, 2026
e7fe138
test 1
khahv Mar 2, 2026
22f7180
test 2
khahv Mar 3, 2026
76d8da4
fastclick with python lib
khahv Mar 7, 2026
54671c9
testing zalo msg
khahv Mar 9, 2026
1a42206
testing UI with scroll and fix freeze issue at startup
khahv Mar 9, 2026
6747c97
fixed false alarm zalo message
khahv Mar 10, 2026
77c9da4
test portrait screen
khahv Mar 11, 2026
2193e6a
testing 1080x1920 res
khahv Mar 11, 2026
b78fe4c
fix some template image for portrait screen
khahv Mar 12, 2026
8a19e94
Untrack .env_config file
khahv Mar 12, 2026
98c3704
tesing mini potrait size
khahv Mar 12, 2026
4efe7ec
add easyocr load
khahv Mar 12, 2026
2d018d6
feat: Replace AKAZE with Distance Transform & TM_CCOEFF_NORMED Fallback
khahv Mar 13, 2026
7bf8acd
go back to matchTemplate with optimization
khahv Mar 13, 2026
1c782b8
enhance & add more template image
khahv Mar 13, 2026
3222f6b
enhance matchTemplate
khahv Mar 13, 2026
f43b648
fix pinloggin
khahv Mar 13, 2026
680d443
remove unused files
khahv Mar 13, 2026
ed1bcb0
update trigger being attacked and alliance being attacked
khahv Mar 14, 2026
e973d44
testing drag windows
khahv Mar 14, 2026
9d8b6c2
added rule for cursor, enhance close_ui & base_zoomout event
khahv Mar 15, 2026
ede100e
Add new collectdailyreward function and event world_zoomout
khahv Mar 15, 2026
c3bc1de
enhance detector
khahv Mar 16, 2026
46172f0
make function & event more robust
khahv Mar 18, 2026
efc6307
enhance DoRadarTask
khahv Mar 18, 2026
fb86a6f
enhance radar & fury attack
khahv Mar 18, 2026
e2bffb1
change to openocr, reorganize even code
khahv Mar 19, 2026
01f0213
migrated all to openocr
khahv Mar 19, 2026
afa9500
update fightboomer ocr & add new functions
khahv Mar 19, 2026
73f8f84
allow function to run multiple times
khahv Mar 19, 2026
764a969
fix bug & add multi language
khahv Mar 21, 2026
be8faf7
fix minor bug
khahv Mar 21, 2026
3585715
remove unused files
khahv Mar 21, 2026
0855b31
test adb
khahv Mar 21, 2026
3b2f92e
fix switch emulator bug
khahv Mar 21, 2026
57591a8
test adb 1
khahv Mar 21, 2026
cc19192
add adb support
khahv Mar 21, 2026
02dd37e
fix minor bug
khahv Mar 22, 2026
fd47296
add option to turn off send_zalo in ClickTreasure
khahv Mar 22, 2026
7b63461
enhance ClickTreasure
khahv Mar 23, 2026
e498dc2
fix Arena attack
khahv Mar 23, 2026
ecc0b97
enhance clicktreasure param
khahv Mar 23, 2026
c54932e
add mouse shake detector and fix bugs
khahv Mar 24, 2026
5e43a1c
revert back require admin
khahv Mar 24, 2026
3937d8e
update preview window
khahv Mar 24, 2026
a4fa9f5
fix bug, add more log
khahv Mar 24, 2026
6dfd2a4
enhance shortcut key & rectangle draw around window game
khahv Mar 25, 2026
64665c9
add sleep to TruckPlunder
khahv Mar 25, 2026
1c421ad
modify some log
khahv Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions .cursor/rules/coding-standards.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
description: Project-wide coding standards — English-only docs/comments, Python naming, reuse, and clean code
alwaysApply: true
---

# Coding Standards

All prompts and changes in this project must follow these rules.

---

## Language

- **Comments and documentation must be in English** (including docstrings, README, DOCS.md, and inline comments).
- User-facing strings (logs, UI) may stay in the project’s existing language if that is the current convention.

---

## Python Naming Conventions

Follow PEP 8; use these consistently:

| Kind | Convention | Example |
|------|------------|--------|
| **Modules / files** | `snake_case` | `bot_engine.py`, `window_capture.py` |
| **Functions / methods** | `snake_case` | `get_screenshot()`, `find_template()` |
| **Variables / parameters** | `snake_case` | `screenshot`, `threshold`, `max_tries` |
| **Constants** | `UPPER_SNAKE_CASE` | `DEFAULT_THRESHOLD`, `MAX_RETRIES` |
| **Classes** | `PascalCase` | `FunctionRunner`, `Vision` |
| **Private** (module/class internal) | leading `_` | `_advance_step()`, `_roi_bounds` |
| **“Protected” / internal** | leading `_` | `_base_zoomout_search_img()` |

- Avoid single-letter names except for trivial loop indices (e.g. `i`, `j`).
- Prefer descriptive names; avoid abbreviations unless very common (e.g. `img`, `rect`, `cfg`).

---

## Before Adding New Code

- **Check if equivalent logic already exists** (same module, other modules, or helpers). Reuse or extend it instead of duplicating.
- **Search the codebase** for similar behavior (e.g. “find template”, “click at position”) before implementing from scratch.
- Prefer **small, focused functions** that can be reused; avoid long inline blocks that do multiple unrelated things.

---

## Clean & Reusable Code

- **DRY**: Do not repeat yourself; extract shared logic into functions or helpers.
- **Single responsibility**: Each function/class should do one clear thing.
- **Reusability**: Prefer parameters and config over hardcoded values so behavior can be reused.
- **Readability**: Prefer clear control flow and named variables over clever one-liners.
- **No premature optimization**: Write simple, correct code first; optimize only when needed and with evidence.

---

## After Editing Python (agents)

- **Always verify Python syntax** after finishing work on any `.py` files—do not treat the task as complete until syntax checks pass.
- Run, for example:
- `python -m py_compile path/to/changed_file.py` for each modified file, or
- `python -m compileall -q path/to/touched_package` when many files under one directory changed.
- Fix any `SyntaxError` or compile failures before concluding the task.

---

## Additional Rules

- **Type hints**: Use type hints for function parameters and return values when they clarify intent or public APIs; not required for every trivial helper.
- **Docstrings**: Add docstrings (in English) for public functions, classes, and non-obvious behavior.
- **Error handling**: Prefer explicit handling and logging over bare `except`; avoid silencing errors without a clear reason.
- **Imports**: Group and order imports (stdlib → third-party → local); avoid unused imports.
- **Formatting**: Keep line length reasonable (e.g. ≤120 chars); break long lines for readability.
4 changes: 4 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
kha_lastz_auto/__pycache__/
kha_lastz_auto/.venv312
kha_lastz_auto/playwright_zalo_data/
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
__pycache__
/pydirectinput.egg-info
/build
/dist
/dist
**/logs
**/.env
**/.env_config
kha_lastz_auto/.env_config
kha_lastz_auto/playwright_zalo_data/
kha_lastz_auto/debug/
kha_lastz_auto/debug_ocr/
kha_lastz_auto/debug_close_ui/
kha_lastz_auto/debug_exclude/
Binary file removed 001_intro/albion_cabbage.jpg
Binary file not shown.
Binary file removed 001_intro/albion_farm.jpg
Binary file not shown.
69 changes: 0 additions & 69 deletions 001_intro/main.py

This file was deleted.

Binary file removed 001_intro/result.jpg
Binary file not shown.
Binary file removed 001_intro/result_CCOEFF_NORMED.jpg
Binary file not shown.
Binary file removed 002_match_multiple/albion_cabbage.jpg
Binary file not shown.
Binary file removed 002_match_multiple/albion_copper.jpg
Binary file not shown.
Binary file removed 002_match_multiple/albion_copper_needle.jpg
Binary file not shown.
Binary file removed 002_match_multiple/albion_farm.jpg
Binary file not shown.
53 changes: 0 additions & 53 deletions 002_match_multiple/main.py

This file was deleted.

Binary file removed 002_match_multiple/result.jpg
Binary file not shown.
Binary file removed 003_group_rectangles/albion_cabbage.jpg
Binary file not shown.
Binary file removed 003_group_rectangles/albion_farm.jpg
Binary file not shown.
Binary file removed 003_group_rectangles/albion_turnip.jpg
Binary file not shown.
91 changes: 0 additions & 91 deletions 003_group_rectangles/main.py

This file was deleted.

Binary file removed 003_group_rectangles/result_click_point.jpg
Binary file not shown.
33 changes: 0 additions & 33 deletions 004_window_capture/main.py

This file was deleted.

Loading