Example #1
0
def shifted_to_next_stage():
    if (not config.flop_stage and pm.flop_pixel() and not pm.turn_pixel()
            and not pm.river_pixel()):
        config.flop_stage = True
        shout("Waiting for my turn at flop_stage...", 'light_magenta')
        return True
    if not config.turn_stage and pm.turn_pixel() and not pm.river_pixel():
        config.turn_stage = True
        shout("Waiting for my turn at turn_stage...", 'light_magenta')
        return True
    if not config.river_stage and pm.river_pixel():
        config.river_stage = True
        shout("Waiting for my turn at river_stage...", 'light_magenta')
        return True
    return False
Example #2
0
def read_and_save_flop_cards():
    #global game_position, board_card_1th , board_card_2th , board_card_3th , just_do_check_fold , my_seat_number , MY_PROFILE_NAME , bot_status

    config.board_card_1th, config.board_card_2th, config.board_card_3th =\
    read_cards.read_flop_cards(config.game_position)

    if ('Unknown' in config.board_card_1th
            or 'Unknown' in config.board_card_2th
            or 'Unknown' in config.board_card_3th):

        fix_game_disruption("Flop cards are read 'Unknown'")
        config.board_card_1th, config.board_card_2th, config.board_card_3th =\
        read_cards.read_flop_cards(config.game_position)

        if ('Unknown' in config.board_card_1th
                or 'Unknown' in config.board_card_2th
                or 'Unknown' in config.board_card_3th
                or not pm.flop_pixel(config.game_position)
                or pm.turn_pixel(config.game_position)):

            set_just_do_check_fold_to_true(
                "Flop cards are read 'Unknown' again")

    shout(
        "Flop cards are: %s, %s, %s" %
        (config.board_card_1th, config.board_card_2th, config.board_card_3th),
        color='green')
Example #3
0
def stages_are_sequenced():
    if pm.flop_pixel() and config.preflop_stage == False:
        return False
    if pm.turn_pixel() and False in (config.preflop_stage, config.flop_stage):
        return False
    if (pm.river_pixel() and False
            in (config.preflop_stage, config.flop_stage, config.turn_stage)):
        return False
    return True
Example #4
0
def stages_are_sequenced(): 
    if pm.flop_pixel(c.game_position) and c.preflop_stage == False:
        return False
    if pm.turn_pixel(c.game_position) and False in (c.preflop_stage,
                                                         c.flop_stage):
        return False
    if (pm.river_pixel(c.game_position) and
        False in (c.preflop_stage, c.flop_stage, c.turn_stage)):
        return False
    return True
Example #5
0
def shifted_to_next_stage():
    if (not c.flop_stage and pm.flop_pixel(c.game_position) 
        and not pm.turn_pixel(c.game_position) 
        and not pm.river_pixel(c.game_position)):
        c.flop_stage = True
        if c.bot_status != 'OBSERVING':
            shout("Waiting for my turn at flop_stage...", 'light_magenta') 
        return True
    if (not c.turn_stage and pm.turn_pixel(c.game_position) 
        and not pm.river_pixel(c.game_position) ):
        c.turn_stage = True
        if c.bot_status != 'OBSERVING':
            shout("Waiting for my turn at turn_stage...", 'light_magenta') 
        return True
    if not c.river_stage and pm.river_pixel(c.game_position):
        c.river_stage = True
        if c.bot_status != 'OBSERVING':
            shout("Waiting for my turn at river_stage...", 'light_magenta')
        return True
    return False
Example #6
0
def read_and_save_turn_card():
    #global game_position, board_card_4th , just_do_check_fold , my_seat_number , MY_PROFILE_NAME , bot_status

    config.board_card_4th = read_cards.read_turn_card(config.game_position)

    if 'Unknown' in config.board_card_4th:

        fix_game_disruption("Turn card is read 'Unknown'")
        config.board_card_4th = read_cards.read_turn_card(config.game_position)

        if ('Unknown' in config.board_card_4th
                or not pm.turn_pixel(config.game_position)
                or pm.river_pixel(config.game_position)):

            set_just_do_check_fold_to_true("Turn card is read 'Unknown' again")

    shout("Turn card is: %s" % (config.board_card_4th[0]), color='green')
