'This performs the actual command.'

def func(self):

    'Set    the    attacker    to    the    caller    and    the    defender    to    the    target.'
    if (not is_in_combat(self.caller)):
        self.caller.msg('You    can    only    do    that    in    combat.    (see:    help    fight)')
        return
    if (not is_turn(self.caller)):
        self.caller.msg('You    can    only    do    that    on    your    turn.')
        return
    if (not self.caller.db.hp):
        self.caller.msg("You    can't    attack,    you've    been    defeated.")
        return
    attacker = self.caller
    defender = self.caller.search(self.args)
    if (not defender):
        return
    if (not defender.db.hp):
        self.caller.msg("You    can't    fight    that!")
        return
    if (attacker == defender):
        self.caller.msg("You    can't    attack    yourself!")
        return
    'If    everything    checks    out,    call    the    attack    resolving    function.'
    resolve_attack(attacker, defender)
    spend_action(self.caller, 1, action_name='attack')
