Skip to content

Commit

Permalink
V2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
feijoes committed Oct 6, 2024
1 parent 15daa65 commit 139d416
Show file tree
Hide file tree
Showing 24 changed files with 478 additions and 420 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruff==0.6.9
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
__pycache__
venv
venv
.ruff_cache
error_log.txt
error/*
Binary file added Images/END.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Images/End.jpeg
Binary file not shown.
Binary file removed Images/FIGHT.jpeg
Binary file not shown.
Binary file removed Images/FIGHT2.jpeg
Binary file not shown.
Binary file modified Images/OK.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Images/OK2.jpeg
Binary file not shown.
Binary file added Images/STA.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Images/START.jpeg
Binary file not shown.
Binary file added Images/START.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

The Dokkan Battle EZA Farming Bot is a Python script designed to automate the process of farming the Extreme Z-Awakening levels in Dragon Ball Z Dokkan Battle. The script runs on your computer and interacts with the game on your phone.

_This bot is no a autoclicker_; it not only completes the levels but also manages the current level of the EZA and switches between different EZAs.



If you encounter any errors or have any doubts, you can create an issue or contact me at [email protected].

## Features
Expand All @@ -20,6 +16,8 @@ If you encounter any errors or have any doubts, you can create an issue or conta
- It identifies buttons and actions using images, so it can adapt to different screen sizes and resolutions.
- Can swipe bettwen eza and only

***Tip***: If the bot doesn’t seem to be working correctly, particularly if it's failing to detect buttons or actions in the game, try replacing the images in the script with screenshots from your own game setup. These images are used to identify in-game elements, and if your screen layout differs, custom screenshots may improve accuracy.

## Requirements

1. You need an Android device with USB debugging enabled. This allows the script to communicate with the phone via a USB cable.
Expand Down Expand Up @@ -65,11 +63,3 @@ This project is intended for educational and personal use only. The use of autom
## Contributing

Contributions to this project are welcome! If you encounter any issues, have suggestions for improvements, or want to add new features, feel free to open an issue or submit a pull request.

## License

This project is licensed under the [MIT License](LICENSE).

---

Feel free to modify the README according to your project's specific details, and don't forget to add a proper license file (e.g., `LICENSE`) to your project if you plan to share it with others.
32 changes: 32 additions & 0 deletions debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from adbutils import adb
from src.image import ImageProcessor
import cv2
import numpy as np

device = adb.device()

image_path = "Images/OK2.jpeg"
image_processor = ImageProcessor()


class Debug:
@staticmethod
def draw_rectangle_around_match(screenshot, top_left, w, h):
cv2.rectangle(
screenshot, top_left, (top_left[0] + w, top_left[1] + h), (255, 0, 0), 2
)
cv2.imshow("Matched Image", screenshot)
cv2.setWindowProperty("Matched Image", 1, cv2.WINDOW_NORMAL)
cv2.waitKey(0)
cv2.destroyAllWindows()


screenshot = np.array(device.screenshot().convert("RGB"), dtype=np.uint8)
template_image = cv2.imread(image_path)

found, x, y = image_processor.find_image_position(template_image, screenshot, threshold=0.8)

if found:
Debug.draw_rectangle_around_match(screenshot, (x, y), *template_image.shape[:2])
else:
print(f"Image {image_path} not found in current screen.")
Loading

0 comments on commit 139d416

Please sign in to comment.