Browse Source

Moved the config part out of the game

I couldn’t move one part. That’s for another time.
master
Rogier Neeleman 11 years ago
parent
commit
345a9b3a5a
  1. 20
      conf/willie-example.cfg
  2. 26
      game/whatsedo.py

20
conf/willie-example.cfg

@ -33,3 +33,23 @@ pid_dir = /somewhere/whatsedo/logs
# What is the prefix for the IRC admin commands? # What is the prefix for the IRC admin commands?
prefix = \! prefix = \!
[whatsedo]
# What is the username of the whatsapp bot?
whatsappuser = Whatsedo_wa
# Game enviroment
# Minimal playercount
minplayers = 2
# Time in minutes to walk to the next location
walktime = 10
# Time in minutes to find the solution to the questions
playtime = 5
# Game questions
gamequestion = De hoofdvraag is: Wie is waar met het touw vermoord.
# Game solution
person = crofts
place = mariaplaats
weapon = touw

26
game/whatsedo.py

@ -2,6 +2,12 @@ from willie import module
import time import time
# Variables # Variables
def setup(bot):
"""
Setup all the variables
"""
global players, game, settings, solution, locations
players = [] players = []
game = {} game = {}
game['status'] = 0 game['status'] = 0
@ -10,17 +16,17 @@ game['round'] = 0
game['awnserok'] = [] game['awnserok'] = []
game['solved'] = [] game['solved'] = []
settings = {} settings = {}
settings['minplayers'] = 1 settings['minplayers'] = int(bot.config.whatsedo.minplayers)
settings['channel'] = "#whatsedo" settings['channel'] = bot.config.core.channels
settings['wa_user'] = "whatsedo_wa" settings['wa_user'] = bot.config.whatsedo.whatsappuser
settings['admin'] = "Your_own_IRC_User" settings['admin'] = bot.config.core.owner
settings['walktime'] = 10 settings['walktime'] = int(bot.config.whatsedo.walktime)
settings['playtime'] = 5 settings['playtime'] = int(bot.config.whatsedo.playtime)
settings['gamequestion'] = "De hoofdvraag is: Wie is waar met het touw vermoord." settings['gamequestion'] = bot.config.whatsedo.gamequestion
solution = { solution = {
'person':'crofts', 'person':bot.config.whatsedo.person,
'place':'mariaplaats', 'place':bot.config.whatsedo.place,
'weapon':'touw' 'weapon':bot.config.whatsedo.weapon
} }
locations = { locations = {
1:['Vredenburg/uitgang Catharijne', 'Een camera kijkt hier uit op een bord wat meestal (niet hier) info over Utrecht staat. Wat is zijn ID nummer?', 'mu01326', 'Op het Neude werd iemand met gif vermoord, maar niet door Crofts'], 1:['Vredenburg/uitgang Catharijne', 'Een camera kijkt hier uit op een bord wat meestal (niet hier) info over Utrecht staat. Wat is zijn ID nummer?', 'mu01326', 'Op het Neude werd iemand met gif vermoord, maar niet door Crofts'],

Loading…
Cancel
Save