Because recent adjustments to handler_active() rely on the
call_handler_function() return value to determine whether something
went wrong, we need command functions to return something which
evaluates boolean True if they ran to completion and didn't raise an
exception. Just return True from all of them for now, but they may
see more dynamic result handling in the future.
actor.send("Exiting chat mode.")
else:
actor.send("Sorry, but you're already busy with something else!")
actor.send("Exiting chat mode.")
else:
actor.send("Sorry, but you're already busy with something else!")
def create(actor, parameters):
def create(actor, parameters):
elif len(arguments) > 2:
message = "You can only specify an element and a filename."
actor.send(message)
elif len(arguments) > 2:
message = "You can only specify an element and a filename."
actor.send(message)
def delete(actor, parameters):
def delete(actor, parameters):
+ '". Try "show element ' +
element + '" for verification.')
actor.send(message)
+ '". Try "show element ' +
element + '" for verification.')
actor.send(message)
def destroy(actor, parameters):
def destroy(actor, parameters):
def error(actor, input_data):
def error(actor, input_data):
mudpy.misc.log(
'Sending a command error to user %s raised exception...\n%s' % (
actor.owner.account.get("name"), traceback.format_exc()))
mudpy.misc.log(
'Sending a command error to user %s raised exception...\n%s' % (
actor.owner.account.get("name"), traceback.format_exc()))
def halt(actor, parameters):
def halt(actor, parameters):
# set a flag to terminate the world
actor.universe.terminate_flag = True
# set a flag to terminate the world
actor.universe.terminate_flag = True
def help(actor, parameters):
def help(actor, parameters):
# send the accumulated output to the user
actor.send(output)
# send the accumulated output to the user
actor.send(output)
def look(actor, parameters):
def look(actor, parameters):
actor.send("You can't look at or in anything yet.")
else:
actor.look_at(actor.get("location"))
actor.send("You can't look at or in anything yet.")
else:
actor.look_at(actor.get("location"))
def move(actor, parameters):
def move(actor, parameters):
actor.move_direction(portal)
return(portal)
actor.send("You cannot go that way.")
actor.move_direction(portal)
return(portal)
actor.send("You cannot go that way.")
def preferences(actor, parameters):
def preferences(actor, parameters):
'Preference "%s" cannot be set to type "%s".' % (
pref, type(value)))
actor.send(message)
'Preference "%s" cannot be set to type "%s".' % (
pref, type(value)))
actor.send(message)
def quit(actor, parameters):
def quit(actor, parameters):
if actor.owner:
actor.owner.state = "main_utility"
actor.owner.deactivate_avatar()
if actor.owner:
actor.owner.state = "main_utility"
actor.owner.deactivate_avatar()
def reload(actor, parameters):
def reload(actor, parameters):
# set a flag to reload
actor.universe.reload_flag = True
# set a flag to reload
actor.universe.reload_flag = True
def say(actor, parameters):
def say(actor, parameters):
# there was no message
else:
actor.send("What do you want to say?")
# there was no message
else:
actor.send("What do you want to say?")
def c_set(actor, parameters):
def c_set(actor, parameters):
+ '". Try "show element ' +
element + '" for verification.')
actor.send(message)
+ '". Try "show element ' +
element + '" for verification.')
actor.send(message)
def show(actor, parameters):
def show(actor, parameters):
else:
message = '''I don't know what "''' + parameters + '" is.'
actor.send(message)
else:
message = '''I don't know what "''' + parameters + '" is.'
actor.send(message)