def prevent_logout(top_left_corner, bottom_right_corner, runescape_window):
seed = random.random()
x, y = pyautogui.size()
if seed > 0.5: # opens up the sale history tab for 5 seconds then returns to ge tab
while(True):
realmouse.move_mouse_to(random.randint(0,x), random.randint(0,y))
if len(list(pyautogui.locateAllOnScreen('Tools/screenshots/sale_history_button.png', region=(top_left_corner[0], top_left_corner[1], bottom_right_corner[0]-top_left_corner[0], bottom_right_corner[1]-top_left_corner[1]))))>0:
move_mouse_to_box('Tools/screenshots/sale_history_button.png', top_left_corner, bottom_right_corner)
pyautogui.click()
time.sleep(9*random.random()+1)
move_mouse_to_box('Tools/screenshots/grand_exchange_button.png', top_left_corner, bottom_right_corner)
pyautogui.click()
break
else: # examines the money pouch
examine_money(bottom_right_corner)
# pass in an image and a search region
评论列表
文章目录