Author Topic: Multi Gatherbot version 2.13  (Read 20859 times)

0 Members and 1 Guest are viewing this topic.

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Multi Gatherbot version 2.13
« on: September 01, 2009, 10:36:30 am »
Decided to post my bot here instead of the scripting releases as it doesn't have any script dependencies anymore.
Code: [Select]
/***************************************************************************
 *   Copyright (C) 2008 by Zakath                                          *
 *   zakath@hhcrew.net                                                   *
 *                                                                         *
 *   Permission is hereby granted, free of charge, to any person obtaining *
 *   a copy of this software and associated documentation files (the       *
 *   "Software"), to deal in the Software without restriction, including   *
 *   without limitation the rights to use, copy, modify, merge, publish,   *
 *   distribute, sublicense, and/or sell copies of the Software, and to    *
 *   permit persons to whom the Software is furnished to do so, subject to *
 *   the following conditions:                                             *
 *                                                                         *
 *   The above copyright notice and this permission notice shall be        *
 *   included in all copies or substantial portions of the Software.       *
 *                                                                         *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
 *   OTHER DEALINGS IN THE SOFTWARE.                                       *
 ***************************************************************************/
Features:
- Support multiple gamemodes/server that are configurable from config
- voiced gathers with teamspeak/mumble
- banning auths
- templates for looks
- Ingame commands through bot no need for scripts
- Stats accessible from irc as well as a template webpage to see them included.

Notes:
- Bot is made for Linux it works under cygwin though.

Instructions:

As a lot of ppl have asked me how to compile run my bot I have decided to put up this tutorial here. It is really recommend to have basic linux/unix knowledge which you can find here.

1. First you need to download the source code which you can find attached to this post.
2. Upload it then to your linux server using for example winscp which works as your regular ftp client except it works over ssh which is the common standard to communicate with *nix servers.

3. Then login to your linux server using for example putty

