'Do stuff'

def func(self):

    caller = self.caller
    if (not self.args):
        string = 'Usage:    @script[/switch]    <obj>    [=    script_path    or    <script    key>]'
        caller.msg(string)
        return
    if (not self.lhs):
        caller.msg('To    create    a    global    script    you    need    |w@scripts/add    <typeclass>|n.')
        return
    obj = caller.search(self.lhs)
    if (not obj):
        return
    result = []
    if (not self.rhs):
        scripts = obj.scripts.all()
        if (not scripts):
            result.append(('No    scripts    defined    on    %s.' % obj.get_display_name(caller)))
        elif (not self.switches):
            from evennia.commands.default.system import format_script_list
            result.append(format_script_list(scripts))
        elif ('start' in self.switches):
            num = sum([obj.scripts.start(script.key) for script in scripts])
            result.append(('%s    scripts    started    on    %s.' % (num, obj.get_display_name(caller))))
        elif ('stop' in self.switches):
            for script in scripts:
                result.append(('Stopping    script    %s    on    %s.' % (script.get_display_name(caller), obj.get_display_name(caller))))
                script.stop()
        obj.scripts.validate()
    elif (not self.switches):
        ok = obj.scripts.add(self.rhs, autostart=True)
        if (not ok):
            result.append(('\nScript    %s    could    not    be    added    and/or    started    on    %s.' % (self.rhs, obj.get_display_name(caller))))
        else:
            result.append(('Script    |w%s|n    successfully    added    and    started    on    %s.' % (self.rhs, obj.get_display_name(caller))))
    else:
        paths = ([self.rhs] + [('%s.%s' % (prefix, self.rhs)) for prefix in settings.TYPECLASS_PATHS])
        if ('stop' in self.switches):
            for path in paths:
                ok = obj.scripts.stop(path)
                if (not ok):
                    result.append(('\nScript    %s    could    not    be    stopped.    Does    it    exist?' % path))
                else:
                    result = ['Script    stopped    and    removed    from    object.']
                    break
        if ('start' in self.switches):
            for path in paths:
                ok = obj.scripts.start(path)
                if (not ok):
                    result.append(('\nScript    %s    could    not    be    (re)started.' % path))
                else:
                    result = ['Script    started    successfully.']
                    break
    caller.msg(''.join(result).strip())
