lucasmonstrox / PyTibia

🤖 Fastest Tibia PixelBot. A great bot for Auto, Cavebot, Healing, Macro, Refill, Targeting and Training!
MIT License
266 stars 62 forks source link

[BUG] - Error when starting. #94

Open beks0nn opened 2 months ago

beks0nn commented 2 months ago

Describe the bug when running poetry install i get and error saying :

Installing the current project: PyTibia (0.1.0)
Warning: The current project could not be installed: No file/folder found for package pytibia
If you do not want to install the current project use --no-root.
If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
In a future version of Poetry this warning will become an error!

and whe ntrying to run the bot with poetry run python main.py there is an error after a few seconds. $ poetry run python main.py

Traceback (most recent call last):
  File "C:\git\PyTibia\main.py", line 2, in <module>
    from src.gameplay.threads.pyTibia import PyTibiaThread
  File "C:\git\PyTibia\src\gameplay\threads\pyTibia.py", line 4, in <module>
    from src.gameplay.cavebot import resolveCavebotTasks, shouldAskForCavebotTasks
  File "C:\git\PyTibia\src\gameplay\cavebot.py", line 2, in <module>
    from src.repositories.gameWindow.creatures import hasTargetToCreature
  File "C:\git\PyTibia\src\repositories\gameWindow\creatures.py", line 8, in <module>
    from src.repositories.radar.config import walkableFloorsSqms
  File "C:\git\PyTibia\src\repositories\radar\config.py", line 86, in <module>
    floorsPathsSqms = np.load(f'{currentPath}/npys/floorsPathsSqms.npy')
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\pytibia-YUUO83Xo-py3.11\Lib\site-packages\numpy\lib\npyio.py", line 427, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\git\\PyTibia\\src\\repositories\\radar/npys/floorsPathsSqms.npy'

after trying to debug abit it looks like the problem that buildFloorsPaths.py is never ran so radar/npys/floorsPathsSqms.npy is never created.

To Reproduce Steps to reproduce the behavior: clean project poetry install poetry run python main.py

Expected behavior expect radar/npys/floorsPathsSqms.npy to exist

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

beks0nn commented 2 months ago

get same error when running unittests ==================================================================================================== short test summary info ==================================================================================================== ERROR tests/unit/gameplay/core/tasks/test_attackClosestCreature.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_depositGold.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_depositItems.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_dropFlasks.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_useRopeWaypoint.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_useShovelWaypoint.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_walkToCoordinate.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/gameplay/core/tasks/test_walkToWaypoint.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/core/test_getBreakpointTileMovementSpeed.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/core/test_getClosestWaypointIndexFromCoordinate.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/core/test_isCloseToCoordinate.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/core/test_isCoordinateWalkable.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/core/test_isNonWalkablePixelColor.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/extractors/getRadarImg/test_getRadarImg.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' ERROR tests/unit/repositories/radar/locators/getRadarToolsPos/test_getRadarToolsPos.py - FileNotFoundError: [Errno 2] No such file or directory: 'C:\git\PyTibia\src\repositories\radar/npys/floorsPathsSqms.npy' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 15 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!