4. Now its time to unpack the sourcecode that we do with following command: "tar xvf gatherbot.tar.gz" and it should look something like this:
Code: [Select]
zakath@behaviosec:~/gbot$ tar xvf gatherbot.tar.gz
gatherbot/
gatherbot/inflist.txt
gatherbot/Makefile
gatherbot/gos_string.cpp
gatherbot/cpp_stuff/
gatherbot/cpp_stuff/vc/
gatherbot/cpp_stuff/vc/vc.dsp
gatherbot/cpp_stuff/vc/vc.dsw
gatherbot/cpp_stuff/gsql/
gatherbot/cpp_stuff/gsql/gsqlite.cpp
gatherbot/cpp_stuff/gsql/gsql.cpp
gatherbot/cpp_stuff/gsql/gsqlite.h
gatherbot/cpp_stuff/gsql/gsql.h
gatherbot/cpp_stuff/gsql/gmysql.h
gatherbot/cpp_stuff/gsql/Makefile.linux
gatherbot/cpp_stuff/gsql/gmysql.cpp
gatherbot/cpp_stuff/math/
gatherbot/cpp_stuff/math/test/
gatherbot/cpp_stuff/math/test/Makefile
gatherbot/cpp_stuff/math/test/t1.cpp
gatherbot/cpp_stuff/math/Makefile.windows
gatherbot/cpp_stuff/math/upper_triangular_ndmatrix.h
gatherbot/cpp_stuff/math/combination.h
gatherbot/cpp_stuff/math/dfunc.h
gatherbot/cpp_stuff/math/fixed_16_16.h
gatherbot/cpp_stuff/math/d2func.h
gatherbot/cpp_stuff/math/func.cpp
gatherbot/cpp_stuff/math/obb.h
gatherbot/cpp_stuff/math/ode.h
gatherbot/cpp_stuff/math/d2func.cpp
gatherbot/cpp_stuff/math/Makefile.cygwin
gatherbot/cpp_stuff/math/lower_triangular_ndmatrix.h
gatherbot/cpp_stuff/math/aprox_math.cpp
gatherbot/cpp_stuff/math/.#vector3.h.1.4
gatherbot/cpp_stuff/math/fitting.h
gatherbot/cpp_stuff/math/fitting.cpp
gatherbot/cpp_stuff/math/bbox.h
gatherbot/cpp_stuff/math/fintergrate.h
gatherbot/cpp_stuff/math/ndmatrix.cpp
gatherbot/cpp_stuff/math/tmath.h
gatherbot/cpp_stuff/math/func.h
gatherbot/cpp_stuff/math/Makefile.solaris
gatherbot/cpp_stuff/math/dfunc.cpp
gatherbot/cpp_stuff/math/quaternion.h
gatherbot/cpp_stuff/math/line.h
gatherbot/cpp_stuff/math/upper_triangular_ndmatrix.cpp
gatherbot/cpp_stuff/math/lower_triangular_ndmatrix.cpp
gatherbot/cpp_stuff/math/matrix3.h
gatherbot/cpp_stuff/math/matrix4.h
gatherbot/cpp_stuff/math/ode.cpp
gatherbot/cpp_stuff/math/aprox_math.h
gatherbot/cpp_stuff/math/polygon.h
gatherbot/cpp_stuff/math/halfplane2d.h
gatherbot/cpp_stuff/math/vector2.h
gatherbot/cpp_stuff/math/vector3.h
gatherbot/cpp_stuff/math/ndmatrix.h
gatherbot/cpp_stuff/math/fintergrate.cpp
gatherbot/cpp_stuff/math/math_gexception.cpp
gatherbot/cpp_stuff/math/checked_ndmatrix.cpp
gatherbot/cpp_stuff/math/plane.h
gatherbot/cpp_stuff/math/triangle.h
gatherbot/cpp_stuff/math/checked_ndmatrix.h
gatherbot/cpp_stuff/math/Makefile.linux
gatherbot/cpp_stuff/math/fixed_16_16.cpp
gatherbot/cpp_stuff/math/line2d.h
gatherbot/cpp_stuff/math/math_gexception.h
gatherbot/cpp_stuff/text/
gatherbot/cpp_stuff/text/Makefile.windows
gatherbot/cpp_stuff/text/tok_stream_string.h
gatherbot/cpp_stuff/text/tok.h
gatherbot/cpp_stuff/text/Makefile.cygwin
gatherbot/cpp_stuff/text/tok_stream_file.h
gatherbot/cpp_stuff/text/string.cpp
gatherbot/cpp_stuff/text/tok_stream_file.cpp
gatherbot/cpp_stuff/text/tok_stream.cpp
gatherbot/cpp_stuff/text/tok.cpp
gatherbot/cpp_stuff/text/Makefile.solaris
gatherbot/cpp_stuff/text/tok_buffer.h
gatherbot/cpp_stuff/text/stream_data.h
gatherbot/cpp_stuff/text/tok_buffer.cpp
gatherbot/cpp_stuff/text/tok_stream.h
gatherbot/cpp_stuff/text/tok_stream_string.cpp
gatherbot/cpp_stuff/text/string.h
gatherbot/cpp_stuff/text/Makefile.linux
gatherbot/cpp_stuff/text/stream_data.cpp
gatherbot/cpp_stuff/cpp_stuff.dev
gatherbot/cpp_stuff/Makefile.windows
gatherbot/cpp_stuff/gexception.h
gatherbot/cpp_stuff/Makefile.cygwin
gatherbot/cpp_stuff/containers/
gatherbot/cpp_stuff/containers/test/
gatherbot/cpp_stuff/containers/test/compile
gatherbot/cpp_stuff/containers/test/test.cpp
gatherbot/cpp_stuff/containers/Makefile.windows
gatherbot/cpp_stuff/containers/auto_free.h
gatherbot/cpp_stuff/containers/Makefile.cygwin
gatherbot/cpp_stuff/containers/hashtext.h
gatherbot/cpp_stuff/containers/hashset.cpp
gatherbot/cpp_stuff/containers/hashtext.cpp
gatherbot/cpp_stuff/containers/buff.h
gatherbot/cpp_stuff/containers/dcel.h
gatherbot/cpp_stuff/containers/hashset.h
gatherbot/cpp_stuff/containers/pointer_vector.h
gatherbot/cpp_stuff/containers/Makefile.solaris
gatherbot/cpp_stuff/containers/pointer_vector.cpp
gatherbot/cpp_stuff/containers/list.h
gatherbot/cpp_stuff/containers/buff.cpp
gatherbot/cpp_stuff/containers/inc_mempool.h
gatherbot/cpp_stuff/containers/hashbase.cpp
gatherbot/cpp_stuff/containers/Makefile.linux
gatherbot/cpp_stuff/containers/hashbase.h
gatherbot/cpp_stuff/gexception.cpp
gatherbot/cpp_stuff/gcpp_stuff_settings.h
gatherbot/cpp_stuff/Makefile.solaris
gatherbot/cpp_stuff/fsystem/
gatherbot/cpp_stuff/fsystem/Makefile.windows
gatherbot/cpp_stuff/fsystem/fexception.h
gatherbot/cpp_stuff/fsystem/directory.cpp
gatherbot/cpp_stuff/fsystem/lfile.h
gatherbot/cpp_stuff/fsystem/regular_file.cpp
gatherbot/cpp_stuff/fsystem/lfile.cpp
gatherbot/cpp_stuff/fsystem/memwrite_file.h
gatherbot/cpp_stuff/fsystem/stdin_file.cpp
gatherbot/cpp_stuff/fsystem/stdout_file.cpp
gatherbot/cpp_stuff/fsystem/regular_directory.cpp
gatherbot/cpp_stuff/fsystem/regular_file.h
gatherbot/cpp_stuff/fsystem/regular_directory.h
gatherbot/cpp_stuff/fsystem/stdout_file.h
gatherbot/cpp_stuff/fsystem/fexception.cpp
gatherbot/cpp_stuff/fsystem/stat.h
gatherbot/cpp_stuff/fsystem/stat.cpp
gatherbot/cpp_stuff/fsystem/Makefile.linux
gatherbot/cpp_stuff/fsystem/stdin_file.h
gatherbot/cpp_stuff/fsystem/directory.h
gatherbot/cpp_stuff/fsystem/memwrite_file.cpp
gatherbot/cpp_stuff/gthread/
gatherbot/cpp_stuff/gthread/semaphore.cpp
gatherbot/cpp_stuff/gthread/test/
gatherbot/cpp_stuff/gthread/test/Makefile
gatherbot/cpp_stuff/gthread/test/boat.cpp
gatherbot/cpp_stuff/gthread/Makefile.windows
gatherbot/cpp_stuff/gthread/condition.cpp
gatherbot/cpp_stuff/gthread/Makefile.cygwin
gatherbot/cpp_stuff/gthread/semaphore.h
gatherbot/cpp_stuff/gthread/Makefile.solaris
gatherbot/cpp_stuff/gthread/lock.h
gatherbot/cpp_stuff/gthread/condition.h
gatherbot/cpp_stuff/gthread/lock.cpp
gatherbot/cpp_stuff/gthread/thread.h
gatherbot/cpp_stuff/gthread/Makefile.linux
gatherbot/cpp_stuff/gthread/thread.cpp
gatherbot/cpp_stuff/Makefile.linux.no_sql
gatherbot/cpp_stuff/Doxyfile
gatherbot/cpp_stuff/Makefile.linux
gatherbot/irc.h
gatherbot/gos_tok.h
gatherbot/stats/
gatherbot/stats/maps/
gatherbot/stats/maps/Lothic.PMS
gatherbot/stats/update.sql
gatherbot/stats/index.php
gatherbot/stats/simplestats/
gatherbot/stats/simplestats/.htaccess
gatherbot/stats/simplestats/main.php
gatherbot/stats/simplestats/config.php
gatherbot/stats/simplestats/templates/
gatherbot/stats/simplestats/templates/htf_tdm_player.html
gatherbot/stats/simplestats/templates/dm_pm_rm_player.html
gatherbot/stats/simplestats/templates/dm_pm_rm_main.html
gatherbot/stats/simplestats/templates/ctf_inf_main.html
gatherbot/stats/simplestats/templates/ctf_inf_player.html
gatherbot/stats/simplestats/templates/htf_tdm_main.html
gatherbot/stats/footer.php
gatherbot/stats/stats.php
gatherbot/stats/header.php
gatherbot/ctflist.txt
gatherbot/Readme
gatherbot/gatherbot.cfg
gatherbot/gatherbot.cpp
gatherbot/soldatadmin.cpp
gatherbot/soldatadmin.h
gatherbot/statslog.cpp
gatherbot/gcheck.bash
gatherbot/statslog.h
gatherbot/htflist.txt
gatherbot/soldatinfox.h
gatherbot/soldatinfo.h
gatherbot/dmlist.txt
gatherbot/gos_string.h
gatherbot/irc.cpp
gatherbot/gos_tok.cpp
zakath@behaviosec:~/gbot$

