Ejemplo n.º 1
0
def play_a_hand():
    t1 = time.time()
    while True:
        if shifted_to_next_stage():
            read_board_cards()
            if not stages_are_sequenced():
                set_just_do_check_fold_to_true('stages are not sequenced')
                screenshot_error('stages are not sequenced')
        if its_my_turn():
            update_betting_rounds()
            read_and_save_bets()
            if config.bot_status == 'I_AM_PLAYING':
                click_decision()  #🌏🌱♣♠♦♥🌱🌏
        if t1 - time.time() > 5 * 60:
            config.bot_status = 'WAITING_FOR_FIRST_HAND'
            fix_game_disruption('This hand last more than 5 minutes')
        config.new_hand = hand_is_ended()
        if config.new_hand:
            shout("appending hand data to csv file", color='on_green')
            append_new_line_to_csv(config.csv_path)
            shout("-------- Hand ended --------", color='on_green')
            break
        if game_is_paused():
            fix_game_disruption('game is unpaused')
            break
        if config.bot_status != 'I_AM_PLAYING':
            break
Ejemplo n.º 2
0
def play_a_hand():
    t1 = time.time()
    while True:
        if shifted_to_next_stage():
            read_board_cards()
            if not stages_are_sequenced():
                set_just_do_check_fold_to_true('stages are not sequenced')
                screenshot_error('stages are not sequenced')
        if its_my_turn():
            update_betting_rounds()
            read_and_save_bets()
            if config.bot_status == 'I_AM_PLAYING':
                click_decision()  #🌏🌱♣♠♦♥🌱🌏
        if t1 - time.time() > 5 * 60:
            fix_game_disruption('This hand last more than 5 minutes')
        config.new_hand = hand_is_ended()
        if config.new_hand:
            shout("-------- Hand ended --------", color='on_green')
            break
        if config.bot_status != 'I_AM_PLAYING':
            break
        if game_is_paused():
            input("press Enter to start again...")
            fix_game_disruption('game is unpaused')
            break
Ejemplo n.º 3
0
        if config.bot_status != 'I_AM_PLAYING':
            continue
        play_sound_for_good_starting_hands()

        shout("Waiting for my turn at preflop_stage...", 'light_magenta')
        t1 = time.time()
        # Playing a whole hand in this loop
        while True:
            if shifted_to_next_stage():
                read_board_cards()
                if not stages_are_sequenced():
                    set_just_do_check_fold_to_true('stages are not sequenced')
                    screenshot_error('stages are not sequenced')
            if its_my_turn():
                update_betting_rounds()
                read_and_save_bets()
                if config.bot_status == 'I_AM_PLAYING':
                    click_decision()
            if t1 - time.time() > 5 * 60:
                fix_game_disruption('This hand last more than 5 minutes')
            new_hand = hand_is_ended()
            if new_hand:
                shout("-------- Hand ended --------", color='on_green')
                break
            if config.bot_status != 'I_AM_PLAYING':
                break

    else:
        # Develop 'OBSERVING' status for bot_status later.
        # 'OBSERVING' status can be used to test screen monitoring or to
        # get opponents playing styles or to gather statistical data.
Ejemplo n.º 4
0
            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 :
        preflop_betting_round += 1
        shout("light is founded", color = 'light_magenta')
        read_and_save_bets() #
        click_decision() # preflop
    elif hand_is_ended() == False and flop_stage == False and waiting_for_first_hand == False :
        fix_game_disruption("4 Entering This section is not possible")
        screenshot_error("6.6 Entering This section is not possible")
        #(2018) shouldn't preflop_betting_round += 1 line be here too ?!
        read_and_save_bets() #
        click_decision() # preflop



# PreFlop: -------


    if waiting_for_first_hand == False :