Detergent13 / tft-bot

Automate Teamfight Tactics (TFT) for token/mission farming. Updated for Set 11!
GNU Affero General Public License v3.0
82 stars 45 forks source link

8.5 PBE Issue with Surrender #117

Closed RomeoAlphaEkko closed 1 year ago

RomeoAlphaEkko commented 1 year ago

As of today the surrender button has been "greyed" out.

Surrender is only possible by typing on the keyboard aka /ff

i dont know if it is a bug or not, but if not it will be an inssue once it goes live

Detergent13 commented 1 year ago

Odd change from Riot lol. Thanks for the heads up, I'll keep an eye out!

RomeoAlphaEkko commented 1 year ago

The new loading screen is out, so possible capture is Evelyn in the top right and they changed the options button so most likely a recapture there

RomeoAlphaEkko commented 1 year ago

sadly the ff-bug is still there

my first idea was like:

    auto.press('enter')  
    auto.press(['/', 'f', 'f'])
    auto.press('enter') 

but that doesnt seem tow ork

-- 7 days till live

Detergent13 commented 1 year ago

I'll recapture the loading screen when I get the chance.

If I remember correctly, auto's key input doesn't work with DirectX games. (Hence why ffing currently works by just clicking on buttons, refreshing doesn't use D, etc.) The solution is to use the pydirectinput library for any key inputs. Let me know if that ends up going live and I'll implement it. (I think should be almost the exact same since pydirectinput was developed with pyautogui in mind?)

RomeoAlphaEkko commented 1 year ago

settings

unsure when they implement the new gui, so best not to preemtively use it

loading

atm they have like daily patchdays, and tons of bugs, like after each tft, the game crashes instead of closing, ... well server should be up in about 1h, so i might test pydirectinput then, ill keep you informed

edit: test with pydirectinput is done, the codeline itself seems to be small:

`def surrender(): while not onscreen("./captures/surrender 2.png"): checks() # added a check here for the rare case that the game ended before the surrender finished. pydirectinput.press(['enter', '/', 'f', 'f', 'enter'])

time.sleep(1)
click_to("./captures/surrender 2.png")
time.sleep(10)

time.sleep(1)

end_match()

time.sleep(5)

print_timer()

print("Queuing up again! (Surrender)")
queue()`

BUT somehow it wrotes - instead of / googling only brought up others with the same problem but no solution

Edit 2: last idea i found was using key strokes to simulate keystrokes, but it seems that that depends on the users keyboard aka englisch french, greek, keyboard layouts, so it wold require user adjustment

RomeoAlphaEkko commented 1 year ago

ok, good news, if it goes like that to live, i have (for me) a working version,

but it depends on the keyboard, so each user might have to update it and it may not be change 7 with .

i think we should wait till it is live next week and then re evaluate

RomeoAlphaEkko commented 1 year ago

ok they included it, give me a bit for the pull

Detergent13 commented 1 year ago

Sorry- I keep on meaning to respond to this. Exams are occupying near 100% of my brain at the moment! Thank you for your work as always. I'll push the new loading screen now.

Please let me know if you need any help with the surrender fix. More than happy to collaborate. My thought on your bug would be that maybe on whatever keyboard layout it's using, - is the non-shifted version of / or something?

Also, I found a workaround of maybe trying pydirectinput.press('divide') instead?

RomeoAlphaEkko commented 1 year ago

pydirectinput.press('divide')

is a '-'

Detergent13 commented 1 year ago

So strange. I wonder if placing a string in the clipboard and pasting it in would work? But I think League might have its own 'clipboard system' though. And definitely not a good idea to inject anything.

RomeoAlphaEkko commented 1 year ago

pull request done, tests run successfully