5. Now to compile it type "Make" and it should look like below.
Code: [Select]
zakath@behaviosec:~/gbot/gatherbot$ make
g++ -O2 -pipe -fomit-frame-pointer -I ./cpp_stuff -w   -c -o gatherbot.o gatherbot.cpp
g++ -O2 -pipe -fomit-frame-pointer -I ./cpp_stuff -w   -c -o soldatadmin.o soldatadmin.cpp
g++ -O2 -pipe -fomit-frame-pointer -I ./cpp_stuff -w   -c -o irc.o irc.cpp
g++ -O2 -pipe -fomit-frame-pointer -I ./cpp_stuff -w   -c -o statslog.o statslog.cpp
cd cpp_stuff && make -f Makefile.linux
make[1]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff'
g++ -O3 -fPIC -w   -c -o gexception.o gexception.cpp
g++ -o libgbase.so -shared -Wl,-soname=libgbase.so gexception.o
ar -rvs libgbase.a gexception.o
ar: creating libgbase.a
cd containers && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/containers'
g++ -O3 -fPIC -w   -c -o hashset.o hashset.cpp
g++ -O3 -fPIC -w   -c -o pointer_vector.o pointer_vector.cpp
g++ -O3 -fPIC -w   -c -o buff.o buff.cpp
g++ -O3 -fPIC -w   -c -o hashbase.o hashbase.cpp
g++ -O3 -fPIC -w   -c -o hashtext.o hashtext.cpp
ar -rvs libgcontainers.a ./hashset.o ./pointer_vector.o ./buff.o ./hashbase.o ./hashtext.o
ar: creating libgcontainers.a
g++ -o libgcontainers.so -shared -Wl,-soname=libgcontainers.so ./hashset.o ./pointer_vector.o ./buff.o ./hashbase.o ./hashtext.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/containers'
cd text && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/text'
g++ -O3 -fPIC -w   -c -o tok.o tok.cpp
g++ -O3 -fPIC -w   -c -o tok_stream_file.o tok_stream_file.cpp
g++ -O3 -fPIC -w   -c -o tok_stream_string.o tok_stream_string.cpp
g++ -O3 -fPIC -w   -c -o tok_stream.o tok_stream.cpp
g++ -O3 -fPIC -w   -c -o tok_buffer.o tok_buffer.cpp
g++ -O3 -fPIC -w   -c -o string.o string.cpp
g++ -O3 -fPIC -w   -c -o stream_data.o stream_data.cpp
ar -rvs libgtext.a ./tok.o ./tok_stream_file.o ./tok_stream_string.o ./tok_stream.o ./tok_buffer.o ./string.o ./stream_data.o
ar: creating libgtext.a
g++ -o libgtext.so -shared -Wl,-soname=libgtext.so ./tok.o ./tok_stream_file.o ./tok_stream_string.o ./tok_stream.o ./tok_buffer.o ./string.o ./stream_data.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/text'
cd math && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/math'
g++ -O3 -fPIC -w   -c -o d2func.o d2func.cpp
g++ -O3 -fPIC -w   -c -o ndmatrix.o ndmatrix.cpp
g++ -O3 -fPIC -w   -c -o upper_triangular_ndmatrix.o upper_triangular_ndmatrix.cpp
g++ -O3 -fPIC -w   -c -o lower_triangular_ndmatrix.o lower_triangular_ndmatrix.cpp
g++ -O3 -fPIC -w   -c -o aprox_math.o aprox_math.cpp
g++ -O3 -fPIC -w   -c -o func.o func.cpp
g++ -O3 -fPIC -w   -c -o checked_ndmatrix.o checked_ndmatrix.cpp
g++ -O3 -fPIC -w   -c -o fixed_16_16.o fixed_16_16.cpp
g++ -O3 -fPIC -w   -c -o ode.o ode.cpp
g++ -O3 -fPIC -w   -c -o fintergrate.o fintergrate.cpp
g++ -O3 -fPIC -w   -c -o math_gexception.o math_gexception.cpp
g++ -O3 -fPIC -w   -c -o dfunc.o dfunc.cpp
g++ -O3 -fPIC -w   -c -o fitting.o fitting.cpp
ar -rvs libgmath.a ./d2func.o ./ndmatrix.o ./upper_triangular_ndmatrix.o ./lower_triangular_ndmatrix.o ./aprox_math.o ./func.o ./checked_ndmatrix.o ./fixed_16_16.o ./ode.o ./fintergrate.o ./math_gexception.o ./dfunc.o ./fitting.o
ar: creating libgmath.a
g++ -o libgmath.so -shared -Wl,-soname=libgmath.so ./d2func.o ./ndmatrix.o ./upper_triangular_ndmatrix.o ./lower_triangular_ndmatrix.o ./aprox_math.o ./func.o ./checked_ndmatrix.o ./fixed_16_16.o ./ode.o ./fintergrate.o ./math_gexception.o ./dfunc.o ./fitting.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/math'
cd gthread && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/gthread'
g++ -O3 -fPIC -w   -c -o semaphore.o semaphore.cpp
g++ -O3 -fPIC -w   -c -o thread.o thread.cpp
g++ -O3 -fPIC -w   -c -o condition.o condition.cpp
g++ -O3 -fPIC -w   -c -o lock.o lock.cpp
ar -rvs libgthread.a ./semaphore.o ./thread.o ./condition.o ./lock.o
ar: creating libgthread.a
g++ -o libgthread.so -shared -Wl,-soname=libgthread.so ./semaphore.o ./thread.o ./condition.o ./lock.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/gthread'
cd gsql && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/gsql'
g++ -O3 -fPIC -w   -c -o gmysql.o gmysql.cpp
g++ -O3 -fPIC -w   -c -o gsqlite.o gsqlite.cpp
g++ -O3 -fPIC -w   -c -o gsql.o gsql.cpp
ar -rvs libgsql.a ./gmysql.o ./gsqlite.o ./gsql.o
ar: creating libgsql.a
g++ -o libgsql.so -shared -Wl,-soname=libgsql.so ./gmysql.o ./gsqlite.o ./gsql.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/gsql'
cd fsystem && make -f Makefile.linux
make[2]: Entering directory `/home/zakath/gbot/gatherbot/cpp_stuff/fsystem'
g++ -O3 -fPIC -w   -c -o stat.o stat.cpp
g++ -O3 -fPIC -w   -c -o stdin_file.o stdin_file.cpp
g++ -O3 -fPIC -w   -c -o directory.o directory.cpp
g++ -O3 -fPIC -w   -c -o lfile.o lfile.cpp
g++ -O3 -fPIC -w   -c -o regular_file.o regular_file.cpp
g++ -O3 -fPIC -w   -c -o memwrite_file.o memwrite_file.cpp
g++ -O3 -fPIC -w   -c -o regular_directory.o regular_directory.cpp
g++ -O3 -fPIC -w   -c -o fexception.o fexception.cpp
g++ -O3 -fPIC -w   -c -o stdout_file.o stdout_file.cpp
ar -rvs libgfsystem.a ./stat.o ./stdin_file.o ./directory.o ./lfile.o ./regular_file.o ./memwrite_file.o ./regular_directory.o ./fexception.o ./stdout_file.o
ar: creating libgfsystem.a
g++ -o libgfsystem.so -shared -Wl,-soname=libgfsystem.so ./stat.o ./stdin_file.o ./directory.o ./lfile.o ./regular_file.o ./memwrite_file.o ./regular_directory.o ./fexception.o ./stdout_file.o
make[2]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff/fsystem'
ar -rs  libgall.a containers/*.o  text/*.o  math/*.o  gthread/*.o  gsql/*.o  fsystem/*.o  ./*.o
g++ -o libgall.so  -shared -Wl,-soname=libgall.so containers/*.o  text/*.o  math/*.o  gthread/*.o  gsql/*.o  fsystem/*.o  ./*.o
make[1]: Leaving directory `/home/zakath/gbot/gatherbot/cpp_stuff'
g++ -g -lpthread -L/usr/lib/mysql/ -lmysqlclient -lz gatherbot.o soldatadmin.o irc.o statslog.o -o gatherbot
zakath@behaviosec:~/gbot/gatherbot$
6. If you got a error like "-sh: make: command not found" you need to install make and most like also g++ this you do normally with your package manager for example in debian/ubuntu the following 2 commands should solve it.
Code: [Select]
apt-get install make
apt-get install g++

