@anonymous/

KindheartedBrownKeyboardmapping

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.09059740980731346","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHVybGxpYi5yZXF1ZXN0LCBqc29uCnByaWNlID0ge30Kd2l0aCB1cmxsaWIucmVxdWVzdC51cmxvcGVuKCJodHRwczovL3N0ZWFtY29tbXVuaXR5LmNvbS9tYXJrZXQvc2VhcmNoL3JlbmRlci8/c2VhcmNoX2Rlc2NyaXB0aW9ucz0wJmNhdGVnb3J5XzU4Mzk1MF9SYXJpdHklNUIlNUQ9dGFnX1Jhcml0eV9Db21tb24mc29ydF9kaXI9ZGVzYyZhcHBpZD01ODM5NTAmbm9yZW5kZXI9MSZjb3VudD01MDAiKSBhcyB1cmw6CiAgICBkYXRhID0ganNvbi5sb2Fkcyh1cmwucmVhZCgpLmRlY29kZSgpKQpmb3IgZW50cnkgaW4gZGF0YVsncmVzdWx0cyddOgogICAgcHJpY2VbZW50cnlbJ25hbWUnXV0gPSBlbnRyeVsnc2VsbF9wcmljZSddLzEwMAp3aXRoIHVybGxpYi5yZXF1ZXN0LnVybG9wZW4oImh0dHBzOi8vc3RlYW1jb21tdW5pdHkuY29tL21hcmtldC9zZWFyY2gvcmVuZGVyLz9zZWFyY2hfZGVzY3JpcHRpb25zPTAmY2F0ZWdvcnlfNTgzOTUwX1Jhcml0eSU1QiU1RD10YWdfUmFyaXR5X1VuY29tbW9uJnNvcnRfZGlyPWRlc2MmYXBwaWQ9NTgzOTUwJm5vcmVuZGVyPTEmY291bnQ9NTAwIikgYXMgdXJsOgogICAgZGF0YSA9IGpzb24ubG9hZHModXJsLnJlYWQoKS5kZWNvZGUoKSkKZm9yIGVudHJ5IGluIGRhdGFbJ3Jlc3VsdHMnXToKICAgIHByaWNlW2VudHJ5WyduYW1lJ11dID0gZW50cnlbJ3NlbGxfcHJpY2UnXS8xMDAKcmFy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aGFrZXIiLCAiRHJvdyBSYW5nZXIiLCAiTWVlcG8iLCAiQXhlIiwgIlRpbmtlciIsICJMaWNoIiwgIk9tbmlrbmlnaHQiLCAiUHVnbmEiXQpzdGFydGVyID0gWyJTdmVuIiwgIkx5Y2FuIiwgIlVyc2EiLCAiTmVjcm9waG9zIiwgIlNreXdyYXRoIE1hZ2UiLCAiT2dyZSBNYWdpIl0KdG90YWwgPSAwCmZvciBjb3N0IGluIHByaWNlOgogICAgaWYgY29zdCBpbiBoZXJvZXM6CiAgICAgICAgdG90YWwgKz0gcHJpY2VbY29zdF0KICAgIGVsc2U6CiAgICAgICAgdG90YWwgKz0gMyAqIHByaWNlW2Nvc3RdCiAgICBpZiBjb3N0IGluIHN0YXJ0ZXI6CiAgICAgICAgdG90YWwgLT0gcHJpY2VbY29zdF0KcHJpbnQodG90YWwpCg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import urllib.request, json
price = {}
with urllib.request.urlopen("https://steamcommunity.com/market/search/render/?search_descriptions=0&category_583950_Rarity%5B%5D=tag_Rarity_Common&sort_dir=desc&appid=583950&norender=1&count=500") as url:
    data = json.loads(url.read().decode())
for entry in data['results']:
    price[entry['name']] = entry['sell_price']/100
with urllib.request.urlopen("https://steamcommunity.com/market/search/render/?search_descriptions=0&category_583950_Rarity%5B%5D=tag_Rarity_Uncommon&sort_dir=desc&appid=583950&norender=1&count=500") as url:
    data = json.loads(url.read().decode())
for entry in data['results']:
    price[entry['name']] = entry['sell_price']/100
rare = {}
with urllib.request.urlopen("https://steamcommunity.com/market/search/render/?search_descriptions=0&category_583950_Rarity%5B%5D=tag_Rarity_Rare&sort_dir=desc&appid=583950&norender=1&count=500") as url:
    data = json.loads(url.read().decode())
for entry in data['results']:
    price[entry['name']] = entry['sell_price']/100
heroes = ["Zeus", "Enchantress", "Magnus", "Bounty Hunter", "Lion", "Bloodseeker", "Ogre Magi", "Necrophos", "Crystal Maiden", "Dark Seer", "Beastmaster", "Mazzie", "Bristleback", "Sven", "Lycan" , "Treant Protector", "Skywrath Mage", "Venomancer", "Phantom Assassin", "Ursa", "Viper", "Outworld Devourer", "Luna", "Timbersaw", "Tidehunter", "Rix", "Winter Wyvern", "Sniper", "Prellex", "Sorla Khan", "Legion Commander", "Storm Spirit", "Centaur Warrunner", "Chen", "Earthshaker", "Drow Ranger", "Meepo", "Axe", "Tinker", "Lich", "Omniknight", "Pugna"]
starter = ["Sven", "Lycan", "Ursa", "Necrophos", "Skywrath Mage", "Ogre Magi"]
total = 0
for cost in price:
    if cost in heroes:
        total += price[cost]
    else:
        total += 3 * price[cost]
    if cost in starter:
        total -= price[cost]
print(total)