GeMercher.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:RunescapeBots 作者: lukegarbutt 项目源码 文件源码
def find_up_to_date_buy_price(runescape_window, ge_slot):
    # click correct sell bag
    move_mouse_to_image_within_region('Tools/screenshots/sell_bag.png', ge_slot)
    pyautogui.click()
    wait_for('Tools/screenshots/quantity_box.png', runescape_window)
    # sell item for cheap
    coords_of_item = pointfrombox.random_point((runescape_window.bottom_right_corner[0]-180, runescape_window.bottom_right_corner[1]-372), (runescape_window.bottom_right_corner[0]-166, runescape_window.bottom_right_corner[1]-349))
    realmouse.move_mouse_to(coords_of_item[0], coords_of_item[1])
    pyautogui.click()

    '''move_mouse_to_image_within_region('Tools/screenshots/-5perc_button.png', runescape_window)
    for i in range(random.randint(25,35)):
        pyautogui.click()
        time.sleep(random.random()/7)'''

    coords_of_price_box = pointfrombox.random_point((runescape_window.bottom_right_corner[0]-384, runescape_window.bottom_right_corner[1]-272), (runescape_window.bottom_right_corner[0]-291, runescape_window.bottom_right_corner[1]-259))##########################
    realmouse.move_mouse_to(coords_of_price_box[0], coords_of_price_box[1])
    pyautogui.click()
    time.sleep(2+random.random())
    random_typer('1')
    pyautogui.press('enter')#########################################################################################################

    time.sleep(random.random()+1)
    move_mouse_to_image_within_region('Tools/screenshots/confirm_offer_button.png', runescape_window)
    pyautogui.click()
    wait_for('Tools/screenshots/lent_item_box.png', runescape_window)
    # collect money
    collect_items_from_ge_slot(ge_slot, runescape_window)
    # click sale history
    move_mouse_to_image_within_region('Tools/screenshots/sale_history_button.png', runescape_window)
    pyautogui.click()
    wait_for('Tools/screenshots/sale_history_check.png', runescape_window)
    # check price
    sell_price = check_price(runescape_window)
    # updating the amount of money in the window
    runescape_window.update_money(runescape_window.money+sell_price)
    # update price
    ge_slot.item.set_price_instant_sold_at(sell_price)
    # click grand exchange window
    move_mouse_to_box('Tools/screenshots/grand_exchange_button.png',
                        runescape_window.top_left_corner, runescape_window.bottom_right_corner)
    pyautogui.click()
    wait_for('Tools/screenshots/lent_item_box.png', runescape_window)
    runescape_window.set_time_of_last_action()
    print('{} instantly sold for a price of {}'.format(ge_slot.item.item_name, ge_slot.item.price_instant_sold_at))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号