:spider: Mutator-free management, statistics, and in-game bot for ranked Killing Floor 2 servers
Scripted management, statistics, and bot for ranked Killing Floor 2 servers. Provides in-game commands, player stat tracking and ranking, live MOTD scoreboard and stats, greeter, and admin functions. Running entirely through the web admin, it does not affect a server's ranked/custom status. It can be ran either directly on the server or remotely, and manage multiple servers at once.
The most recent stable version is 0.1.6
. A binary is provided on the releases page for Windows and Linux users.
When inputting commands into the chat they need to be prefixed with !
.
When writting commands into a script, or chaining them this should be
omitted.
Many commands will look for closest matches to their parameters. For example 'biotics' will match 'kf-biotics-lab' and 'userO' will match 'userOne™/@:®'.
All commands have in-game help text that can be accessed with the -h
flag.
!commands -h
All commands also have the following flags.
-q
- Suppresses output-p
- Pads output to hide the username lineEscape sequences as follows are available to format messages.
\n
- Newline
!say line 0\nline 1
\t
- Tab
!say line 0\n\tline 1 is indented
Commands that can be executed by any player.
!commands
- Shows a list of all commands available to players!stats <user>
- Shows general statistics about a user
!stats
Shows stats about yourself!stats the_z
Shows stats about the_z!kills <user>
- Shows kill statistics about a user
!kills
Shows kill stats about yourself!kills the_z
Shows kill stats about the_z!dosh <user>
- Shows dosh statistics about a user
!dosh
Shows dosh stats about yourself!dosh the_z
Shows dosh stats about the_z!time <user>
- Shows time statistics about a user
!dosh
Shows time stats about yourself!dosh the_z
Shows time stats about the_z!map
- Shows statistics about the current map!record_wave
- Shows the highest wave achieved on the current map!top_kills
- Shows the global kills leaderboard!top_dosh
- Shows the global dosh leaderboard!top_time
- Shows the global play time leaderboard!top_wave_kills
- Shows information about who killed the most ZEDs
in the current wave. Generally for use with start_trc
!start_trc -- top_wave_kills
!top_wave_dosh
- Shwows information about who earned the most dosh in
the current wave. Generally for use with !start_trc
!start_trc -- top_wave_dosh
!server_kills
- Shows total kills on the server!server_dosh
- Shows total dosh earned on the server!scoreboard
- Shows the complete player scoreboard, useful on servers with >6 max players
!sb
Does the same!game
- Shows information about the current game!maps [--all]
- Shows the current map cycle
-a
: Show all available maps!player_count
- Shows the player count and max playersCommands that can be ran by server administrators or users authorized with
the !op
command.
!op <user>
- Gives a user administrative rights
!op the_z
!deop <user>
- Revokes a user's administrative rights
!deop the_z
!say <message>
- Echoes a message into chat
!say The quick brown fox jumps over the lazy dog
!start_trc -- say The trader is open
!players
- Shows detailed information about players on the server!kick <user>
- Kicks <user>
from the match
!kick the_z
!ban <user>
- Bans <user>
from the server
!ban the_z
!length <length>
- Change the length to <length>
next game
!length short
!difficulty <difficulty>
- Change the difficulty to <difficulty>
next
game
!difficulty hell
!game_mode <game_mode>
- Immediately change the game mode to <game_mode>
!game_mode endless
Changes the game mode to Endless!load_map <map>
- Immediately change the map to <map>
!load_map biotics
Changes the map to Biotics Lab!restart
- Immediately restart the current game!password [--set] <on|off>
!password on
Enables the game password defined in the config!password off
Disables the game password!password --set somePass
Sets a specific password!start_jc [-r] -- <command>
- Start a command that runs every time a player joins
- -r
Only run for returning players
!start_jc -- say Welcome %PLR
- Greets a player on join%PLR
- username, %KLL
- total kills, %DSH
-
total dosh; %PLR
- username, %BCK
- "back" if sessions > 1, %DRK
-
dosh rank, %KRK
- kill rank, %TME
- play time, %TRK
- play time
rank, %SES
- sessions!stop_jc
- Stops all join commands!start_wc [-w <wave>] -- <command>
- Start a command that runs on wave <wave>
-w
Wave to run the command on, can be omitted to have the command
run every wave-w
Can be negative to count backwards from the boss wave!start_wc -1 -- say Welcome to the boss wave
!stop_wc
- Stops all wave commands!start_tc [-r, -t <seconds>] -- <command>
- Start a command that runs after
<seconds>
seconds
-r
: Add to have the command run repeatedly-t
: Required, the number of seconds before the command runs!start_tc -rt 600 -- say Join our Steam group!\n http://steam.group/
!stop_tc
- Stops all timed commands!start_trc [-w <wave>] -- <command>
- Start a commands that runs when the trader opens
-w
Wave to run the command on, can be omitted to have the command
run every wave-w
Can be negative to count backwards from the boss wave!start_trc -- top_wave_dosh
- Shows who earned the most dosh
every wave when the trader opens!stop_trc
- Stop all commands that run on trader open!silent
- Toggles suppression of all chat output, commands still have
effect, but the response will not be visible to players!run <script_name>
- Executes a script from the conf/scripts
folder, more
information in the scripts section
!run example
!marquee <marquee_name>
- Runs a marquee in the chat from the
conf/marquee
folder, experimental
!marquee example
!update_motd <type>
- Refreshes the welcome screen leaderboard, type is
one of: kills, dosh, or time
!start_tc 300 -- update_motd kills
!reload_motd
- Reloads the server's *.motd
file from conf
!alias
- Check the help text !alias -h
!enforce_dosh <amount>
- Kicks all players that have more dosh than the specified amount
!start_tc 600 -- enforce_dosh 60000
A sample .motd
file is provided in conf/
. The filename should match the server's name as
specified in conf/magicked_admin.conf
. The template format is Jinja2. An example follows,
please refer to the Jinja2 designer documentation.
Welcome to our server.
{{ millify(server_kills) }} Zeds killed on this server.
Top Players (total dosh):
{% for player in top_dosh[0:9] -%}
{{loop.index}}. {{player.username|truncate(11)}} [{{millify(player.score)}}] {% if loop.index is divisibleby 3 %}
{% endif %}
{%- endfor %}
Have fun and good luck!
Writing a server_name.init
in the conf/scripts
folder with a series of commands
will run the commands in sequence when the bot starts on server_name
.
Additional scripts can be written in the conf/scripts
folder and ran with the
!run
command. There is an example already in there that can be ran with
!run example
.
;
.For gamemodes other than survival to function in full patches have to be
applied to the KFGame/Web/ServerAdmin
folder on the server. For this reason
a script is provided in the admin-patches
folder that will automatically
patch your server.
There is currently no CLI or Windows build for this component. You can run it
with python3 admin-patches/admin-patches.py
. A dialogue box will appear
asking you to locate your server.
Basic setup is done on the first run. However this does not cover all of the
options KF2-MA can offer. Please see the config file, conf/magicked_admin.conf
,
for more configuration options as some features are disabled by default.
Each server managed by KF2-MA has a section that looks something like
[server_one]
, followed by several options (x = y
). Copy and edit the
default server section if you want to manage multiple servers. [server_one]
is the name of the server, this can be changed to whatever you want.
Options can be configured in the config file conf/magicked_admin.conf
.
address
https://0.0.0.0:8080
username
password
game_password
!password <on|off>
.refresh_rate
Running with docker is easy. Just issue this command:
docker run -it -p 1880:1880 --name kf2-magicked-admin -v '<host config folder location>':'/magicked_admin/conf' th3z/kf2-magicked-admin
You will need to change <host config folder location>
to wherever you want
to store your config folder. /mnt/user/appdata/kf2-magicked-admin
is a popular
choice for systems running Unraid.
After this command runs the container will exit out and the logs will tell you
to setup the config file. Go to your conf
folder and set things up then run
the container again and you are good to go!
If you want to use the admin_patches so that kf-magicked-admin gets installed into your server directory when the container starts (some gamemodes wont track stats without it) just mount your game directory into the container and set the PATCHES_TARGET_DIR
env variable to the directory. You can mount multiple directories and just separate them with a comma "," in the env variable if you have many servers. Here is an example:
docker run -it -p 1880:1880 --name kf2-magicked-admin -v '<host config folder location>':'/magicked_admin/conf' -v '<host kf folder>':/kf2-server -v '<host kf folder>':/kf2-server-two -e 'PATCHES_TARGET_DIR'='/kf2-server,/kf2-server-two' th3z/kf2-magicked-admin
Before contributing code you will need to install the Python requirements.
Examples work on Debian 10 and Ubuntu Xenial, may differ for other operating systems. Install the following packages.
apt install python3
apt install python3-pip
apt install python3-babel
pip3 install -r requirements.txt
git clone https://github.com/th3-z/kf2-magicked-admin.git
cd kf2-magicked-admin
pip3 install -r requirements.txt
make i18n-compile
python3 -O magicked_admin/magicked_admin.py
The -O
flag runs the program in release mode, remove it to run KF2-MA in
debug mode. Debug mode will enable more detailed output.
You can build a binary release for distribution with make
after installing
both the run and build requirements.
Examples work on Debian 10 and Ubuntu Xenial, may differ for other operating systems.
apt install python3
apt install python3-babel
apt install python3-pip
pip3 install -r requirements.txt
apt install make
On Windows it's recommend to build with Cygwin. However you can also build it
by running python3 setup.py build
. Check the makefile for help building the locale files.