Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Future of TFT OCR BOT #325

Open
anthony5301 opened this issue May 3, 2024 · 18 comments
Open

The Future of TFT OCR BOT #325

anthony5301 opened this issue May 3, 2024 · 18 comments
Assignees
Labels
question Further information is requested

Comments

@anthony5301
Copy link
Collaborator

Hello jfd02,

With the launch of Vanguard, the Win32 API on Windows (used for pydirectinput) has become unavailable. I believe this repository could take one of three directions:

  1. Transition to macOS platform without Vanguard. However, I don't have an Apple computer, so I may not be able to continue developing the bot.
  2. Transition to an Android emulator, still running on Windows. This would require modify many things to control the emulator.
  3. Archive this repository.

Please tell me if you have any thoughts.

@anthony5301 anthony5301 added the question Further information is requested label May 3, 2024
@Sizzzles
Copy link

Sizzzles commented May 4, 2024

Using pynput is possible but the concern would be Vanguard in general.
Here is code using pynput. I'm sure delays will need to be fine tuned
mk_functions.txt

@anthony5301
Copy link
Collaborator Author

anthony5301 commented May 4, 2024

Using pynput is possible but the concern would be Vanguard in general.

no way they didnt block pynput on LOL vanguard?
cuz I know those lib and win32 are blocked on valorant's vanguard long time ago....

@Sizzzles
Copy link

Sizzzles commented May 5, 2024

Spaghetti code is too strong I guess.
I assume pyautogui wouldn't work should probably just try everything at this point

@anthony5301
Copy link
Collaborator Author

On the contrary, I don't want to continue taking risks on Windows. You never know when this powerful backdoor program Vanguard might get you banned for using those input control lib.

@Sizzzles
Copy link

Sizzzles commented May 5, 2024

True... Feel like emulators might end up to laggy if ran for long periods of time since this bot is used for farming passes or maybe I've just chosen bad emulators in the past. But might be the only good option since a fair few people won't have macOS

@anthony5301
Copy link
Collaborator Author

The current issue is that it takes 0.5-0.8 seconds each time to capture a screenshot from the emulator using adb shell. We need to find a way to share one screenshot among multiple functions as much as possible. Otherwise, just waiting for adb to return the screenshot would consume all the game round time.

This is the most ideal approach because it's entirely controlled through adb, it will still running even if the emulator is at background. However, if performance issues cannot be resolved, I will choose to fix the screen size of the emulator to 1920x1080 and control it using the original method.

@Sizzzles
Copy link

Sizzzles commented May 5, 2024

Yes adb is ideal but it is slow as you mentioned. Just from using the Alune bot that uses adb it doesn't buy champions until halfway through the round or later. It's using images for actions which I don't think is ideal but I honestly have no idea if custom comps would be possible like what OCR BOT was doing.
I also wouldn't know where to start to help out since I struggled enough with the auto comps version of OCR BOT due to not knowing much coding

@anthony5301
Copy link
Collaborator Author

I'm almost done with the fully adb-based version of TFT-OCR-BOT. I've removed the UI display feature, and there are no issues with other functionalities. The main modification involves replacing some inputs with swipe, queue without riot api, coords. However, due to the delay caused by adb, it's practically unusable. I'll be shifting towards "full-screen emulator" direction, and adb will only be used to check if TFT is installed and to open it.

@Sizzzles
Copy link

Sizzzles commented May 5, 2024

Interested to see how it turns out. You could also use adb to set resolution of the emulators (if aren't just using on one emulator) assuming they aren't set to 1920x1080 by default... Honestly any settings that needs to be changed from the default that adb has the ability to change would be a good idea makes it more user friendly

@jfd02
Copy link
Owner

jfd02 commented May 15, 2024

Sorry for the late reply. I primarily use macOS now and don't play much League anymore, so it's hard for me to provide input on the best future direction for this repo. I believe any functional solution is preferable to archiving it, but ultimately, the decision is up to you (or any other contributors)

When I first started building the bot, I used BlueStacks, expecting this version to be detected early on, and relied on screen capture. However, the placement of UI elements made things more complicated. Since I wrote most of the original code while learning to program, there's a lot that could be done better. Moving to ADB seems like a significant refactor, so I'm open to the idea of archiving this repo. You could create your own repo, and we can link to it in the README of this one if you prefer that.

Thanks for maintaining it throughout all the updates! @anthony5301

@rayhahn
Copy link

rayhahn commented May 16, 2024

Using pynput is possible but the concern would be Vanguard in general. Here is code using pynput. I'm sure delays will need to be fine tuned mk_functions.txt

On my subcomputer, this bot puts items in champs, but on my main computer, it doesn't put items in champs. The difference between the two computers is that main computer is Windows 10 and the subcomputer is Windows 11. I tried shutting it down just in case the Corsair keyboard program was a problem, but it didn't work. The two computers differ only in the Windows version under exactly the same conditions. I hope this problem is solved.

@anthony5301
Copy link
Collaborator Author

However, the placement of UI elements made things more complicated.

Yes, the unique UI design on the mobile version requires the bot to spend time carefully recognizing the current screen. Just toggling the shop took me several days of off-work time. Sometimes when fixing bugs, I feel like just buying a M2 Mac mini for bot is the best choice xd, just not sure how much RAM is needed. If I buy a Mac, I may convert this repository into a Mac version, and then create a new repository for the emulator version.

Although I did use adb, it was minimal, such as setting the emulator's screen size and dpi, checking if TFT was installed and opening it. For other parts, I used the same method to control the emulator window because using adb for input and take screenshot are extremely slow.

@kizxlove
Copy link

This morning I heard that vanguard just started to ban all account that using LoL API without their permission from 22 May. It mean that tft bot will be risks from now on.

@anthony5301
Copy link
Collaborator Author

This morning I heard that vanguard just started to ban all account that using LoL API without their permission from 22 May. It mean that tft bot will be risks from now on.

On the day Vanguard arrived in LoL, the bot was already a risk because Vanguard can block and monitor all Win32API actions that control the keyboard and mouse.

@anthony5301
Copy link
Collaborator Author

and we have other methods to remove those bots for now.

He said this, and I believe they can identify which key is being pressed by AHK, only remap some key to other key are acceptable. Although our bot only requires simple mouse clicks, similar to remapping a button. I wouldn't want to take any risks while vanguard is running.

@kizxlove
Copy link

it's been month since the day vanomegalulguard released. Is there any guys got trouble yet?

@matejkadlec
Copy link

matejkadlec commented Dec 18, 2024

  1. Transition to macOS platform without Vanguard. However, I don't have an Apple computer, so I may not be able to continue developing the bot.

If TFT has macOS or Linux version without Vanguard, you can simply use virtual machine, fow Linux you could maybe even use WSL.

Edit: I did a bit of research and indeed you can play TFT or LoL on macOS without Vanguard, so that seems like valid solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants