TFT-OCR-BOT icon indicating copy to clipboard operation
TFT-OCR-BOT copied to clipboard

The Future of TFT OCR BOT

Open anthony5301 opened this issue 10 months ago • 17 comments

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 avatar May 03 '24 18:05 anthony5301

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

Sizzzles avatar May 04 '24 18:05 Sizzzles

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....

anthony5301 avatar May 04 '24 19:05 anthony5301

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

Sizzzles avatar May 05 '24 00:05 Sizzzles

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.

anthony5301 avatar May 05 '24 04:05 anthony5301

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

Sizzzles avatar May 05 '24 05:05 Sizzzles

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.

anthony5301 avatar May 05 '24 10:05 anthony5301

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

Sizzzles avatar May 05 '24 11:05 Sizzzles

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.

anthony5301 avatar May 05 '24 11:05 anthony5301

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

Sizzzles avatar May 05 '24 22:05 Sizzzles

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

jfd02 avatar May 15 '24 03:05 jfd02

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.

rayhahn avatar May 16 '24 14:05 rayhahn

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.

anthony5301 avatar May 16 '24 16:05 anthony5301

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.

kizxlove avatar May 23 '24 01:05 kizxlove

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 avatar May 23 '24 02:05 anthony5301

https://www.reddit.com/r/leagueoflegends/comments/1cwne6a/comment/l4xxy7a/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

is using auto hot key an option?

jfd02 avatar May 25 '24 22:05 jfd02

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.

anthony5301 avatar May 25 '24 23:05 anthony5301

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

kizxlove avatar May 29 '24 15:05 kizxlove