iholston / lol-bot

An account leveling bot for League of Legends written in Python
MIT License
306 stars 51 forks source link

doesn't move when in game #7

Closed DenisDanov closed 1 year ago

DenisDanov commented 1 year ago

Hello, when i start the bot everything goes fine until i get into game then nothing happens and i stay afk

iholston commented 1 year ago

This sometimes happens if you do not have a real mouse plugged in. Is there a mouse plugged in on your setup?

DenisDanov commented 1 year ago

Yes i have mouse plugged in and keyboard too

На пт, 5.05.2023 г., 20:23 ч. Isaac Holston @.***> написа:

This sometimes happens if you do not have a real mouse plugged in. Is there a mouse plugged in on your setup?

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1536559608, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCMB2HACKKP5BP5EXHLXEUZQJANCNFSM6AAAAAAXXKZV4I . You are receiving this because you authored the thread.Message ID: @.***>

iholston commented 1 year ago

Can you send some screenshots?

mbelhaouz commented 1 year ago

@iholston do you got discord to discuss in real time please? or add me on discord : Mahdi#9830

DenisDanov commented 1 year ago

When i tab out of league it starts clicking on everything but not in league also it changes my settings in game the resolution and window settings

На пт, 5.05.2023 г. в 20:50 ч. Isaac Holston @.***> написа:

Can you send some screenshots?

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1536584016, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCJKUVVKOHQ65JEERGDXEU4VLANCNFSM6AAAAAAXXKZV4I . You are receiving this because you authored the thread.Message ID: @.***>

anaquierealgo commented 1 year ago

When i tab out of league it starts clicking on everything but not in league also it changes my settings in game the resolution and window settings На пт, 5.05.2023 г. в 20:50 ч. Isaac Holston @.> написа: Can you send some screenshots? — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCJKUVVKOHQ65JEERGDXEU4VLANCNFSM6AAAAAAXXKZV4I . You are receiving this because you authored the thread.Message ID: @.>

@iholston do you got discord to discuss in real time please? or add me on discord : Mahdi#9830

Can you send some screenshots?

hello, what was the solution? I have the same problem

iholston commented 1 year ago

@DenisDanov @anaquierealgo the bot has use the mouse and keyboard to play the game. You unfortunately cannot be using your computer at the same time. I would recommend running the bot when you go to sleep and/or work if you only have one computer. Alternatively, you can try and get it running in a vm. But that may come with its own issues, see #6

iholston commented 1 year ago

As for it changing the window size/resolution, those settings are to ensure that the ratios work correctly. you can try changing the game.cfg file in resources and setting the Height and Width to whatever you like. But the mouse clicks might not work as intended.

If that is something you want to do you can use the ratio_builder.py to find new ratios for the buttons and/or modify the game.py file to suit your needs.

DenisDanov commented 1 year ago

I figured that i cant use my computer. I just tried now again i had only league opened i started the bot then i didnt touch anything and i noticed that it does move the mouse in league but it doesnt click on anything also there was a msg about the offscreen pings right on the items menu is it possible that this is the reason why it also cant buy any items ?

На сб, 6.05.2023 г., 01:48 ч. Isaac Holston @.***> написа:

@DenisDanov https://github.com/DenisDanov @anaquierealgo https://github.com/anaquierealgo the bot has use the mouse and keyboard to play the game. You unfortunately cannot be using your computer at the same time. I would recommend running the bot when you go to sleep and/or work if you only have one computer. Alternatively, you can try and get it running in a vm. But that may come with its own issues, see #6 https://github.com/iholston/lol-bot/issues/6

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1536865121, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCMDMZIR6I2DIY3PKX3XEV7UDANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

DenisDanov commented 1 year ago

Also i just saw that when i leave the game it tries to reconnect it moves the mouse to the reconnect button but again it doesnt click it. I noticed it clicks in the cmd window but not in league so i guess the problem is in something with the clicks

На сб, 6.05.2023 г., 01:48 ч. Isaac Holston @.***> написа:

@DenisDanov https://github.com/DenisDanov @anaquierealgo https://github.com/anaquierealgo the bot has use the mouse and keyboard to play the game. You unfortunately cannot be using your computer at the same time. I would recommend running the bot when you go to sleep and/or work if you only have one computer. Alternatively, you can try and get it running in a vm. But that may come with its own issues, see #6 https://github.com/iholston/lol-bot/issues/6

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1536865121, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCMDMZIR6I2DIY3PKX3XEV7UDANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

iholston commented 1 year ago

The intent of this bot is to level brand new accounts. The bot will only be able to purchase items if the shop is the the default spot. It clicks on an item and then clicks on the purchase button. if something is blocking the purchase button or the shop is in a non-default position then it wont be able to buy anything. As for moving, it right clicks on the nexus on the minimap.

iholston commented 1 year ago

if the clicking is altogether not working, Im not sure what exactly the problem or the solution could be.

DenisDanov commented 1 year ago

The account is new and its level 13 but the clicking works everywhere outside of league

