Exemplo n.º 1
0
def read_premiums(number_of_refundable_deposits):
    global premium_dict
    list_of_premiums = []
    number_of_dep_premiums = 0
    number_of_premiums = 0
    sc.get_m3_coordinates()
    x, y = m3['title']
    pyautogui.click(m3['premiums'])
    image = pyautogui.locateCenterOnScreen(
        'C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
        region=(514, 245, 889, 566))
    while image is None:
        image = pyautogui.locateCenterOnScreen(
            'C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
            region=(514, 245, 889, 566))
    while True:
        screenshot_2 = cf.take_screenshot_change_color(x + 433, y + 60, 10, 8)
        premium = sqlite_select(
            cf.take_screenshot_change_color(x + 342, y + 60, 80, 11),
            'premiums')
        if premium == 'nothing':
            break
        else:
            if screenshot_2 == sqlite_get_item(
                    "SELECT screenshot FROM premiums WHERE name=?",
                ['Did Not Issue']):
                premium = f'{premium} - Canceled'
            if 'DEP' in premium and 'Canceled' not in premium:
                number_of_dep_premiums += 1
                # if '20' in premium:
                #     screenshot = '20'
                # elif '40' in premium:
                #     screenshot = '40'
                # elif '$50 ' in premium:
                #     screenshot = '50'
                # elif '99' in premium:
                #     screenshot = '99'
            list_of_premiums.append(premium)
            number_of_premiums += 1
            y += 13
    if number_of_dep_premiums != number_of_refundable_deposits:
        log.info(
            str(number_of_dep_premiums) + ' DEP Premium(s) - ' +
            str(number_of_refundable_deposits) + ' Refundable Deposit(s)')
        print(u"\u001b[31m" + str(number_of_dep_premiums) +
              ' DEP Premium(s) - ' + str(number_of_refundable_deposits) +
              ' Refundable Deposit(s)' + u"\u001b[0m")
    else:
        print(u"\u001b[32m" + str(number_of_dep_premiums) +
              ' DEP Premium(s) - ' + str(number_of_refundable_deposits) +
              ' Refundable Deposit(s)' + u"\u001b[0m")
    if number_of_premiums != len(set(list_of_premiums)):
        print(u"\u001b[31m" + str(number_of_premiums) +
              ' Premium(s) - DUPLICATES' + u"\u001b[0m")
    else:
        print(u"\u001b[32m" + str(number_of_premiums) +
              ' Premium(s) - No Duplicates' + u"\u001b[0m")
    return list_of_premiums
Exemplo n.º 2
0
def create_deposit_dataframe():
    sc.get_m3_coordinates()
    x, y = m3['deposit_1']
    x_2, y_2 = m3['title']
    d = []
    number_of_deposits = count_deposits()
    if number_of_deposits == 0:
        number_of_refundable_deposits = 0
        return 'No Deposits', number_of_refundable_deposits
    for i in range(number_of_deposits):
        clipboard.copy('bad')
        hundreds = str(
            sqlite_select(
                cf.take_screenshot_change_color(x_2 + 467, y_2 + 69 + i * 13,
                                                6, 9), 'numbers'))
        tens = str(
            sqlite_select(
                cf.take_screenshot_change_color(x_2 + 473, y_2 + 69 + i * 13,
                                                6, 9), 'numbers'))
        ones = str(
            sqlite_select(
                cf.take_screenshot_change_color(x_2 + 479, y_2 + 69 + i * 13,
                                                6, 9), 'numbers'))
        if hundreds == 'nothing':
            hundreds = ''
        if tens == 'nothing':
            tens = ''
        price = hundreds + tens + ones
        pyautogui.click(x, y)
        y += 13
        pyautogui.click(m3['change_deposit'])
        sc.get_m6_coordinates()
        pyautogui.click(m6['description'])
        keyboard.send('ctrl + z')
        keyboard.send('ctrl + c')
        r = Tk()
        result = r.selection_get(selection="CLIPBOARD")
        while result == 'bad':
            pyautogui.click(m6['description'])
            keyboard.send('ctrl + z')
            keyboard.send('ctrl + c')
            result = r.selection_get(selection="CLIPBOARD")
        if 'refunded' in result.lower():
            deposit_type = 'Refunded'
        elif 'minivac' in result.lower() or 'apply' in result.lower():
            deposit_type = 'Non_Refundable'
        elif 'ref' in result.lower():
            deposit_type = 'Refundable'
        else:
            deposit_type = 'Non_Refundable'
        d.append({'Deposit_Type': deposit_type, 'Price': price})
        pyautogui.click(m6['ok'])
    df = pd.DataFrame(d)  # Turn d into a dataframe
    deposit_df = df[['Deposit_Type',
                     'Price']]  # Reorders the columns in the dataframe.
    number_of_refundable_deposits = len(df[(df.Deposit_Type == 'Refundable')])
    return deposit_df, number_of_refundable_deposits
Exemplo n.º 3
0
 def amount(self):
     x, y = m3['title']
     hundreds = str(sqlite_select(cf.take_screenshot_change_color(x + 467, y + 69 + self.index * 13, 6, 9), 'numbers'))
     tens = str(sqlite_select(cf.take_screenshot_change_color(x + 473, y + 69 + self.index * 13, 6, 9), 'numbers'))
     ones = str(sqlite_select(cf.take_screenshot_change_color(x + 479, y + 69 + self.index * 13, 6, 9), 'numbers'))
     if hundreds == 'nothing':
         hundreds = ''
     if tens == 'nothing':
         tens = ''
     amount = hundreds + tens + ones
     return amount
Exemplo n.º 4
0
 def site(self):
     sc.get_m2_coordinates()
     x, y = m2['title']
     conn = sqlite3.connect('sqlite.sqlite')
     c = conn.cursor()
     if pyautogui.pixelMatchesColor(1318, 358, (214, 211, 206)):
         screenshot = cf.take_screenshot_change_color(x + 671, y + 64 + self.index * 13, 6, 9)
     else:
         screenshot = cf.take_screenshot_change_color(x + 687, y + 64 + self.index * 13, 6, 9)
     if screenshot != 'nothing':
         c.execute("SELECT name FROM numbers WHERE screenshot=?", [screenshot])
         tour_site = str(c.fetchone()[0])
         return tour_site
Exemplo n.º 5
0
def enter_personnel(sol, row):
    sc.get_m3_coordinates()
    for i in row.type:
        pyautogui.click(m3['personnel'])
        pyautogui.click(m3['insert_personnel'])
        sc.get_m12_coordinates()
        x, y = m12['title']
        screenshot = cf.take_screenshot_change_color(x + 44, y + 16, 9, 27)
        screenshot_2 = sqlite_get_item(
            "SELECT screenshot FROM misc WHERE name=?",
            ['by_personnel_number_selected'])
        test = 0
        while screenshot != screenshot_2:
            pyautogui.click(m12['by_personnel_number'])
            screenshot = cf.take_screenshot_change_color(x + 44, y + 16, 9, 27)
            screenshot_2 = sqlite_get_item(
                "SELECT screenshot FROM misc WHERE name=?",
                ['by_personnel_number_selected'])
            test += 1
            if test >= 5:
                print(x, y, m12['by_personnel_number'])
        keyboard.write(sol)
        pyautogui.click(m12['select'])
        image = pyautogui.locateCenterOnScreen(
            'C:\\Users\\Jared.Abrahams\\Screenshots\\sc_personnel_titles_menu.png',
            region=(514, 245, 889, 566))
        while image is None:
            image = pyautogui.locateCenterOnScreen(
                'C:\\Users\\Jared.Abrahams\\Screenshots\\sc_personnel_titles_menu'
                '.png',
                region=(514, 245, 889, 566))
        x_3, y_3 = image
        pyautogui.click(x_3 + 75, y_3 + 150)  # Close
        sc.get_m13_coordinates()
        if cf.take_screenshot_change_color(m13['title'][0] + 26, m13['title'][1] + 73, 45, 15) != \
                sqlite_get_item("SELECT screenshot FROM misc WHERE name=?", ['confirmer']):
            pyautogui.click(m13['title_personnel'])
            keyboard.write("cc")
        pyautogui.click(m13['type'])
        if i == 'c':
            keyboard.write("cc")
        elif i == 'r':
            keyboard.write("r")
        elif i == 'x':
            keyboard.write("c")
        elif i == 'u':
            keyboard.write("u")
        elif i == 't':
            keyboard.write("t")
        pyautogui.click(m13['ok'])
Exemplo n.º 6
0
 def description(self):
     x, y = m3['title']
     screenshot = cf.take_screenshot_change_color(x + 266, y + 68 + 13 * self.index, 154, 10)
     conn = sqlite3.connect('sqlite.sqlite')
     c = conn.cursor()
     try:
         c.execute("SELECT name FROM deposits WHERE screenshot=?", [screenshot])
         description = c.fetchone()[0]
         return description
     except TypeError:
         clipboard.copy('bad')
         pyautogui.click(x + 266, y + 68 + 13 * self.index)
         pyautogui.click(m3['change_deposit'])
         sc.get_m6_coordinates()
         pyautogui.click(m6['description'])
         keyboard.send('ctrl + z')
         keyboard.send('ctrl + c')
         r = Tk()
         description = r.selection_get(selection="CLIPBOARD")
         while description == 'bad':
             pyautogui.click(m6['description'])
             keyboard.send('ctrl + z')
             keyboard.send('ctrl + c')
             description = r.selection_get(selection="CLIPBOARD")
         pyautogui.click(m6['ok'])
         return description
Exemplo n.º 7
0
def count_accommodations():
    number_of_accommodations = 0
    number_of_canceled_accommodations = 0
    x, y = m3['title']
    while True:
        screenshot = cf.take_screenshot_change_color(x + 587, y + 64, 6, 9)
        if screenshot == 'nothing':
            return number_of_accommodations, number_of_canceled_accommodations
        else:
            screenshot_2 = cf.take_screenshot_change_color(x + 272, y + 64, 47, 8)
            if screenshot_2 == 'nothing':
                number_of_canceled_accommodations += 1
                y += 13
            else:
                number_of_accommodations += 1
                y += 13
Exemplo n.º 8
0
 def canceled(self):
     x, y = m3['title']
     screenshot = cf.take_screenshot_change_color(x + 433,
                                                  y + 60 + self.index * 13,
                                                  10, 8)
     if screenshot == 'nothing':
         return 'no'
     else:
         return 'yes'
Exemplo n.º 9
0
def count_items_in_deposit():
    sc.get_m6_coordinates()
    number_of_deposit_items = 0
    x, y = m6['title']
    while True:
        screenshot = cf.take_screenshot_change_color(x + 339, y + 189, 10, 8)
        if screenshot == "nothing":
            return number_of_deposit_items
        else:
            number_of_deposit_items += 1
            y += 13
Exemplo n.º 10
0
 def canceled(self):
     global conn
     c = conn.cursor()
     x, y = m3['title']
     screenshot = cf.take_screenshot_change_color(x + 433, y + 60 + self.index * 13, 10, 8)
     # c.execute("SELECT screenshot FROM premiums WHERE name=?", ['Did Not Issue'])
     # did_not_issue = c.fetchone[0]
     if screenshot == 'nothing':
         return 'no'
     else:
         return 'yes'
Exemplo n.º 11
0
 def site(self):
     sc.get_m2_coordinates()
     x, y = m2['title']
     conn = sqlite3.connect('sqlite.sqlite')
     c = conn.cursor()
     screenshot = cf.take_screenshot_change_color(x + 687,
                                                  y + 64 + self.index * 13,
                                                  6, 9)
     if screenshot != 'nothing':
         try:
             c.execute("SELECT name FROM numbers WHERE screenshot=?",
                       [screenshot])
             tour_site = str(c.fetchone()[0])
         except TypeError:
             screenshot = cf.take_screenshot_change_color(
                 x + 671, y + 64 + 0 * 13, 6, 9)
             c.execute("SELECT name FROM numbers WHERE screenshot=?",
                       [screenshot])
             tour_site = str(c.fetchone()[0])
         return tour_site
Exemplo n.º 12
0
 def wave(self):
     sc.get_m3_coordinates()
     x, y = m3['title']
     conn = sqlite3.connect('sqlite.sqlite')
     c = conn.cursor()
     wave = ''
     for i in range(4):
         screenshot = cf.take_screenshot_change_color(x + 37 + 6 * i, y + 247, 6, 9)
         if screenshot != 'nothing':
             c.execute("SELECT name FROM numbers WHERE screenshot=?", [screenshot])
             number = str(c.fetchone()[0])
             wave += number
         else:
             continue
     return wave
Exemplo n.º 13
0
 def double_check_pid(self):
     sc.get_m2_coordinates()
     x, y = m2['title']
     pid_screenshot = ''
     conn = sqlite3.connect('sqlite.sqlite')
     c = conn.cursor()
     for i in range(7):
         screenshot = cf.take_screenshot_change_color(x + 74 + 6 * i, y + 48, 6, 9)
         c.execute("SELECT name FROM numbers WHERE screenshot=?", [screenshot])
         number = str(c.fetchone()[0])
         if number != 'nothing':
             pid_screenshot += number
         else:
             continue
     if pid_screenshot != self.pid:
         cf.pause('Is the pid correct?')
         return
Exemplo n.º 14
0
def count_premiums():
    number_of_premiums = 0
    sc.get_m3_coordinates()
    x, y = m3['title']
    pyautogui.click(m3['premiums'])
    image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
                                           region=(514, 245, 889, 566))
    while image is None:
        image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
                                               region=(514, 245, 889, 566))
    while True:
        premium = cf.take_screenshot_change_color(x + 342, y + 60, 80, 11)
        if premium == 'nothing':
            break
        else:
            number_of_premiums += 1
            y += 13
    return number_of_premiums
Exemplo n.º 15
0
 def name(self):
     x, y = m3['title']
     premium = sqlite_select(cf.take_screenshot_change_color(x + 342, y + 60 + self.index * 13, 80, 11), 'premiums')
     return premium
Exemplo n.º 16
0
def notes(status):
    global errors
    sc.get_m3_coordinates()
    pyautogui.click(m3['notes'])
    x, y = m3['title']
    number_of_notes = 0
    image = pyautogui.locateCenterOnScreen(
        'C:\\Users\\Jared.Abrahams\\Screenshots\\note.png',
        region=(1045, 515, 50, 30))
    while image is None:
        image = pyautogui.locateCenterOnScreen(
            'C:\\Users\\Jared.Abrahams\\Screenshots\\note'
            '.png',
            region=(1045, 515, 50, 30))
    while cf.take_screenshot(x - 54, y + 58, 25, 10) != sc.note_nothing:
        number_of_notes += 1
        y += 13
    x, y = m3['notes']
    if number_of_notes == 0:
        print(u"\u001b[31m" + 'NO NOTES' + u"\u001b[0m")
        errors += 1
        return
    for note in range(number_of_notes):
        copied = []
        pyautogui.click(x, y + 40)
        pyautogui.click(m3['notes_change'])
        sc.get_m11_coordinates()
        x_2, y_2 = m11['title']
        # Take screenshot of note title
        screenshot = cf.take_screenshot_change_color(x_2 + 25, y_2 + 47, 28,
                                                     13)
        # Drag mouse cursor to select text in note.
        pyautogui.click(x_2 + 25, y_2 + 75)
        pyautogui.dragTo(x_2 + 250, y_2 + 150, button='left')
        # Copy Note
        keyboard.send('ctrl + c')
        r = Tk()
        result = r.selection_get(selection="CLIPBOARD")
        if result in copied:
            print(u"\u001b[31m" + 'COULDN\'T FIND CORRECT NOTE' + u"\u001b[0m")
            errors += 1
            pyautogui.click(x_2 + 200, y_2 + 250)
            return
        # for key, value in sol_numbers.items():
        #     words = re.findall(r'\w+', key)
        #     if words[1].lower() in result.lower() and words[1].lower() != 'major':
        #         print(u"\u001b[31m" + 'IMPORTANT NOTE' + u"\u001b[0m")
        if status == 'c' and 'conf' in result.lower():
            print(u"\u001b[32m" + 'Confirm note is present' + u"\u001b[0m")
            pyautogui.click(x_2 + 200, y_2 + 250)
            return
        elif status == 'x' and screenshot == sc.note_canc:
            print(u"\u001b[32m" + 'Cancel note is present' + u"\u001b[0m")
            pyautogui.click(x_2 + 200, y_2 + 250)
            if 'nq' in result.lower():
                pyautogui.click(m3['tour'])
                if pyautogui.locateCenterOnScreen(
                        'C:\\Users\\Jared.Abrahams\\Screenshots\\tour_result.png',
                        region=(514, 400, 889, 500)) is None:
                    print(u"\u001b[32m" + 'Tour Result is correct' +
                          u"\u001b[0m")
                else:
                    print(u"\u001b[31m" + 'NO TOUR RESULT' + u"\u001b[0m")
                    errors += 1
            return
        elif status == 'r' and any(
                i in result.lower()
                for i in ['rxl', 'reschedule', 'od', 'open', 'new date']):
            print(u"\u001b[32m" + 'Reschedule note is present' + u"\u001b[0m")
            pyautogui.click(x_2 + 200, y_2 + 250)
            return
        else:
            pyautogui.click(x_2 + 200, y_2 + 250)
            y += 13
    # If the for loop ends that means none of the notes fit the criteria above. An error message is then printed.
    print(u"\u001b[31m" + 'COULDN\'T FIND CORRECT NOTE' + u"\u001b[0m")
    errors += 1
    return
Exemplo n.º 17
0
def change_deposit_title(price, cash=None):
    """
    Checks to make sure that the deposit price is correct. Ex: If the sheet says $50, then this makes sure that the
    deposit is also $50.
    Changes the title from 'Refundable' to 'Refunded'
    :rtype: 'prev', 'ams', 'ir', 'sol', 'ih'
    """
    sc.get_m3_coordinates()
    amount = 0
    old_title = 'old'
    x, y = m3['title']
    attempts = 0
    number_of_deposits = count_deposits()
    pyautogui.click(m3['tour_packages'])
    image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\balance.png',
                                           region=(700, 245, 850, 566))
    while image is None:
        image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\balance.png',
                                               region=(700, 245, 850, 566))
    for i in range(number_of_deposits):
        hundreds = str(sqlite_select(cf.take_screenshot_change_color(x + 467, y + 69 + i * 13, 6, 9), 'numbers'))
        tens = str(sqlite_select(cf.take_screenshot_change_color(x + 473, y + 69 + i * 13, 6, 9), 'numbers'))
        ones = str(sqlite_select(cf.take_screenshot_change_color(x + 479, y + 69 + i * 13, 6, 9), 'numbers'))
        if hundreds == 'nothing':
            hundreds = ''
        if tens == 'nothing':
            tens = ''
        amount = hundreds + tens + ones
        if amount == price:
            x_2, y_2 = m3['deposit_1']
            pyautogui.click(x_2, y_2 + i * 13)
            pyautogui.click(m3['change_deposit'])
            break
    while amount != price and attempts <= 2:
        pyautogui.click(m3['tour_packages'])
        image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\balance.png',
                                               region=(700, 245, 850, 566))
        while image is None:
            image = pyautogui.locateCenterOnScreen('C:\\Users\\Jared.Abrahams\\Screenshots\\balance.png',
                                                   region=(700, 245, 850, 566))
        pyautogui.click(x_2, y_2)
        pyautogui.click(m3['change_deposit'])

    sc.get_m6_coordinates()
    deposit_item_amount = count_deposit_items()
    x, y = m6['deposit_1']
    y = y + 13 * (deposit_item_amount - 1)
    pyautogui.click(x, y)
    time.sleep(0.3)
    with mss.mss() as sct:
        # Takes screenshot of lowest amount inside of the deposit
        x, y = m6['title']
        y = y + 13 * (deposit_item_amount - 1)
        monitor = {'top': y + 189, 'left': x + 185, 'width': 33, 'height': 8}
        im = sct.grab(monitor)
        try:
            amount = sc.deposit_item_amount[str(mss.tools.to_png(im.rgb, im.size))]
        except KeyError:
            amount = 0
            print('Don\'t recognize the amount')
            print(mss.tools.to_png(im.rgb, im.size))
            print(deposit_item_amount, x, y)
            output = 'monitor-1-crop.png'
            mss.tools.to_png(im.rgb, im.size, output=output)
        attempts += 1
    if amount != price:
        pyautogui.click(m3['ok'])
        return 'fail'
    attempts = 0
    while 'ref' not in old_title.lower() and attempts <= 3:
        pyautogui.click(m6['description'])
        keyboard.send('ctrl + z')
        keyboard.send('ctrl + c')
        old_title = clipboard.paste()
        attempts += 1
    if 'ref' not in old_title.lower():
        if old_title.lower() == 'ams dep':
            old_title = 'AMS/Refunded Deposit'
        else:
            sys.exit("Wrong Title")
    new_title = old_title.replace("able", "ed")
    new_title = new_title.replace("ABLE", "ED")
    new_title = new_title.replace(" /", "/")
    new_title = new_title.replace("/ ", "/")
    keyboard.write(new_title)
    if 'prev' in new_title.lower() and cash is None:
        return 'prev'
    elif 'ir' in new_title.lower() and 'refunded' in new_title.lower():
        return "ir"
    elif 'ams' in new_title.lower() and 'refunded' in new_title.lower():
        return "ams"
    elif 'sol' in new_title.lower() and 'refunded' in new_title.lower():
        return "sol"
    elif 'ih' in new_title.lower() and 'refunded' in new_title.lower():
        return 'ih'
