diff --git a/.gitignore b/.gitignore index 79c528f..eef87fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ screenshot.png last_game_xp.png -./dbd/ +dbdAfk/ config.ini diff --git a/README.md b/README.md index 3733708..ce14f2b 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,13 @@ - **Anti-AFK Proof**: Ensures consistent actions to prevent AFK kicks. - **Banner-Proof**: Handles cases where survivors disconnect during loading screens. - **Killer Behaviors**: Implements various killer powers to maximize bloodpoints gain. -- **XP Gain**: Achieves up to 4000 XP per hour (excluding queue times). - **Web Panel**: Allows you to control the script remotely. - **Overlay**: Shows logs and stats in game (for single monitor users <3) + + ## Behaviors @@ -37,26 +40,13 @@ You can configure the script's behavior at `https://localhost:5000` ## Intallation -> [!WARNING] -> This script is designed for 1920x1080 display. If you are using a higher resolution display please set it to 1920x1080 in windows' display settings. - 1. Download and unpack this repository 2. Install python 3.12 (3.13+ DOESN'T WORK!!!) 3. Install NVIDIA CUDA (it does work on every GPU) from [here](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64). Select your Windows version, and then "local exe". -4. After CUDA is installed, download pytorch -``` -pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 -``` -5. Install python requirements (or use setup.bat, first time only): -``` -pip install -r requirements.txt -``` -6. Run the script (or use start.bat): -``` -python src/main.py -``` - -NOT WORKING? [Check this](https://github.com/Pazdikan/dbd-xp-farm/issues/6) +4. After CUDA is installed, run `setup.bat` to install dependencies +5. Run the script using `start.bat` + +Batch files create a virtual environment for python, so that pip packages are seperated from your main python install. This is to avoid dependency conflicts. ## Bans diff --git a/setup.bat b/setup.bat index 39a9971..a5d8807 100644 --- a/setup.bat +++ b/setup.bat @@ -1 +1,28 @@ -pip install -r requirements.txt \ No newline at end of file +@echo off +if not exist dbdAfk ( + echo "Creating dbdAfk virtual environment for python..." + python -m venv dbdAfk +) + +echo "Checking for NVIDIA CUDA installation..." +where nvcc > nul 2>&1 +if %errorlevel% neq 0 ( + echo "WARNING: NVIDIA CUDA not found! Please install CUDA Toolkit (this is for detecting text from game (like buttons))." + echo "You can download it from: https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64" + echo "" + echo "If you did install CUDA, restart your computer and run this script again." + echo "If it still doesn't work after restart, try google lol and do not open an issue please." + pause + exit +) + +echo "Activating dbdAfk virtual environment..." +call dbdAfk\Scripts\activate + +echo "Installing requirements... This will take a moment depending on your internet speed." + +pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 +pip install -r requirements.txt + +echo "Setup complete. Run 'start.bat' to start the bot." +pause \ No newline at end of file diff --git a/src/main.py b/src/main.py index b2b3a57..7f97186 100644 --- a/src/main.py +++ b/src/main.py @@ -1,4 +1,6 @@ import warnings + +import pyautogui warnings.filterwarnings("ignore", category=FutureWarning) from time import sleep @@ -18,6 +20,14 @@ console.clear() log(Text("Initializing...", style="green")) +screen_width, screen_height = pyautogui.size() + +if screen_width != 1920 or screen_height != 1080: + log(Text("Script requires 1920x1080 resolution! Current: {}x{}".format(screen_width, screen_height), style="red")) + log(Text("Set your resulution to 1920x1080 in Windows display settings.", style="blue")) + log(Text("\n\nSorry about that, I know that's annoying. I'm too lazy to implement dynamic button positions ;<")) + sys.exit(1) + def run_main_app(): with mss() as sct: data.ss = Screenshot(sct) diff --git a/start.bat b/start.bat index b364247..a776de3 100644 --- a/start.bat +++ b/start.bat @@ -1 +1,12 @@ -python src/main.py \ No newline at end of file +@echo off +if not exist dbdAfk ( + echo "Calling setup.bat to create dbdAfk virtual environment and install dependencies..." + call setup.bat +) + +echo "Activating dbdAfk virtual environment..." +call dbdAfk\Scripts\activate + +echo "Running the application..." +python src/main.py +pause \ No newline at end of file