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 @@ -33,3 +33,23 @@ pid_dir = /somewhere/whatsedo/logs
# What is the prefix for the IRC admin commands?
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 @@ -2,6 +2,12 @@ from willie import module
import time
# Variables
def setup(bot):
"""
Setup all the variables
"""
global players, game, settings, solution, locations
players = []
game = {}
game['status'] = 0
@ -10,17 +16,17 @@ game['round'] = 0 @@ -10,17 +16,17 @@ game['round'] = 0
game['awnserok'] = []
game['solved'] = []
settings = {}
settings['minplayers'] = 1
settings['channel'] = "#whatsedo"
settings['wa_user'] = "whatsedo_wa"
settings['admin'] = "Your_own_IRC_User"
settings['walktime'] = 10
settings['playtime'] = 5
settings['gamequestion'] = "De hoofdvraag is: Wie is waar met het touw vermoord."
settings['minplayers'] = int(bot.config.whatsedo.minplayers)
settings['channel'] = bot.config.core.channels
settings['wa_user'] = bot.config.whatsedo.whatsappuser
settings['admin'] = bot.config.core.owner
settings['walktime'] = int(bot.config.whatsedo.walktime)
settings['playtime'] = int(bot.config.whatsedo.playtime)
settings['gamequestion'] = bot.config.whatsedo.gamequestion
solution = {
'person':'crofts',
'place':'mariaplaats',
'weapon':'touw'
'person':bot.config.whatsedo.person,
'place':bot.config.whatsedo.place,
'weapon':bot.config.whatsedo.weapon
}
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'],

Loading…
Cancel
Save