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

Buying champ then selling it directly #15

Open
AmineMessabhia opened this issue Feb 3, 2022 · 14 comments
Open

Buying champ then selling it directly #15

AmineMessabhia opened this issue Feb 3, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@AmineMessabhia
Copy link

Hello man,
First, I'd like to thank you for this tremendous work, gg wp!!

After using it for some time, I notice that sometimes, the bot buys Illaoi or Tristana for example, then they don't get a name in the overlay, and right after the buying phase, he sells them, and the log says: Selling unknown champion.

Is there any way this can be fixed? because it makes the comp aways on a 1-star champs.

Oh, one more question, is there any way to make it work with 1366x768 monitors? I tried it on a laptop, and it is stuck at "Loading screen found! Waiting for round 1-1"

Thanks again!!

@AmineMessabhia
Copy link
Author

I've just watched the bot play, and I was able to take screenshots of the problem:

Round 3-6
r3-6

Round 3-7
r3-7

Round 4-5
r4-5

Notice how the champs are bought, then not added in the overlay, then treated as unknown and sold.

@ffb7c5
Copy link
Collaborator

ffb7c5 commented Feb 3, 2022

Is it trying to place items after already in PVP in the last screen shot? Also I assume you modified the "level": 2 in the comps.py file?

@AmineMessabhia
Copy link
Author

AmineMessabhia commented Feb 4, 2022

Here's my comp file:
image

It's not about items, the items are working perfectly, the problem is that it buys a champ, then it doesn't show in the overlay, then it sells it directly.

@MrDumox
Copy link

MrDumox commented Feb 4, 2022

I'm also getting this problem and script tries to put items during PVP

@AmineMessabhia
Copy link
Author

In the comp.py file, the Level, is it the level of the champ? (1 star, 2 stars, 3stars?) or the level of the Tactician?

@AmineMessabhia
Copy link
Author

I'm also getting this problem and script tries to put items during PVP

Sometimes, and especially after the PVE fight (against raptors and others), the script takes a lot of time to gather the items, to the point that when it is done, and it goes into the buying champ phase it does buy, then in the log it shows "Placing CHAMP on board" but the PVP fight has already started, and the champ is still benched.

This sometimes leads to a random champ taking a random hex, but the overlay still shows the CHAMP (that has been bought) is placed.

@AmineMessabhia
Copy link
Author

@jfd02 Any idea about this behavior?

@ffb7c5
Copy link
Collaborator

ffb7c5 commented Feb 11, 2022

@AmineMessabhia

Sorry for the delay, was taking a break.
How are your PC specs? The only time this has happened to me is when I run the game on a PC with old hardware. On the code side the only thing that can be done is either make the bot not perform any actions on item pickup rounds or come up with a way to pick up items efficiently.

To be honest, I'm not sure how to implement the solution I have in mind and would need someone to contribute to this.

My idea is to calculate the location of the orbs on the board using using the RGB codes of the orb (I can do this part), once you have these positions I assume you would need to find the position on the screen to click which can't be on the board because it may be on top of a champion. So you take your position and the target position, find the slope of the line and calculate the first position where x is farther right then the board and click there. Then you would need to recalculate for the next orb on the board.
The only problem I see with this is orbs can overlap each other and the color changes slightly.

Picture for better example:

Board

@BrandTime
Copy link

Is it possible to read game memory? Just like the project of Lmeme. It is easy to get items object world position, you can filter it by object name, then use worldToScreen and click it. Meanwhile, it make everything becoming easy. It can never fail when check bench hero. (I never get 3 star hero, because it will sell all bench hero when it will be successful. )

@ffb7c5
Copy link
Collaborator

ffb7c5 commented Feb 12, 2022

Is it possible to read game memory? Just like the project of Lmeme. It is easy to get items object world position, you can filter it by object name, then use worldToScreen and click it. Meanwhile, it make everything becoming easy. It can never fail when check bench hero. (I never get 3 star hero, because it will sell all bench hero when it will be successful. )

Yeah its possible

@AmineMessabhia
Copy link
Author

How are your PC specs?

ASU GL553VD:

  • GTX 1050 2 GB VRAM (League always runs at 140 fps)
  • 16 GB RAM
  • i7-7th gen

@jfd02 jfd02 added the bug Something isn't working label Jul 7, 2022
@esbe1175
Copy link

esbe1175 commented Sep 2, 2022

You should probably try resetting league of legends' internal brightness/vibrance/contrast sliders to default values.

i boldly assume it uses some sort of image recognition to detect each champion, which any deviance from how the software knows a champion is supposed to look (like changing it's color levels) would make it harder for it or in some cases impossible to detect.

Reason i'm saying this is your screenshot looks abnormally bright compared to what it should look like at default values.

Feel like it's a good guess, but i didn't have a look under the hood nor the expertise to make sense of most any of it.

These are the ones im talking about, by the way:
image

@jfd02
Copy link
Owner

jfd02 commented Sep 2, 2022

There is no image recognition in the bot, only OCR and checking pixel colors. So it may be possible the color settings do mess with the health bar color which is a way the bot checks if a slot is occupied which may mess things up. I'm not confident the logic isn't at fault either though as there is a lot of edge cases such as picking up an orb causing a champion on the board to change tiers, removing the champions on the bench.

@esbe1175
Copy link

esbe1175 commented Sep 2, 2022

Ah, I see. Worth mentioning anyway.

I think specifically the UI is unaffected by those values actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants