def main(): hwnd = win32gui.GetForegroundWindow() win32gui.SetWindowPos(hwnd, win32con.HWND_TOPMOST, 1153, 222, 440, 593, 0) # Cleaning variables off the last run by set them all to None. set_all_variables_to_none() create_report_folder() # Initial values: config.MY_PROFILE_NAME = "XOwl" config.hand_number = 0 config.csv_path = 'hand_history_data_base/hands history version %s.csv'\ %decision_making.play.VERSION try: df = pd.read_csv(config.csv_path) config.game_number = df.at[df.index[-1], 'Game number'] + 1 except: config.game_number = 1 if input("Is my name: %s ?(Enter:yes/any keyword:no)" % config.MY_PROFILE_NAME) != "": config.MY_PROFILE_NAME = input("Enter profile name: ") config.my_seat_number = 2 #int( input("My seat number? ") ) config.TOTAL_SEATS = 5 config.BLIND_VALUE = 100000000 config.bot_status = 'WAITING_FOR_FIRST_HAND' config.game_position = find_game_position.find_game_reference_point() start_the_bot()
def main(): hwnd = win32gui.GetForegroundWindow() win32gui.SetWindowPos(hwnd,win32con.HWND_TOPMOST,1153,222,440,593,0) # Cleaning variables off the last run by set them all to None. set_all_variables_to_none() create_report_folder() # Initial values: config.MY_PROFILE_NAME = "XOwl" if input("Is my name: %s ?(Enter:yes/any keyword:no)"%config.MY_PROFILE_NAME) != "" : config.MY_PROFILE_NAME = input("Enter profile name: ") config.my_seat_number = 2 #int( input("My seat number? ") ) config.bot_status = 'WAITING_FOR_FIRST_HAND' config.BLIND_VALUE = 100000000 config.game_position = find_game_position.find_game_reference_point() start_the_bot()
#OK import config from iprint import shout import screen_monitoring.find_game_position.find_game_position as find_game_position import screen_monitoring.pixel_matching.pixel_matching as pm from readability.ocr import ocr_bet, ocr_other_players_bank, ocr_my_bank, ocr_other_names, ocr_my_name from readability.fix_game_disruption import set_just_do_check_fold_to_true,\ reset_just_do_check_fold_to_false #testing sub packages imports test = False if test == True: config.game_position = find_game_position.find_game_reference_point() #print(read_cards.read_flop_cards(game_position)) #decision_making.rules_and_info.flush.load_variables() input("wait") def set_all_variables_to_none(): """By running the program every time, we'll make sure config variables are cleaned off the last run""" config.game_position , config.DATED_REPORT_FOLDER , config.REPORTS_DIRECTORY,\ config.preflop_stage , config.flop_stage , config.turn_stage , config.river_stage ,\ config.preflop_betting_round , config.flop_betting_round ,\ config.turn_betting_round , config.river_betting_round ,\ config.board_card_1th , config.board_card_2th , config.board_card_3th ,\ config.board_card_4th, config.board_card_5th , config.my_1th_card , config.my_2th_card ,\ config.my_seat_number , config.MY_PROFILE_NAME ,\ config.just_do_check_fold , config.bot_status , config.new_hand,\ config.player_cards_cache , config.white_chips_cache , config.red_chips_cache , config.bets_cache ,\ config.last_white_chips_cache , config.last_red_chips_cache ,\
def test_find_game_position(): game_position = find_game_position.find_game_reference_point() print('game_position is: (%s, %s)' % game_position)
def fix_game_disruption( String=None): #if find_game_reference_point() == None or ... #global game_position , my_seat_number , MY_PROFILE_NAME , bot_status , just_do_check_fold shout(7 * "-", color='yellow') if String == None: shout("fix_game_disruption() is running....", color='yellow') elif type(String) == str: shout("fix_game_disruption() <-- %s is running...." % String, color='yellow') if is_internet_disconnected(): shout('Internet is Disconnected, waiting to reconect...') while is_internet_disconnected(): continue shout('Internet is Connected Back!') time.sleep(15) if find_and_click_on_reconnect_button() == None: screenshot_error('No reconnect button founded') click( 'exit_probable_advertisement') # click to Exit probable Advertisement shout("Position (0,720) is clicked", color='yellow') pyautogui.press('esc') config.game_position = pyautogui.locateOnScreen( 'screen_monitoring/find_game_position/reference image.png') if config.game_position == None: config.alternative_game_position = pyautogui.locateOnScreen( 'screen_monitoring/find_game_position/alternative reference image.png' ) if config.alternative_game_position != None: config.game_position = (alternative_game_position[0] + 328, alternative_game_position[1] - 245) if config.game_position != None: config.game_position = (int(config.game_position[0]), int(config.game_position[1])) else: for process in wmi.WMI().Win32_Process(): if process.Name == 'SystemSettings.exe': shout("SystemSettings Update is on desktop") shout("closing Windows Update program") screenshot_error('right before closing windows update program') click('close_update_window') break if config.game_position == None: config.game_position = find_game_position.find_game_reference_point() if config.game_position != None: shout("Game region refounded after fix_game_disruption()", color='yellow') if config.bot_status != 'OBSERVING': if pm.button_pixel(config.game_position, 'i_am_back'): click('i_am_back') if pm.player_cards_pixel(config.game_position, config.my_seat_number) == True: config.just_do_check_fold = True shout( "After fix_game_disruption() --> just_do_check_fold is True.", color='yellow') else: config.bot_status = 'WAITING_FOR_FIRST_HAND' shout( "After fix_game_disruption() --> bot_status is 'WAITING_FOR_FIRST_HAND'.", color='on_yellow') if check_i_am_in_or_out() == "Out": sit_in("Min buy in") shout(7 * "-", color='yellow')