/Sam

SAM - Eine Telegram Schnitzeljagd

Primary LanguagePython

SAM - Eine Telegram Schnitzeljagd

Python 2.7

A Telegram Game Bot that lets you create a paper chase game for your friends and family

Features:

  • Creating Waypoints
  • Set distance radius per Waypoint
  • Creating seperated Item Waypoints
  • Set distance radius per Item
  • Set Pickup Chance per Item
  • Waypoint Interaction (Questions, Picture, Video, Audio, Voice)
  • Name Waypoints
  • Save/load your Paper Chase
  • Invincible Mode (you can't die)
  • Android Trigger App available, to trigger remote sounds
  • German language
  • Customize most of the Text via DB
  • Finding a lot of useless Items
  • Showing Inventory
  • Finding Revive Items
  • Finding Traps (which kill you)
  • Dropping Items on death
  • Dropping Items from Inventory
  • Showing Stats (Points in Invincible Mode)
  • Telegram Location manipulation prevented

Installation:

Ubuntu/Debian:

  • Clone SAM
git clone https://github.com/Netfreak25/Sam.git
  • Change Directory
cd Sam
  • Install Ubuntu/debian Dependencies
apt-get install python python-pip mysql-server python-mysqldb curl sudo net-tools
  • Update pip via pip
pip install --upgrade pip
  • Install python dependencies via pip
pip install -r requirements.txt
  • Create your Database and User

  • Table Structure and Data will be imported on first run, don't care about that!

Configuration:

Config.ini / Config.ini overwrite

  • You can set the following option directly within the config.ini
  • But if you set a variable in the gui it will overwrite the one read from config.ini
advanced = 0
# Shows Trigger Settings - 0,1

admin_chatids = 1231241412, 1234325345,564576564, 345454353
# List of chatids which should be admin, seperated by comma

botname = SamsqueshBot
# Name of the Bot in Telegram

cheat_detection = 0
# Only for Android - 0,1

item_radius_m = 20
# Default Item Radius (m) - 10,20,30,40,50...

gmaps_key = AIzaSyB6zX4HGU0VAVulNasdadssadasdasdasda
# Your Gmaps API Key

invincible = 1
# Defines if you can die - 0,1

pagename = Schnitzeljagdt
# WebGui Title (No spaces allowed)

reset_minutes = 1
# Time until the Trigger can be retriggered - 1+

broadcast_death = 1
# Define if a message gets send to all players upon death of a player - 0,1

telegram_token = 78954796:AGHJSGAJHSGGJHGJIOPHJ-787987sad
# Your Telegram Bot Token

waypoint_radius_m = 30
# Default Waypoint Radius (m) - 10,20,30,40,50...

zoom_koordinaten = 50.099570,8.675232
# Default coordinates for the map to center (no spaces allowed)

zoom_level = 16
# Default zoom level for the map - 1+
  • Variables saved in the gui will be saved per Project

Optional

  • If you want to use the restart function from within the gui please also follow the next step

  • In Order to be able to use the restart function you have to adjust your /etc/sudoers file

nobody ALL=(ALL:ALL) NOPASSWD: /YOURPATH/start.sh

Usage for Bot:

python start-bot.py

Usage for Gui:

python start-gui.py

Quick and dirty usage (background bot and gui):

./start.sh

Undocumented bot Commands

send *Your Text"
# Broadcasts the text recieved by an admin to all players

restart
# Restarts Sam and Sam Gui

reset
# Resets the death reasons (if all are used they reset themself)

revive *Playername*
# Revives the Player and sends him a notifiction

F.A.Q.

  • If your output of start.sh looks like this, make sure you have setup a correct Telegram Bot Token
[1/4] Killing old Bot Instance - SUCCESS
[2/4] Starting Bot Instance - FAILED
[3/4] Killing old WebGui Instance - SUCCESS
[4/4] Staring WebGui Instance - SUCCESS
  • If the Map does not display, make sure you have setup a correct google api key and that the javascript api has been enabled

  • If the restart Button does not work in the GUI make sure you updated /etc/sudoers

  • If you messed up the project or the config.ini overwrite you can clean the database

python start-bot.py -cd

General Informations:

  • No guaranteed Support
  • Things might break due to changes in the Telegram API