AxelBjork / Rush-Royale-Bot

Python based bot for Rush Royale
MIT License
29 stars 19 forks source link

Cant get work #58

Open Bienli333 opened 1 year ago

Bienli333 commented 1 year ago

Hey thx for your work, but i cant get work.

Newest bluestacks, followed your instructions, but adb cant get connected or crash afrer connected…

maybe because bluestacks uses adb version 36 and your bot adb version is 41? Or how i can solve this?

EDIT: after reinstall bluestacks, i got the same error crash but now its open the game if i only in bluestacks and not the game and then it crash with the same message

C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main>call .bot_env\Scripts\activate.bat
* daemon not running; starting now at tcp:5037
* daemon started successfully
Scanning 127.0.0.1 Ports 60000 - 65000
connected to 127.0.0.1:62758
Started 1667 threads
Ports Open: [62758]
Found ADB device! 127.0.0.1:62758
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\.bot_env\lib\site-packages\adbutils\_adb.py", line 88, in read
    return self._read_fully(n)
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\.bot_env\lib\site-packages\adbutils\_adb.py", line 96, in _read_fully
    chunk = self.conn.recv(t)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\Src\gui.py", line 102, in start_bot
    self.bot_instance = bot_handler.start_bot_class(self.logger)
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\Src\bot_handler.py", line 63, in start_bot_class
    bot = bot_core.Bot()
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\Src\bot_core.py", line 39, in __init__
    self.client.start(threaded=True)
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\.bot_env\lib\site-packages\scrcpy\core.py", line 189, in start
    self.__deploy_server()
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\.bot_env\lib\site-packages\scrcpy\core.py", line 177, in __deploy_server
    self.__server_stream.read(10)
  File "C:\Users\Admin\Downloads\Rush-R1dfdfffff11oyale-Bot-main\Rush-Royale-Bot-main\.bot_env\lib\site-packages\adbutils\_adb.py", line 90, in read
    raise AdbTimeout("adb read timeout")
adbutils.errors.AdbTimeout: adb read timeout
Bienli333 commented 1 year ago

@AxelBjork i got a new error... wow...

if i change from scrcpy 1.24 to 1.25 in the bot handler, then it works half...

download('https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-win64-v1.25.zip', 'scrcpy.zip')

With 1.25 its starting half... Also on every bot start, its downloading the 1.25 again (idk why)

new:

C:\Users\Admin\Downloads\Rush Royal Bot\Rush-Royale-Bot-main>call .bot_env\Scripts\activate.bat
100%|█████████████████████████████████████████████████████████████████████████████| 36.5M/36.5M [00:01<00:00, 25.2MB/s]
Rush Royale Bot v1.1                 |
|                                    |
|             ,.___          ___....--._
|           ,'     `""""""""'           `-._
|          J           _____________________`-.
|         F         .-'   `-88888-'    `Y8888b.`.
|         |       .'         `P'         `88888b \
|         |      J       #     L      #    q8888b L
|         |      |             |           )8888D )
|         J      \             J           d8888P P
|          L      `.         .b.         ,88888P /
|           `.      `-.___,o88888o.___,o88888P'.'
|             `-.__________________________..-'
|                                    |
|         .-----.........____________J
|       .' |       |      |       |
|      J---|-----..|...___|_______|
|      |   |       |      |       |
|      Y---|-----..|...___|_______|
|       `. |       |      |       |
|         `'-------:....__|______.J
|                                  |
 L___                              |
     """----...______________....--'
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\threading.py", line 980, in _bootstrap_inner
    self.run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Admin\Downloads\Rush Royal Bot\Rush-Royale-Bot-main\Src\gui.py", line 107, in start_bot
    self.bot_instance.bot_stop = False
AttributeError: 'NoneType' object has no attribute 'bot_stop'

same problem from this #36 but no help to solve this error @IonutP

Bienli333 commented 1 year ago

Hmmm, think i solved it? idk, it works now...

i changed in the port_scan.py

from time.sleep(3) # Give real client 3 seconds to connect to time.sleep(15) # Give real client 3 seconds to connect

and

from socket.setdefaulttimeout(0.01) to socket.setdefaulttimeout(10)