На сб, 6.05.2023 г., 16:13 ч. Isaac Holston @.***> написа:

The intent of this bot is to level brand new accounts. The bot will only be able to purchase items if the shop is the the default spot. It clicks on an item and then clicks on the purchase button. if something is blocking the purchase button or the shop is in a non-default position then it wont be able to buy anything. As for moving, it right clicks on the nexus on the minimap.

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1537140032, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCLCUUHWI7GRN6QR3XLXEZE7PANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

iholston commented 1 year ago

Without some screenshots of or something more specific, I cannot really help you figure this out.

DenisDanov commented 1 year ago

Without some screenshots of or something more specific, I cannot really help you figure this out. Screenshot (1143) This is how the window of the client works and the cmd window it looks like everything works, but for example if i tab to the cmd window my mouse will move and click but when its in league it doesnt click thats the issue.

DenisDanov commented 1 year ago

Without some screenshots of or something more specific, I cannot really help you figure this out. Screenshot (1143) This is how the window of the client works and the cmd window it looks like everything works, but for example if i tab to the cmd window my mouse will move and click but when its in league it doesnt click thats the issue.

Screenshot (1146) this is offscreen ping window always shows up when i get into game too

iholston commented 1 year ago

Okay! So make sure the cmd is minimized all the clicks/button presses should go to the league game. the issue might be simply that another window (in this case cmd) is getting the clicks instead.

The league client works without mouse clicks because the bot communicates with the LCU API. The actual league game that opens afterward must be the active window to receive the clicks/button pressed the bot tries to make to play the game. The off-screen pings popup shouldnt effect anything as long as the league game window is on top.

anaquierealgo commented 1 year ago

¡Bueno! Así que asegúrese de que el cmd esté minimizado, todos los clics/pulsaciones de botones deben ir al juego de la liga. el problema podría ser simplemente que otra ventana (en este caso, cmd) está recibiendo los clics.

El cliente de la liga funciona sin clics del mouse porque el bot se comunica con la API de LCU. El juego de liga real que se abre después debe ser la ventana activa para recibir los clics/botones presionados que el bot intenta hacer para jugar el juego. La ventana emergente de pings fuera de la pantalla no debería afectar nada mientras la ventana del juego de la liga esté en la parte superior.

look at you, the mouse clicks on the link when the client window is not selected

https://youtu.be/nRqNSea2hL0

DenisDanov commented 1 year ago

Okay! So make sure the cmd is minimized all the clicks/button presses should go to the league game. the issue might be simply that another window (in this case cmd) is getting the clicks instead.

The league client works without mouse clicks because the bot communicates with the LCU API. The actual league game that opens afterward must be the active window to receive the clicks/button pressed the bot tries to make to play the game. The off-screen pings popup shouldnt effect anything as long as the league game window is on top.

Well when i minimize the cmd window and league is the main window the mouse stops moving and clicking its like the bot isnt on

iholston commented 1 year ago

@anaquierealgo is that running in a vm? I dont see the mouse cursor in the video. I have about 5 bots running and I just cant seem to recreate this issue directly (same issue @DenisDanov is having I assume). The only way I can recreate something similar is if there is no mouse connected. It should work without a keyboard but if there is no mouse then the keyboard inputs won't work either. The bot uses python's pyautogui, keyboard, and mouse libraries for clicks/button presses.

anaquierealgo commented 1 year ago

@anaquierealgo¿Eso se ejecuta en una máquina virtual? No veo el cursor del mouse en el video. Tengo alrededor de 5 bots en ejecución y parece que no puedo recrear este problema directamente (el mismo problema@DenisDanoves tener supongo). La única forma en que puedo recrear algo similar es si no hay un mouse conectado. Debería funcionar sin teclado, pero si no hay mouse, las entradas del teclado tampoco funcionarán. El bot usa las bibliotecas pyautogui, teclado y mouse de python para hacer clic o presionar botones. Look this, not is virtual. https://youtu.be/k3f_wjWgy5I

DenisDanov commented 1 year ago

@anaquierealgo is that running in a vm? I dont see the mouse cursor in the video. I have about 5 bots running and I just cant seem to recreate this issue directly (same issue @DenisDanov is having I assume). The only way I can recreate something similar is if there is no mouse connected. It should work without a keyboard but if there is no mouse then the keyboard inputs won't work either. The bot uses python's pyautogui, keyboard, and mouse libraries for clicks/button presses.

Is it possible that the issue is in the libraries then ?

anaquierealgo commented 1 year ago

I tried it on another pc with a resolution of 1980x1080 and it works, could that be the problem?

iholston commented 1 year ago

I don't think the resolution is the problem, I run the bots on 2k resolution. It is most likely something specific to the first machine you were using.

iholston commented 1 year ago

Is it possible that the issue is in the libraries then ?

Yea, something about your setup is causing them to not work correctly.

DenisDanov commented 1 year ago

Do u have any idea how can i fix this ?

На сб, 6.05.2023 г., 21:47 ч. Isaac Holston @.***> написа:

Is it possible that the issue is in the libraries then ?