7. If you got a compile error concerning mysql you are most like missing libmysqlclient which is a library the bot uses to connect to mysql database that is uses for stats. to fix that you do the following on debian/ubuntu
Code: [Select]
apt-get install libmysqlclient-dev

8. if those libraries are now installed we can go back to the compile step and type "make" and all should hopefully work fine like in step 5

9. Now its time to configure the bot below is an example config
Code: [Select]
# which irc server to use
IRCSERVER se.quakenet.org
# port to irc server
IRCPORT 6667
# nick of your gatherbot
IRCNICK multibot
# name of the bot that is viewable in a whois
IRCNAME multibot
# Hide Host? this is a quakenet feature that hides your hostname in a whois and such
HIDEHOST YES
# pass to the server has a ircpassword put it here otherwise leave it as it is
IRCPASS NO
# spam users with status on join
JOINSPAM YES
# ban time in hours
BANTIME 48
# use auth/banpoint system
# this option is if you want to use quakenet auths as a way to identify users and restrict access to the gatherbot for banned users
AUTHSYSTEM YES
# user of the ircbot this is the user displayed in a whois for example of the bot
IRCUSER multibot
# which chan to join this is the channel that the gathers take place
IRCCHAN #gatherchannel
# this is an optional private channel where you can run commands and also you get substitute notifications here
PRIVCHAN #gather.priv
# use auth? if you want to authenticate the bot against Q on quakenet you want this
IRCAUTH YES
# anti target spam? only works on networks with cnotice/cprivmsg like quakenet
# this is mostly relevant if the bot spams a lot ie channel is really active the bot has to have op on the channel for it to work
ANTITARGETSPAM YES
# How long time in seconds between each msg?
# this you can tweak if bot floods the servers
MSGSLEEP 2
# log stuff?
LOG YES
# quakenet authuser for Q autentication
IRCAUTHUSER authuser
# quakenet authpass for Q authentication
IRCAUTHPASS authpass
# MYSQL settings if you dont want to use mysql comment out the following
MYSQLUSER usernamehere
MYSQLPASS passwordhere
MYSQLPORT 3306
MYSQLHOST localhost
MYSQLDB gatherstats
# Min amount of games required to display statistics for a player
MINGAMES 10
# After how many days of inactivity should the statistics be hidden
INACTIVEDAYS 90
# every week it will degrade the stats for 5 % degredation you should put 0.95 for 10 % 0.9 for 0 % 1.0
DEGRADATION 0.95
# define types of gathers these have to be before defining servers
# these are types of gamemodes you want to have on the server there is no limit on how many gamemodes you can add etc
# the first defined gamemode is the default one and will work without the prefix for commands like !on !add
# TYPE - every gamemode must start with this
# NAME - here you put the name of the gamemode
# PREFIX - this is the prefix before the commands like for example c in the example below means the command will be like !con !cadd
# COLOR - This is the IRC color that represents the gamemode from 0-16
# DEFAULTSIZE - This is the default size of the gather for example in 3vs3 this should be 3
# MAXSIZE - This is the maximum allowed size to start a gather for example 8vs8 then it should 8
# MINSIZE - This is the minimum allowed size to start a gather for example if that is 2vs2 it should 2
# TEAMS - The amount of teams it should generate for this gather valid amount are 1-4
# STATS - If it should attempt to calculate statistics for this gamemode
# INGAME - if you want to have ingame commands like !map !r etc.
# LOBBYMAP - The Lobby map for this gamemode
# MAPLIST - the name of the file containing the maplist for this gamemode
# COMMAND - This defines the commands that should run when starting a gather to init the gather can be multiple lines of this one.
# END - the gamemode has to stop with an END
TYPE
NAME CTF
PREFIX c
COLOR 4
DEFAULTSIZE 3
MAXSIZE 8
MINSIZE 1
TEAMS 2
STATS YES
INGAME YES
LOBBYMAP Lothic
MAPLIST ctflist.txt
COMMAND /loadcon soldat.ini
COMMAND /gamemode 3
COMMAND /loadwep weapons
END
TYPE
NAME INF
PREFIX i
COLOR 5
DEFAULTSIZE 3
MAXSIZE 8
MINSIZE 1
TEAMS 2
STATS YES
INGAME YES
LOBBYMAP Lothic
MAPLIST inflist.txt
COMMAND /loadcon soldat.ini
COMMAND /gamemode 5
COMMAND /loadwep weapons
END

