Пример #1
0
def get_opponent_flop_reaction(screen_area, stack_collection, db):
    hand_value = session_log.get_hand_value(screen_area, db)
    combination_value = db_query.get_combination_value('flop', hand_value, db)
    stack = session_log.get_last_row_from_log_session(screen_area, db)[0][1]
    if hand_value is None:
        return False
    opponent_reaction = image_processing.search_last_opponent_action(
        screen_area, db)
    if not isinstance(opponent_reaction, str):
        opponent_reaction = opponent_reaction['alias']
    if opponent_reaction in ('1', '2', '3') and combination_value in ('draw', 'other', 'composite') \
            and int(stack) <= 13 and current_stack.search_current_stack(screen_area, stack_collection, db) <= 13:
        keyboard.press('q')
        session_log.update_action_log_session('push', str(screen_area), db)
    elif combination_value == 'draw' and pot_odds.check_is_call_valid(
            screen_area, hand_value, 'turn', stack_collection, db):
        keyboard.press('c')
        session_log.update_action_log_session('cc_postflop', str(screen_area),
                                              db)
    elif opponent_reaction in ('1', '2') and hand_value not in (
            'trash', 'gutshot', 'bottom_pair',
            'over_cards') and combination_value != 'draw':
        keyboard.press('c')
        session_log.update_action_log_session('cc_postflop', str(screen_area),
                                              db)
    elif opponent_reaction == 'check':
        keyboard.press('h')
        session_log.update_action_log_session('cc_postflop', str(screen_area),
                                              db)
    else:
        keyboard.press('f')
        session_log.update_action_log_session('fold', str(screen_area), db)
    return True
Пример #2
0
def get_hand_value(hand, screen_area, db):
    hand_value = check_pair(hand, screen_area, db)
    if hand_value != True:
        hand_value = check_flush_draw(hand, screen_area, hand_value, db)
    if hand_value != True:
        check_straight_draw(hand, screen_area, hand_value, db)
    hand_value = session_log.get_hand_value(screen_area, db)
    return hand_value
Пример #3
0
def check_is_raise_cbet(screen_area, stack_collection, db):
    hand_value = session_log.get_hand_value(screen_area, db)
    combination_value = db_query.get_combination_value('flop', hand_value, db)
    opponent_reaction = image_processing.search_last_opponent_action(screen_area, db)
    stack = session_log.get_last_row_from_log_session(screen_area, db)[0]['current_stack']
    if not isinstance(opponent_reaction, str):
        opponent_reaction = opponent_reaction['alias']
    if raise_cbet_action(screen_area, hand_value, combination_value, opponent_reaction, stack, stack_collection, db):
        return True
Пример #4
0
def test_get_hand_value(screen_area, db):
    print(session_log.get_hand_value(screen_area, db))