item_in_ge_screenshotter.py 文件源码

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

项目:RunescapeBots 作者: lukegarbutt 项目源码 文件源码
def main():
    box_1_coords = (43, 442, 159, 42)
    box_2_coords = (215, 442, 159, 42)
    box_3_coords = (387, 442, 159, 42)
    box_4_coords = (43, 498, 159, 42)
    box_5_coords = (215, 498, 159, 42)
    box_6_coords = (387, 498, 159, 42)
    time.sleep(3)
    list_of_items = ['Incandescent energy', 'Coal', 'Fire rune', 'Air rune', 'Feather', 'Broad arrowheads', 'Maple logs', 'Water rune', 'Earth rune', 'Nature rune',
    'Yew logs', 'Brilliant energy', 'Blood rune', 'Mind rune', 'Cannonball', 'Lustrous energy', 'Luminous energy', 'Dragon bones', 'Body rune', 'Mahogany plank',
    'Death rune', 'Royal bolts', 'Ascension bolts', 'Fishing bait', 'Rune arrow', 'Chaos rune', 'Bowstring', 'Ascension shard', 'Radiant energy',
    'Ganodermic flake', 'Adamantite ore', 'Gold ore', 'Flax', 'Vial of water', 'Vibrant energy', 'Araxyte arrow', 'Mahogany logs', 'Raw shark', 'Shark', 'Soul rune',
    'Rocktail', 'Adamant bar', 'Rune bar', 'Gold bar', 'Elder energy', 'Runite ore', 'Law rune', 'Raw lobster', 'Raw rocktail', 'Astral rune', 'Cosmic rune',
    'Black dragon leather', 'Onyx bolts (e)', 'Steel bar', 'Magic shieldbow', 'Iron ore', 'Black dragonhide', 'Grenwall spikes', 'Mithril bar', 'Willow logs', 'Mud rune',
    'Lobster', 'Swamp tar', 'Mithril ore', 'Adamant arrow', 'Snape grass', 'Soft clay', 'Magic notepaper', 'Steel arrow', 'Magic shieldbow (u)', 'Harralander tar',
    'Mithril arrow', 'Teak plank', 'Thread', 'Oak plank', 'Dark arrow', 'Grimy dwarf weed', 'Dragon arrowheads', 'Grimy lantadyme', 'Airut bones', 'Gleaming energy',
    'Infernal ashes', 'Frost dragon bones', 'Living minerals', 'Chitin scraps', 'Green dragon leather', 'Red chinchompa', 'Rune arrowheads', 'Clean lantadyme', 'Rune essence', 'Raw tuna',
    'Hydrix bolt tips', 'Yew seed', 'Palm tree seed', 'Teleport to house', 'Wine of Zamorak', 'Potion flask', 'Prayer potion (4)', 'Super restore (4)', 'Saradomin brew (4)',
    'Aggression potion (4)', 'Prayer renewal (4)']

    list_of_file_names = []
    for i in range(len(list_of_items)):
        list_of_file_names.append(list_of_items[i].replace(' ', '_')+'.png')
    for i in range(len(list_of_items)):
        file_name_1 = 'screenshots/items/nxt_items/'+list_of_file_names[i]
        file_name_2 = 'screenshots/temp_items/'+list_of_file_names[i]
        if os.path.isfile(file_name_1):
            print('file exists', file_name_1)
            continue
        x = len(list_of_items[i])
        pyautogui.typewrite(list_of_items[i], random.random()/10)
        time.sleep(4)
        pyautogui.screenshot(file_name_2, region=(box_2_coords))
        for x in range(x):
            pyautogui.press('backspace')
            time.sleep(random.random()/10)
        time.sleep(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号