# these are templates for the look of all the messages the bot uses
# general cookies: %bold %color %uline
# help pm
HELPPM Commands: !<type>on<amount> !<type>add !del !spec<servernr> !players<servernr> !status !overkill !info<servernr> !players<servernr> !sub <servernr> <subamount> !<type>sadd *!off<server> *!banauth <nick> <hours> <reason> *!enable *!disable *!die *!update *!command<servernr> <command> !resize !stats <mode> <nick> !modes !unbanlast
# Sadd pm cookies: %servernr %clicker
SADDPM Server(%bold%servernr%bold) is running, join at: %clicker
# Sadd line 1 cookies: %servernr %gametype %gathersize %nick
SADDLINE1 %color4SUB%color Server(%bold%servernr%bold) %color10Playing%color(%gametype):%color4 %gathersize%color %bold|%bold%color4 %nick%color
# Sadd line 2
SADDINE2  %color10-%color %color4x%color
# Sub Line 1 Cookies: %servernr %subamount
SUBLINE1 %subamount Substitute(s) %color10needed%color in %color4Server%color (%bold%servernr%bold) %color10Use%color %color4!sadd%color %color10 to add.%color
# Sub line 2 Cookies: %servernr %gametype %gathersize
SUBLINE2 %color4SUB%color Server(%bold%servernr%bold) %color10Playing%color(%gametype):%color4 %gathersize%color %bold|%bold %color4x%color
# Sub line 3
SUBLINE3  %color10-%color %color4x%color
# Off line Cookies: %gametype %servernr
OFFLINE Gather on %gametype server(%bold%servernr%bold) deleted
# On line 1 Cookies: %servernr %gametype
ONLINE1 Found a free %gametypeserver(%bold%servernr%bold) starting %color7gather%color
# On line 2 Cookies: %gametype %gathersize %nick
ONLINE2 %color10Playing%color(%gametype):%color4 %gathersize%color on Server(%bold%servernr%bold) %bold|%bold %color4%nick%color
# On line 3 Cookies: %nick
ONLINE3  %color10-%color %color4%nick%color
# On line 4
ONLINE4 No Free Servers found
# Add Pm
ADDPM Gather number: %nr Your team is %team - Tiebreaker is %tb join at %clicker
# Add line 1 Cookies: %gametype %servernr
ADDLINE1 %color7Gather%color is full for %gametypeServer(%bold%servernr%bold) Teams have been generated for gather(%nr) - (check pm).
# Add line 2 Cookies: %team
ADDLINE2 %team:
# Add line 3 Cookies: %nick
ADDLINE3  %nick
# Add line 4 Cookies: %tb
ADDLINE4 %color4Alpha Team%color will pick the first map, %color2Bravo Team%color will pick the second map, if needed %color8%tb%color is the tiebreaker map.
# Add line 5 Cookies: %gametype %gathersize %nick
ADDLINE5 %color10Playing%color(%gametype):%color4 %gathersize%color on Server(%bold%servernr%bold) %bold|%bold %color4%nick%color
# Add line 6 Cookies: %nick
ADDLINE6  %color10-%color %color4%nick%color
# Add line 7
ADDLINE7 No %color7gathers%color running atm you can start one with %bold!<type>on%bold
# Players line 1 %gametype %servernr %status
PLAYERSLINE1 %color7Gather%color %gametypeServer(%bold%servernr%bold) %bold-%bold %status
# Players line 2 %gametype %servernr
PLAYERSLINE2 %color7Gather%color %gametypeServer (%bold%servernr%bold) %bold-%bold is %boldfree%bold use !on
# Status line Cookies: %gametype %servernr %status
STATUSLINE %color7Gather%color %gametypeServer(%bold%servernr%bold) %bold-%bold %status
# Overkill line Cookies: %gametype %servernr
OVERKILLLINE %color7Gather%color %gametypeServer(%bold%servernr%bold) %bold-%bold is %boldfree%bold use !on
# Spec pm 1 Cookies: %gametype %servernr %clicker
SPECPM1 Server(%bold%servernr%bold) is running(%gametype) join at: %clicker
# Spec pm 2 Cookies: %gametype %servernr %clicker
SPECPM2 No gathers currently playing at %gametypeserver(%bold%servernr%bold)
# Delete line 1 Cookies: %gathersize %gametype %nick %servernr
DELLINE1 %color10Playing%color(%gametype):%color4 %gathersize%color on Server(%bold%servernr%bold) %bold|%bold %color4%nick%color
# Delete line 2 Cookies: %nick
DELLINE2  %color10-%color %color4%nick%color
# Delete line 3 Cookies: %gametype %servernr
DELLINE3 Gather on %gametypeserver(%bold%servernr%bold) deleted

