Comments (7)
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.
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.
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.
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.
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 :
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](https://private-user-images.githubusercontent.com/113511834/248271151-5fc9fffb-2223-4fea-945d-1b946f777ed1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY5NDk2NzEsIm5iZiI6MTcxNjk0OTM3MSwicGF0aCI6Ii8xMTM1MTE4MzQvMjQ4MjcxMTUxLTVmYzlmZmZiLTIyMjMtNGZlYS05NDVkLTFiOTQ2Zjc3N2VkMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNTI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDUyOVQwMjIyNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04OGMxYjM2MjQxNWIwNDQxMjM4MWE0ZGRmMWExOTk5ZmE0ZDQ5Y2Q2NWIxYzJlMDk1Mjc3NjM4MWFiZjdkZmNjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.TTIbiBm1IgJekolUyUqjuGhG9Bww0zOmtUyxrug8vAg)
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.
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.
That was it ! It works now <3
Thank you so much !
from lor-bot.
Related Issues (20)
- Nexus health recognition HOT 1
- Script halts HOT 5
- Contributions HOT 1
- Harrowing error HOT 5
- Bot not passing turn when it has no mana/no moves HOT 4
- Any recommended decks other than the 3 on Readme? HOT 13
- Unknown mana HOT 15
- Make the bot choose AI games instead of play
- Make a suggestion about 'Unknown mana' HOT 1
- Can we get sets.json directly? HOT 1
- Stuck on Targeted Spell HOT 2
- Multiple HOT 10
- Whenever I open the program it immediately crashes. HOT 1
- New Endscreen for victories bricks the bot. HOT 13
- bot still not working HOT 5
- errno2 error
- ModuleNotFoundError: No module named 'cv2' HOT 4
- pls update HOT 1
- if u have some error with passing, try mine HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lor-bot.