Esempio n. 1
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')
Esempio n. 2
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
Esempio n. 3
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
Esempio n. 4
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
Esempio n. 5
0
def read_and_save_my_cards():
    #global game_position, my_1th_card , my_2th_card  , just_do_check_fold , my_seat_number , MY_PROFILE_NAME , bot_status

    config.my_1th_card, config.my_2th_card =\
    read_cards.read_my_cards(config.game_position, config.my_seat_number)

    if ('Unknown' in config.my_1th_card or 'Unknown' in config.my_2th_card):

        fix_game_disruption("my cards are read Unknown")
        config.my_1th_card, config.my_2th_card =\
        read_cards.read_my_cards(config.game_position, config.my_seat_number)

        if ('Unknown' in config.my_1th_card or 'Unknown' in config.my_2th_card
                or pm.flop_pixel(config.game_position)):

            set_just_do_check_fold_to_true("my cards are read Unknown again")

    shout("My cards are: %s, %s" % (config.my_1th_card, config.my_2th_card),
          color='green')
Esempio n. 6
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
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)))
Esempio n. 8
0
    if Hand_End_Cheker1 == False and pm.player_cards_pixel(game_position,  my_seat_number ) == True and waiting_for_first_hand == False :  
        read_and_global_my_cards() #
        play_sound() #


    its_my_turn = False
    Gray1 = True ; fo = 0 
    time1 = time.time()
    shout("Looking for light...", color = 'light_magenta') 
    while Hand_End_Cheker1 == False and (its_my_turn == False or Gray1 == True) and flop_stage == False and waiting_for_first_hand == False and time.time() - time1 < 5 * 60 :
        if pm.button_pixel(game_position, 'i_am_back') :
            fix_game_disruption("2.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 )
        Gray1 = pm.notification_banner_pixel(game_position,  my_seat_number )
        flop_stage = pm.flop_pixel(game_position)
        n20 = (time.time() - time1 - 60 ) // 20
        if time.time() - time1 > 1 * 60 and n20 >= fo :
            fix_game_disruption("3")
            fo += 1
            
    if not time.time() - time1 < 5 * 60 :
        raise Exception("5.1.Game is locked, force to restart, waiting_for_first_hand == None")

    if flop_stage == True :
        set_just_do_check_fold_to_true("1.5")
        screenshot_error("6.5 Pre Flop is Jumped, game must lagged")
        
         
    preflop_betting_round = 0 #(2018) shouldn't it be -1 ?! test it by printing for example player_cards_cache dic which prints rounds too
    if pm.active_player_pixel(game_position,  my_seat_number ) == True and Gray1 == False and hand_is_ended() == False and flop_stage == False and waiting_for_first_hand == False :