示例#1
0
def process_force_tick(author: AccountId, message: str, server: Server,
                       **kwargs):
    assert_authorized(author, server, Authorization.DEVELOPER)
    parsed = parse_force_tick(message)
    if parsed is None:
        raise CommandException("Learn to Format SMH")

    amount = parsed
    i = 0
    while i < amount:
        i += 1
        print(i)
        server.notify_tick_elapsed(time.time())

    return f"successfully forced {amount} ticks"
def force_ticks(author: Union[AccountId, str], amount: int, server: Server):
    """Forcibly run multiple ticks"""
    author = _get_account(author, server)
    _assert_authorized(author, None)
    for _ in range(amount):
        server.notify_tick_elapsed(time.time())