# Soldat servers one line / server using the following format
# SERVER HOST PORT PASSWORD VOICELINKALPHA VOICELINKBRAVO VOICELINKCHARLIE VOICELINKDELTA
# SERVER - starts each server line
# HOST - host of the soldatserver
# PORT - port of the soldatserver
# PASSWORD - adminlog password
# VOICELINKALPHA-DELTA - the voice server link for each team with the following cookies %nick theses lines are optional
SERVER host.com 23073 adminpass mumble://%nick:pass@host.com/Gather/SERVER1ALPHA mumble://%nick:pass@host.com/Gather/SERVER1BRAVO
SERVER host.com 23074 adminpass mumble://%nick:pass@host.com/Gather/SERVER2ALPHA mumble://%nick:pass@host.com/Gather/SERVER2BRAVO mumble://%nick:pass@host.com/Gather/SERVER2CHARLIE mumble://%nick:pass@host.com/Gather/SERVER2DELTA
SERVER host.com 23075 adminpass

10. Now you can run your server by typing: ./gatherbot or ./gatherbot -d to run it in the background the output should look something like:
Code: [Select]
zakath@behaviosec:~/gbot/gatherbot# ./gatherbot
Starting Bot
14:09 Trying to Connect to host.com:23073
14:09 Trying to Connect to host.com:23075
14:09 Trying to Connect to host.com:23074

