Add the basic of the @event command

This commit is contained in:
Vincent Le Goff 2017-03-12 13:14:33 -07:00 committed by Griatch
parent 51bc9ac65a
commit 0d7b1cb2be
3 changed files with 244 additions and 16 deletions

View file

@ -11,6 +11,16 @@ from evennia import ScriptDB
hooks = []
def get_event_handler():
"""Return the event handler or None."""
try:
script = ScriptDB.objects.get(db_key="event_handler")
except ScriptDB.DoesNotExist:
logger.log_err("Can't get the event handler.")
script = None
return script
def create_event_type(typeclass, event_name, variables, help_text):
"""
Create a new event type for a specific typeclass.