Giter VIP home page Giter VIP logo

Comments (7)

ajdc2 avatar ajdc2 commented on August 18, 2024

Btw I am playing with the correct screen resolution and the quality set to medium. It seems the error where the cursor repeats the movement sequence to select the deck and launch the game indefinitely is more frequent.

from lor-bot.

MOj0 avatar MOj0 commented on August 18, 2024

Hmm... now the issue where it repeats Selecting deck... over and over is quite strange. The bot gets the state of the game directly from the API of the Legends of Runeterra itself and does not use any image recognition (at least for distinction between In Menu and In Game states). This API is called here.

I would suggest to check if you have third party endpoints enabled and set them to port 21337 (the 4th bullet point in the prerequsite section).

If the issue still occurs I would ask you to go debug it and print the values of the state machine component while an active game (not the menus) is running. The values are set here.

from lor-bot.

ajdc2 avatar ajdc2 commented on August 18, 2024

Thank you for replying so fast !

I have tried to close the game and re-open in. Since then I cannot reproduce the selecting deck issue, only the unknown mana one. I confirm that i have third party endpoints enabled with 21337. The screen resolution is the one required, and I have tried all graphic settings from low to ultra with no success. Is there something else I should consider ?

Also, could you explain how I can go to debug ? I'm really sorry, I am not very good at this...

from lor-bot.

MOj0 avatar MOj0 commented on August 18, 2024

Sure. So I've only tested this on a 1080p monitor on fullscreen. If you have a monitor with a different resolution, you will have to run it in windowed mode (which won't work unfortunately, but can be fixed) or fullscreen on a smaller resolution, which I assume won't work either because the image will be stretched or somewhat skewed. If you have a monitor which does not have 1080p resolution, the best option is to run it in windowed and modify the code such that it takes the height of the window title bar into account, otherwise it will try to look for mana values in the wrong spot.

To debug it in VS Code at least, you need to set a breakpoint to a certain line in the code (F9) and then run in it debug mode (F5). You will then be able to see all the variables and their values at the point in the program. Let me know if you need any additional help.

from lor-bot.

ajdc2 avatar ajdc2 commented on August 18, 2024

Okay so I didn't quite manage to do it with the debug method because I can't get VS code to work. I usually run it either though terminal using :
py path/lor_bot noPVP
or simply by double clicking on the icon (then it goes into pvp mode).

So I tried to add a print(state_machine) at line 54 in LOR_bot.py since I figured that was the idea ? This is what I get :
Capture d’écran 2023-06-23 à 14 44 28

I struggled to take the screen because of the scrolling but basically after this I get like unknown mana... followed by 20 or so lines of the State_Machine.State_Machine etc line, repeating indefinitely. The 0x number doesn't change in the course of the game, but if I close the bot and restart it I get a different one. I still haven't been able to reproduce the "selecting deck" error.

Does this help in any way ? If not, are there any other values I can print() that would be helpful to you ? Worst case scenario I can try to install an actual program to run python like Spyder.

Also, could it be that I start the bot wrong ? What I do is I launch LoR, then alt tab to the folder with the bot or to the windows terminal to run lor_bot, then I wait for this window to pop :

Capture d’écran 2023-06-23 à 14 47 16

And then I manually go back to the LoR window and wait for the bot to kick in. If I don't manually go back then the bot just moves and clicks on top of that black terminal window repeatedly. Am I doing this right ?

Sorry for being such a noob, thanks for your patience...

from lor-bot.

MOj0 avatar MOj0 commented on August 18, 2024

Ah, don't worry about it 😄.
Now that I saw that screenshot I think I know what the issue could be. Since you're using a laptop, you very have a 125% scaling. That messes with the screen recognition for some reason. The scale has to be at 100% on 1920x1080 full screen resolution.
Regarding your print, you're getting the memory address of where the state machine is in your RAM :) . When you use print you'll have to print the values of the objects, not the objects themselves (or I should implement some sort of __to_string or whatever Python uses to print it out nicely, by default it prints its memory address).
You don't need any external programs like Spyder. The bot is already running just fine.
And yeah, that is the expected way to run it, since bot does not know what window it is clicking on, it is simply clicking on the screen coordinates.

from lor-bot.

ajdc2 avatar ajdc2 commented on August 18, 2024

That was it ! It works now <3

Thank you so much !

from lor-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.