Skip to content

Commit

Permalink
Added bash scripts to be run inside the docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Aug 9, 2024
1 parent bba514b commit fb60f15
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions GuildWarsPartySearch.Bot/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake -B linuxbuild -G "Ninja" && ninja -C linuxbuild
10 changes: 10 additions & 0 deletions GuildWarsPartySearch.Bot/check_and_update_gw_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
dpkg -s python3 > /dev/null 2>&1 || (
apt install python3 pip -y;
pip install tqdm;
pip install pefile;
);
python3 ./Dependencies/Headquarter/tools/update_binary.py;
mkdir -p ./data;
cp -ura ./Dependencies/Headquarter/data/* ./data;
cp -ura ./Dependencies/Headquarter/Gw.build Gw.build;
29 changes: 29 additions & 0 deletions GuildWarsPartySearch.Bot/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

NOW=$(date '+%Y-%m-%d_%H-%M-%S')

BIN_DIR=$PWD/linuxbuild/bin;

# Absolute path to client executable
CLIENT_EXE=$BIN_DIR/client;
# Absolute path to log file
LOG_FILE=$PWD/logs/$NOW.txt;
# Contains the build version number of guild wars
BUILD_VERSION_FILE=$PWD/Gw.build;
# Absolute location of plugin on disk
PLUGIN_EXE=$BIN_DIR/libGuildWarsPartySearch.Bot.so;

# TODO: ENV vars
RUN_EMAIL="${EMAIL:-null@arenanet.com}";
RUN_PASSWORD="${PASSWORD:-nopassword}";
RUN_CHARACTER="${CHARACTER:-No Character}";
RUN_MAP_ID="${MAP_ID:-0}";
RUN_DISTRICT="${DISTRICT:-0}";

# Absolute log
LOG_DIR=$(dirname "$LOG_FILE")
rm -R $LOG_DIR;
mkdir -p $LOG_DIR;
touch $LOG_FILE;

"$CLIENT_EXE" -email "$RUN_EMAIL" -character "$RUN_CHARACTER" -district "$RUN_DISTRICT" -mapid "$RUN_MAP_ID" -password "$RUN_PASSWORD" -l "$LOG_FILE" -file-game-version "$BUILD_VERSION_FILE" "$PLUGIN_EXE"

0 comments on commit fb60f15

Please sign in to comment.