From 1660a043c50cfe4d8c485e9322d76debaeccbdc2 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sun, 26 Mar 2017 13:02:39 +0300 Subject: [PATCH] update readme, trying to fix autoteam --- README.md | 54 +++++++++++++++++++++++++++++++++------- src/hooks/CreateMove.cpp | 10 ++++++-- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1dffa5ed..b11c3cd1 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,50 @@ # Disclaimer I know that the style sucks. There is a lot of design errors and cancerous patterns. Most of the code was intended to be *temporary*. -# Compilation -`git submodule update --init --recursive` after cloning, then -`cd cathook && make -j4` - -Compilation issues? Try installing `g++-multilib`! - -# Injection -`sudo ./attach-backtrace` if you want to see backtrace after the game crashes. - # Discord Server [Official Discord Server](https://discord.gg/RywBUSc) + +# You need g++\-6 to compile/use cathook + +### Full install script for ubuntu (installs g++\-6 and cathook) +``` +sudo apt-get update && \ +sudo apt-get install build-essential software-properties-common -y && \ +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ +sudo apt-get update && \ +sudo apt-get install gcc-snapshot -y && \ +sudo apt-get update && \ +sudo apt-get install gcc-6 g++-6 g++-6-multilib -y && \ +git clone --recursive https://github.com/nullifiedcat/cathook && \ +cd cathook && \ +make -j4 +``` + +### Updating cathook +Navigate into cathook directory (where src, makefile and other files are) and run: +``` +git pull origin master && \ +git submodule update --remote --recursive && \ +make clean && \ +make -j4 +``` + +# Injection +`sudo ./attach` to attach to tf2 process (can take argument number 0-N - # of tf2 instance to attach to (for bots)) + +`sudo ./attach-backtrace` to attach and print backtrace if tf2 crashes. Some users reported that this method makes you get less FPS ingame. + +# Followbots + +To run followbots, you need to download and install `cathook-ipc-server`. + +### Installing script +``` +git clone --recursive https://github.com/nullifiedcat/cathook-ipc-server && \ +cd cathook-ipc-server && \ +make -j4 +``` +### Updating script is the same as updating cathook + +### Running followbot server +`./bin/cathook-ipc-server` or `./bin/cathook-ipc-server &>/dev/null &` to run it in background diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 9c3c45f5..c3637b41 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -104,9 +104,15 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { static int team_joining_state = 0; static float last_jointeam_try = 0; - if (g_GlobalVars->curtime < last_jointeam_try) last_jointeam_try = 0.0f; + if (g_GlobalVars->curtime < last_jointeam_try) { + team_joining_state = 0; + last_jointeam_try = 0.0f; + } - if (!g_pLocalPlayer->team || (g_pLocalPlayer->team == TEAM_SPEC)) team_joining_state = 1; + if (!g_pLocalPlayer->team || (g_pLocalPlayer->team == TEAM_SPEC)) { + //if (!team_joining_state) logging::Info("Bad team, trying to join..."); + team_joining_state = 1; + } else { if (team_joining_state) { logging::Info("Trying to change CLASS");