11. Now everything should be running however I recommend you put it under some kind of autostart for example using the included bash script(remember to edit it) added to crontab using:
Code: [Select]
*/1 * * * * /path/to/check.bash &>/dev/null





Credits goes to Ramirez for his soldatinfo.h
« Last Edit: February 18, 2013, 02:42:06 pm by zakath »

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5017
Re: Multi Gatherbot version 1.31
« Reply #1 on: September 01, 2009, 07:42:45 pm »
Cool, added to Fan Apps thread. I like the fact that it doesn't require server scripting; that's awesome.
Careful with that axe, Eugene.

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.5 Beta
« Reply #2 on: September 03, 2009, 12:02:24 pm »
- fixed a bug with caseing on auths as well as bug when kicking ppl from channel
- Added my CTF stats used for example at http://www.soldatcustom.com

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.5 Beta
« Reply #3 on: September 03, 2009, 05:15:34 pm »
- Fixed a bunch of bugs that where quite critical strongly suggest that you update.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.5 Beta
« Reply #4 on: September 05, 2009, 12:33:34 pm »
- seemed it still was buggy so now I have rewritten the server interaction part and it seems to be way more bulletproof
- made a init.php script to create the database remember to delete it afterwards.
- also wrote a small readme to set everything up.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline Fubister

  • Major
  • *
  • Posts: 63
