Exemplo n.º 1
0
        # Read new board state
        board = bot.get_board(current_board_id)
    elif result.status_code == 403:
        print("403")
        if (time.time() - _time4 > 60):
            break
        drops += 1
        continue
        # Game over, we are not allowed to move anymore
    else:
        #print(".")
        board = Board(result.json())
        score = board_bot["score"]

    # Get new state
    board_bot = board.get_bot(bot)
    if not board_bot:
        # Managed to get game over after move
        break
    # Don't spam the board more than it allows!

    # ===================
    #server = datetime.strptime(board_bot["nextMoveAvailableAt"][:-1], "%Y-%m-%dT%H:%M:%S.%f")
    #server = server + dt.timedelta(hours=2)
    #client = datetime.now()
    #print("11: "+str(server))
    #print("22: "+str(client))
    #if server > client:
    #    pass#print(".")
    #sleep(0.01)
    # ===================