update readme, trying to fix autoteam

This commit is contained in:
nullifiedcat 2017-03-26 13:02:39 +03:00
parent 26c96d8f9a
commit 1660a043c5
2 changed files with 53 additions and 11 deletions

View File

@ -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

View File

@ -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");