Exemplo n.º 18
0
def select_premium(balance, index):
    premium_list = []
    sc.get_m3_coordinates()
    x, y = m3['title']
    pyautogui.click(m3['premiums'])
    pyautogui.click(m3['notes'])
    # action = input('What to do?')
    # if action not in ['note', '50', '40']:
    #     return 'good'
    # elif action == 'note':
    #     return 'note'
    # else:
    #     balance = action
    image = pyautogui.locateCenterOnScreen(
        'C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
        region=(514, 245, 889, 566))
    while image is None:
        image = pyautogui.locateCenterOnScreen(
            'C:\\Users\\Jared.Abrahams\\Screenshots\\issued.png',
            region=(514, 245, 889, 566))
    while True:
        screenshot_2 = cf.take_screenshot_change_color(x + 433, y + 60, 10, 8)
        premium = sqlite_select(
            cf.take_screenshot_change_color(x + 342, y + 60, 80, 11),
            'premiums')
        if premium == 'nothing':
            break
        elif screenshot_2 == sqlite_get_item(
                "SELECT screenshot FROM premiums WHERE name=?",
            ['Did Not Issue']):
            premium = f'{premium} - Canceled'
            premium_list.append(premium)
            y += 13
            continue
        else:
            premium_list.append(premium)
            y += 13
    number_of_dep_premiums_50 = premium_list.count(
        'DEP $50 CC') + premium_list.count('$50 CC Dep')
    number_of_dep_premiums_40 = premium_list.count(
        'DEP $40 CC') + premium_list.count('$40 CC Dep')
    total_number_of_dep_premiums = number_of_dep_premiums_50 + number_of_dep_premiums_40
    if balance == '0' and total_number_of_dep_premiums == 0:
        return 'no note'
    elif balance != '0' and total_number_of_dep_premiums == 0:
        sheet.update_cell(index, 4, 'No DEPs')
        return 'no note'
    elif total_number_of_dep_premiums > 1:
        sheet.update_cell(index, 4, 'Multiple DEPs')
        return 'no note'
    elif total_number_of_dep_premiums == '0' and f"DEP ${balance} Cash" in premium_list:
        sheet.update_cell(index, 4, 'Already done')
        return 'no note'
    else:
        x, y = m3['title']
        for premium in premium_list:
            if premium in [
                    'DEP $50 CC', '$50 CC Dep', 'DEP $40 CC', '$40 CC Dep'
            ] and balance in premium:
                pyautogui.click(x + 342, y + 60)
                pyautogui.click(sc.m3['change_premium'])
                sc.get_m10_coordinates()
                x, y = sc.m10['title']
                pyautogui.click(x + 198, y + 423)
                pyautogui.dragTo(x - 100, y + 300, button='left')
                keyboard.send('backspace')
                keyboard.write(
                    'Please refund by cash the charge is over 120 days and cannot be refunded back to CC.'
                )
                pyautogui.click(x + 160, y + 80)
                image = pyautogui.locateCenterOnScreen(
                    'C:\\Users\\Jared.Abrahams\\Screenshots\\titles'
                    '\\premium_search.png',
                    region=(514, 245, 889, 566))
                while image is None:
                    image = pyautogui.locateCenterOnScreen(
                        'C:\\Users\\Jared.Abrahams\\Screenshots\\titles'
                        '\\premium_search.png',
                        region=(514, 245, 889, 566))
                x, y = image
                pyautogui.click(x + 189, y + 35)
                keyboard.write(f"Dep ${balance} cash")
                pyautogui.click(x + 267, y + 35)
                pyautogui.click(x + 129, y + 476)
                sc.get_m10_coordinates()
                x, y = sc.m10['title']
                pyautogui.click(x + 80, y + 503)
                return
            else:
                y += 13