From 7b5e7633279aa0f56f515a6d8efe95adc87173ef Mon Sep 17 00:00:00 2001 From: Astatin3 <77305074+Astatin3@users.noreply.github.com> Date: Wed, 1 May 2024 07:51:13 -0600 Subject: [PATCH] Update --- bot/CMakeLists.txt | 9 ++++---- bot/README.md | 53 +++------------------------------------------- bot/main.cpp | 1 + bot/run.sh | 2 ++ 4 files changed, 10 insertions(+), 55 deletions(-) create mode 100755 bot/run.sh diff --git a/bot/CMakeLists.txt b/bot/CMakeLists.txt index 6c18e05..822273c 100644 --- a/bot/CMakeLists.txt +++ b/bot/CMakeLists.txt @@ -4,7 +4,7 @@ project(McConnectBot) set(CMAKE_CXX_STANDARD 23) set(BOTCRAFT_GAME_VERSION 1.12.2) set(BOTCRAFT_BUILD_DOC OFF) -set(BOTCRAFT_OUTPUT_DIR "/tmp/") +#set(BOTCRAFT_OUTPUT_DIR "/home/astatin3/Documents/GitHub/meteorbot/bot/bin/") add_executable(McConnectBot main.cpp CommandClient.cpp @@ -17,16 +17,15 @@ find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) # Link libraries statically (except OpenSSL) -set(Boost_USE_STATIC_LIBS ON) -find_package(Boost REQUIRED COMPONENTS system filesystem) +#set(Boost_USE_STATIC_LIBS ON) +#find_package(Boost REQUIRED COMPONENTS system filesystem) target_link_libraries(McConnectBot PRIVATE - ${Boost_LIBRARIES} # Removed paths to static OpenSSL libraries botcraft ) # Set output directory to place the binary set_target_properties(McConnectBot PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${BOTCRAFT_OUTPUT_DIR}/bin" ) diff --git a/bot/README.md b/bot/README.md index 92f77cd..b305d4d 100644 --- a/bot/README.md +++ b/bot/README.md @@ -1,50 +1,3 @@ -![command line program](https://github.com/Urpagin/McConnectBot/assets/72459611/f0b54f49-50ca-461e-985a-deff9ba00b7c) -![five bots saying the same thing at the same time](https://github.com/Urpagin/McConnectBot/assets/72459611/c9dbb529-a0b7-43b0-838b-5b9c36739de6) - -## Purpose -Made to connect *n* number of bots to a Mincraft server, in offline mode though. -Then those bots all have the possibility to send simultaneously a command. - -## Disclaimer -This is, for now, a quick project done swiftly to get to learn C++. -So this is no good-looking repo. - -## Requirements -### Building -- Git -- CMake & Make -- g++ -### Dependencies -- Boost -- OpenSSL -### Install all dependecy (Debian-based command) -Command to install all required packages on Debian-based Linux distributions. -```bash -sudo apt-get install libssl-dev g++ git openssl cmake libboost-all-dev -y -``` -### Auto installs & builds for you (Debian-based command) -```bash -sudo apt-get install libssl-dev g++ git openssl cmake libboost-all-dev -y && git clone --recurse-submodules https://github.com/Urpagin/McConnectBot.git && cd McConnectBot && mkdir build && cd build && cmake .. && make -j$(nproc) && echo 'Now execute with ./bin/McConnectBot' -``` - -## How to install - -```bash -git clone --recurse-submodules https://github.com/Urpagin/McConnectBot.git -``` - -```bash -cd McConnectBot && mkdir build && cd build -``` - -```bash -cmake .. -``` -Good luck if you only have a few cores. Grab a drink -```bash -make -j$(nproc) -``` -Congratulations! (hopefully nothing explodes or bugs out) -```bash -./bin/McConnectBot -``` +# MeteorBot +- The cmake file should autodownload everything it needs. +- Because of Botcraft using relative paths, and that isn't the best for \ No newline at end of file diff --git a/bot/main.cpp b/bot/main.cpp index eeb14bb..fa9571a 100644 --- a/bot/main.cpp +++ b/bot/main.cpp @@ -50,6 +50,7 @@ int main(int argc, char* argv[]) // Botcraft::ConnectionClient client; CommandClient client(false); + client.SetAutoRespawn(true); // CommandClient client(true); // LOG_INFO("Starting connection process"); diff --git a/bot/run.sh b/bot/run.sh new file mode 100755 index 0000000..05cf916 --- /dev/null +++ b/bot/run.sh @@ -0,0 +1,2 @@ +cd /home/astatin3/Documents/GitHub/meteorbot/bot/bin +./McConnectBot \ No newline at end of file