Re: Multi Gatherbot version 1.5 Beta
« Reply #5 on: September 05, 2009, 01:36:31 pm »
gj, will have a look into it soon

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.5 Beta
« Reply #6 on: September 14, 2009, 02:34:57 pm »
- fixed a crashbug

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.5 Beta
« Reply #7 on: September 18, 2009, 03:09:02 pm »
- fixed one more crashbug(hopefully the last)

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.6RC1
« Reply #8 on: October 31, 2009, 10:38:31 am »
Update:
- Fixed a bug with retreiving auths
- Added extensive logging. as well as the option to turn it off "LOG NO" in the config

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.6
« Reply #9 on: November 04, 2009, 05:32:37 pm »
Update:
- Finally fixed/bulletproofed the refreshx parser(I hope at least ;)
- Added support for calling a sub ingame
- Added Rounds announcing

From: November 05, 2009, 03:41:30 pm
Update:
- Changed ingame sub to !sub <amount>
- Rewrote the irc bot code so bot should be more responsive now.


From: November 06, 2009, 11:48:43 am
Update:
- small fix for stats parser that failed sometimes.
« Last Edit: November 06, 2009, 11:48:43 am by zakath »

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.7.2
« Reply #10 on: November 11, 2009, 06:02:11 am »
Update:
- added a smarter way of collecting the stats takeing care of early leavers.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 1.7.4
« Reply #11 on: November 16, 2009, 07:34:23 am »
Update:
- fixed announcing of gathers when server is empty
- fixed a bug with subs not being reseted when starting a new gather

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0
« Reply #12 on: February 08, 2010, 11:45:55 am »
Update:
- Added support for 1-4 teams / gametype
- Support for multiple types / server Example: 1 server but 10+ gametypes
- added support for resize votes for gathers Example: 8vs8 gather that will never start can be resized by vote to say 3vs3 if that is default
- Added stats for all gamemodes in soldat viewable from web,irc,ingame
- Removed dependency of curl and added libmysqlclient.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.1
« Reply #13 on: February 12, 2010, 09:42:40 am »
Update:
- Fixed Some stats issues for bravo team in ctf
- Fixed Some crash issues related to forking
- Improved irc code so bot is more responsive now

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.2
« Reply #14 on: March 13, 2010, 05:47:01 am »
Update:
- fixed a crash with calling an extreme amount of subs
- fixed better filtering of stats

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.3
« Reply #15 on: March 22, 2010, 12:34:02 pm »
Update:
- Added degradation of stats to better show improvements of players as well as to limit stat abuse

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.4
« Reply #16 on: April 26, 2010, 12:01:20 pm »
Update:
was initially going todo a bigger update which will include a webinterface for manageing the bot. however found a bug with the stats so decided to post this bugfix release.
New:
- bot rereads config every 10 seconds so no need to restart bot for config changes to take effect
- stats has been changed to take "skill" into consideration.
Fixes:
- fixed bug with degredation of stats resulting in capration going through the roof.

For new stats to work you need to alter some tables here is the sql code for that.
ALTER TABLE `inf` ADD `points` BIGINT NOT NULL DEFAULT '1000'
ALTER TABLE `ctf` ADD `points` BIGINT NOT NULL DEFAULT '1000'
ALTER TABLE `htf` ADD `points` BIGINT NOT NULL DEFAULT '1000'
ALTER TABLE `tdm` ADD `points` BIGINT NOT NULL DEFAULT '1000'

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.5
« Reply #17 on: June 02, 2010, 07:41:03 am »
Update:
- Fixed a crashbug when doing !overkill with servers down and newly started bot.
- Some other small fixes.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: Multi Gatherbot version 2.0.6
« Reply #18 on: June 19, 2010, 10:52:01 am »
Update:
- Rewrote soldatadmin console code should be much more dynamic now which should result in less buggy ingame commands among other things.
- Changed behaviour for irc code that will hopefully make it more stable.
- Fixed a bunch of bugs.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: Multi Gatherbot version 2.0.6
« Reply #19 on: July 01, 2010, 05:17:05 pm »
Hello, I'm not sure if this is the right place to post this query.

I downloaded the bot and have compiled with gcc 4.5.0 and I saw some things during the compilation.

You can see the console log while compilation are running: http://www.soldat.com.ar/personal/consolelog.txt And if you wanna see the compilation log: http://www.soldat.com.ar/personal/compilelog.txt

But equally I could run. Everything perfect until you start a gather of 3vs3, when changing the first map and the bot says who won the map in the IRC, it fails.

I run the bot with
Code: [Select]
$ strace -odebuglog.txt ./gatherbot and here is displayed when the bot crashes: http://www.soldat.com.ar/personal/debuglog.txt

Maybe this is related with the "Warnings" at compile time.