iholston / lol-bot

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

New features #190

Closed SP-l33t closed 10 months ago

SP-l33t commented 10 months ago

Hey!

I've added some new features to your bot in my Pull Request.

I can add some more. If you have any good ideas, I might take a look and see if I can implement.

iholston commented 10 months ago

Sounds good, I'll take a look this weekend and get back to you. Glad to have you on board!

mynothingg commented 10 months ago

How could I increase the loading time before it terminates the instance and attempts to reconnect?

SP-l33t commented 10 months ago

If you are talking about increasing max game length, then you need to change MAX_GAME_TIME in game.py file. Otherwise I need some more details and logs.

mynothingg commented 10 months ago

I have a machine that is using a slow hard drive, and the loading screen takes so long that the bot terminates the game instance and tries to reconnect, resulting in an infinite cycle and failure to connect to the game. However, I haven't located where specifically in the code it addresses the loading screen time, and I would like to increase it a bit.

On my computer, which has an SSD, I've never had this issue. It's only on the machine with a slow HDD that the game never starts. After a few minutes, when it's almost finished loading and about to enter the game, the bot invokes the command KILL_LEAGUE = 'TASKKILL /F /IM "League of Legends.exe"', and then it tries to reconnect again, causing an infinite loop.

But it's just a detail; I'm not sure if I did it in the best way, but I ended up increasing the parameters below, and it seems to have solved the problem.

    self.log.debug("Waiting for game window to open")
    for i in range(600):

    self.log.debug("Connecting to game server...")
    for i in range(600):

        if not utils.exists(utils.LEAGUE_GAME_CLIENT_WINNAME):
            raise utils.WindowNotFound
        if self.connection_errors == 1000:

        if not utils.exists(utils.LEAGUE_GAME_CLIENT_WINNAME):
            raise utils.WindowNotFound
        if self.connection_errors == 1000:
iholston commented 10 months ago

@mynothingg yea that is the correct place to solve the issue. Glad its working for you now..

SP-l33t commented 10 months ago

Closed. Futher discussions will be moved to the Pull Request.