TeamFightTacticsBots / Alune

Mobile TFT Bot - Automate Teamfight Tactics in the mobile version through emulators, to farm pass exp and event tokens.
GNU Affero General Public License v3.0
55 stars 8 forks source link

How to adjust bounding box for Heroes Dawn of Survival TFT Mode #59

Closed turtlechipschocolate closed 1 month ago

turtlechipschocolate commented 1 month ago

Program works as intended for Normal TFT.

I was trying to modify the program to allow me to use it in Heroes Dawn of Survival mode (only 3 weeks or so left).

One thing I modified was the button that is required (changed from the sword to the image of the HDOS mode).

Another thing I realized is that there is a bounding box required for location on where to click. That being said, when I am using OpenCV to grab the coordinates, I am getting X = 519, Y = 583, W = 84, H = 51.

If I can get the code for bounding box used and the image that was referenced, that would be significant help!

image

akshualy commented 1 month ago

You can define new buttons in the Buttons class.

When defining the button, we differentiate between buttons you actively look for by image (traits for example) and buttons that you just know the position of that don't have an associated image (like store cards for example).

Afterwards, you can just get the button on the screen with the appropriate method: https://github.com/TeamFightTacticsBots/Alune/blob/e3a8290da2c246ccb9bb3c9121cc7a7a24b1440e/main.py#L236-L241

turtlechipschocolate commented 1 month ago

I will give it a shot and see how it goes ..

akshualy commented 1 month ago

Dawn of heroes is now supported in 0.1.5.