@rmasurel/

RoundedHospitableCode

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.04683935255454652","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHVybGxpYi5yZXF1ZXN0LCBqc29uCnByaWNlX2MgPSB7fQpwcmljZV91ID0ge30KcHJpY2VfciA9IHt9Ck5fY2hlY2s9MAp3aXRoIHVybGxpYi5yZXF1ZXN0LnVybG9wZW4oImh0dHBzOi8vc3RlYW1jb21tdW5pdHkuY29tL21hcmtldC9zZWFyY2gvcmVuZGVyLz9zZWFyY2hfZGVzY3JpcHRpb25zPTAmY2F0ZWdvcnlfNTgzOTUwX1Jhcml0eSU1QiU1RD10YWdfUmFyaXR5X0NvbW1vbiZzb3J0X2Rpcj1kZXNjJmFwcGlkPTU4Mzk1MCZub3JlbmRlcj0xJmNvdW50PTUwMCIpIGFzIHVybDoKICAgIGRhdGFfYyA9IGpzb24ubG9hZHModXJsLnJlYWQoKS5kZWNvZGUoKSkKZm9yIGVudHJ5IGluIGRhdGFfY1sncmVzdWx0cyddOgogICAgcHJpY2VfY1tlbnRyeVsnbmFtZSddXSA9IGVudHJ5WydzZWxsX3ByaWNlJ10vMTAwCndpdGggdXJsbGliLnJlcXVlc3QudXJsb3BlbigiaHR0cHM6Ly9zdGVhbWNvbW11bml0eS5jb20vbWFya2V0L3NlYXJjaC9yZW5kZXIvP3NlYXJjaF9kZXNjcmlwdGlvbnM9MCZjYXRlZ29yeV81ODM5NTBfUmFyaXR5JTVCJTVEPXRhZ19SYXJpdHlfVW5jb21tb24mc29ydF9kaXI9ZGVzYyZhcHBpZD01ODM5NTAmbm9yZW5kZXI9MSZjb3VudD01MDAiKSBhcyB1cmw6CiAgICBkYXRhX3UgPSBqc29uLmxvYWRzKHVybC5yZWFkKCkuZGVjb2RlKCkpCmZvciBlbnRyeSBpbiBkYXRhX3VbJ3Jlc3VsdHMnXToKICAgIHByaWNlX3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gQ29tbWFuZGVyIl0Kc3RhcnRlciA9IFsiU3ZlbiIsICJMeWNhbiIsICJVcnNhIiwgIk5lY3JvcGhvcyIsICJTa3l3cmF0aCBNYWdlIiwgIk9ncmUgTWFnaSJdCmF2Z191ID0gMAphdmdfYz0wCmF2Z19yPTAKTl9jPTc4Ck5fdT04MgpOX3I9NzcKcHJpbnQoTl9jaGVjaykKZm9yIGNvc3QgaW4gcHJpY2VfYzoKICBhdmdfYyArPSBwcmljZV9jW2Nvc3RdL05fYwpwcmludChhdmdfYykKCmZvciBjb3N0IGluIHByaWNlX3U6CiAgYXZnX3UgKz0gcHJpY2VfdVtjb3N0XS9OX3UKcHJpbnQoYXZnX3UpCgpmb3IgY29zdCBpbiBwcmljZV9yOgogIGF2Z19yICs9IHByaWNlX3JbY29zdF0vTl9yCnByaW50KGF2Z19yKQoKdmFsdWU9OCphdmdfYyszKmF2Z191K2F2Z19yCnByaW50KHZhbHVlKQoK"},"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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import urllib.request, json
price_c = {}
price_u = {}
price_r = {}
N_check=0
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_c = json.loads(url.read().decode())
for entry in data_c['results']:
    price_c[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_u = json.loads(url.read().decode())
for entry in data_u['results']:
    price_u[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_Rare&sort_dir=desc&appid=583950&norender=1&count=500") as url:
    data_r = json.loads(url.read().decode())

for entry in data_r['results']:
    N_check=N_check+1
    price_r[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"]
starter = ["Sven", "Lycan", "Ursa", "Necrophos", "Skywrath Mage", "Ogre Magi"]
avg_u = 0
avg_c=0
avg_r=0
N_c=78
N_u=82
N_r=77
print(N_check)
for cost in price_c:
  avg_c += price_c[cost]/N_c
print(avg_c)

for cost in price_u:
  avg_u += price_u[cost]/N_u
print(avg_u)

for cost in price_r:
  avg_r += price_r[cost]/N_r
print(avg_r)

value=8*avg_c+3*avg_u+avg_r
print(value)