Yea, something about your setup is causing them to not work correctly.

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1537200719, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCJXVR74QTOXP43GRMTXE2MC3ANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

iholston commented 1 year ago

Unfortunately I don't know how to fix your issue. It's not something wrong with the code so I can only recommend running it on a different setup. Let me know if you figure something out though.

mbelhaouz commented 1 year ago

@iholston i got an other question related to the features of the bot, are you planning to add some specific image computing to the bot so it can detect like ('ally', 'ennermy','towers'..) or any suggestions so i can do it myself.

Thanks for your time

iholston commented 1 year ago

@mbelhaouz I am not planning on adding any features regarding image computing atm as the bot does everything I need it to, and I don't like being locked into a specific resolution.

If you would like to fork the repo and implement it yourself the best place to start would most likely be pyautogui and opencv for image recognition which would be resolution specific or if you want to go more in depth i would recommend learncodebygaming's tutorials on vision recognition to create a machine learning solution that is resolution independent.

DenisDanov commented 1 year ago

Unfortunately I don't know how to fix your issue. It's not something wrong with the code so I can only recommend running it on a different setup. Let me know if you figure something out though.

I downloaded autoclicker so that way it doesnt kick me for afk in game but im level 21 already so bots games doesnt give me enough exp can u tell me how i can make the bot to start arams instead ?

iholston commented 1 year ago

I would not recommend aram for two reasons,

But if you still would like to play arams instead, simply change constants.py: GAME_LOBBY_ID = BEGINNER_BOTS_GAME_LOBBY_ID to GAME_LOBBY_ID = 450

Best of luck!

DenisDanov commented 1 year ago

Thanks for the feedback!

На пн, 8.05.2023 г., 16:20 ч. Isaac Holston @.***> написа:

I would not recommend aram for two reasons,

  • you will be reported every game
  • you don't get much more xp than beginner bots

But if you still would like to play arams instead, simply change: GAME_LOBBY_ID = BEGINNER_BOTS_GAME_LOBBY_ID to GAME_LOBBY_ID = 450

Best of luck!

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1538351784, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCPHIOWYJ4F5ZVDWC7DXFDXKHANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

anaquierealgo commented 1 year ago

No recomendaría aram por dos razones,

  • serás reportado cada juego
  • no obtienes mucho más xp que los bots principiantes

Pero si aún desea jugar arams, simplemente cambie constants.py: GAME_LOBBY_ID = BEGINNER_BOTS_GAME_LOBBY_ID a GAME_LOBBY_ID = 450

¡Toda la suerte!

Ty, Could you share your configuration so that the machine is not detected?

iholston commented 1 year ago

The current config of the repo is what I use. The bot itself will not be detected by riot games. However, the human players may report the bot if they think it is a bot. In beginner bot lobbies this doesn't happen because the bot behaves the way a new player would.

Aram, on the other hand, is filled with experienced players who may be able to tell that the bot is a bot and report it.

DenisDanov commented 1 year ago

Hello im sorry for spamming here again but do u know any free working auto clicker for league ? i used murgee autoclicker but i found out its paid after some time

iholston commented 1 year ago

I don't know any particular auto clicker off the top of my head. It is, however, rather easy to make your own. I would using recommend AutoHotKey to write a short script to keep you from going afk.

DenisDanov commented 1 year ago

Thanks for the tip!

На ср, 10.05.2023 г., 12:10 ч. Isaac Holston @.***> написа:

I don't know any particular auto clicker off the top of my head. It is, however, rather easy to make your own. I would using recommend AutoHotKey to write a short script to keep you from going afk.

— Reply to this email directly, view it on GitHub https://github.com/iholston/lol-bot/issues/7#issuecomment-1541637311, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JQVCJ6Y2WWF7W6PTRWO7TXFNLRFANCNFSM6AAAAAAXXKZV4I . You are receiving this because you were mentioned.Message ID: @.***>

enochos commented 1 year ago

uhh, i got that problom too

iholston commented 1 year ago

@enochos yea unfortunately this is not an issue with the software (as far as i can tell) but rather something with your set up. If you figure something out please let me know.

Nubidubi23 commented 1 year ago

Hi, sorry for necro but i've had this problem and fixed it by running the launcher.bat with admin rights. Also edit the launcher and instead of cd scripts use cd "C:\Users\you\InstallLocation\lol-bot\scripts"

YAAtanasov commented 1 year ago

Hi, sorry for necro but i've had this problem and fixed it by running the launcher.bat with admin rights. Also edit the launcher and instead of cd scripts use cd "C:\Users\you\InstallLocation\lol-bot\scripts"

@Nubidubi23 So on one hand openning with admin rights, but what do you mean with the CD scripts? Can you help me, I have the same problem as the author...

Also I get this message when I open the launcher with admin right: image

Nubidubi23 commented 1 year ago

Open your launcher.bat in notepad or something and change "cd scripts" to "C:\Users\you\InstallLocation\lol-bot\scripts" (change "you" to your username and "InstallLocation" to where the bot is installed)