def test_pixel_matching():

    # This list may differ for other websites
    ALL_CLICK_NAMES = [
        'fold',
        'check',
        'call',
        'bet',
        'raise',
        'plus',
        'minus',
        'all_in',
        #'available_seat_1', 'available_seat_2', 'available_seat_3',
        #'available_seat_4', 'available_seat_5',
        'exit',
        'exit_yes',
        'menu',
        'rebuy_menu',
        'leave_next_hand_ok',
        'buy_in',
        'buy_in_plus',
        'buy_in_minus',
        're_buy',
        're_buy_plus',
        're_buy_minus',
        'i_am_back',
        #'exit_probable_advertisement', 'close_update_window',
    ]

    print('\n***testing pixel matching for buttons:***')

    for button_name in ALL_CLICK_NAMES:
        print('%s button pixel is: %s' %
              (button_name, pm.button_pixel(game_position, button_name)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('available_seat_%s button pixel is: %s' %
              (seat, pm.available_seat_pixel(game_position, seat)))

    print('\n***testing pixel matching for non buttons:***')

    print('pre_flop_pixel is: %s' % pm.pre_flop_pixel(game_position))
    print('flop_pixel is: %s' % pm.flop_pixel(game_position))
    print('turn_pixel is: %s' % pm.turn_pixel(game_position))
    print('river_pixel is: %s' % pm.river_pixel(game_position))
    for seat in range(1, TOTAL_SEATS + 1):
        print('small_blind_pixel at seat %s is: %s' %
              (seat, pm.small_blind_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('big_blind_pixel at seat %s is: %s' %
              (seat, pm.big_blind_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('dealer_pixel at seat %s is: %s' %
              (seat, pm.dealer_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('player_chips_pixel at seat %s is: %s' %
              (seat, pm.player_chips_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('player_cards_pixel at seat %s is: %s' %
              (seat, pm.player_cards_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('other_player_seated_pixel at seat %s is: %s' %
              (seat, pm.other_player_seated_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('i_am_seated_pixel at seat %s is: %s' %
              (seat, pm.i_am_seated_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('active_player_pixel at seat %s is: %s' %
              (seat, pm.active_player_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('my_seat_won_pixel at seat %s is: %s' %
              (seat, pm.my_seat_won_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('other_seat_won_pixel at seat %s is: %s' %
              (seat, pm.other_seat_won_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('notification_banner_pixel at seat %s is: %s' %
              (seat, pm.notification_banner_pixel(game_position, seat)))
    for seat in range(1, TOTAL_SEATS + 1):
        print('are_chips_white_or_red_pixel at seat %s is: %s' %
              (seat, pm.are_chips_white_or_red_pixel(game_position, seat)))
Example #8
0
            time02 = time.time() - time01
                
            time1 = time.time()
            time2 = time.time() - time1
            its_my_turn = False ; Turn1 = False ; fo = 0
            shout("Looking for Next sign...", color = 'light_magenta')
            while Hand_End_Cheker1 == False and its_my_turn == False and Turn1 == False and time2 < 1 * 60 :
                if time.time() - time1 > 30 and fo == 0 :
                    shout("Looking for game on screen after 30s of idle...")
                    game_position = find_game_position.find_game_reference_point()
                    fo = 1
                if pm.button_pixel(game_position, 'i_am_back') :
                    fix_game_disruption("6.5 I am back Button is True")
                Hand_End_Cheker1 = hand_is_ended()
                its_my_turn = pm.active_player_pixel(game_position,  my_seat_number )
                Turn1 = pm.turn_pixel(game_position)
                time2 = time.time() - time1

            if not time2 < 1 * 60 :
                fix_game_disruption("7")
                
            if Hand_End_Cheker1 == False :

                if its_my_turn == True and Turn1 == False :
                    flop_betting_round += 1
                    shout("light is founded", color = 'light_magenta')
                    if is_there_any_raiser() == True :
                        read_and_save_bets() #
                        click_decision() # Flop
                    elif flop_betting_round > 0 :
                        set_just_do_check_fold_to_true("4")