Skip to content

Commit

Permalink
Refactor setup process and update README for installation clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazdikan committed Jan 18, 2025
1 parent c5b978f commit a400c9f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
screenshot.png
last_game_xp.png
./dbd/
dbdAfk/
config.ini


Expand Down
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- ## Stats
<image graph of stats shown here > -->


## Behaviors

Expand Down Expand Up @@ -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
Expand Down
29 changes: 28 additions & 1 deletion setup.bat
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
pip install -r requirements.txt
@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
10 changes: 10 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import warnings

import pyautogui
warnings.filterwarnings("ignore", category=FutureWarning)

from time import sleep
Expand All @@ -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)
Expand Down
13 changes: 12 additions & 1 deletion start.bat
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
python src/main.py
@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

0 comments on commit a400c9f

Please sign in to comment.