-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrank.py
53 lines (47 loc) · 1.9 KB
/
rank.py
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
46
47
48
49
50
51
52
53
from wikiscraper import scrape_wiki
from discord import Embed
import patchnotes
def rankingList(type):
singleTargetArray = ["Archer", "Swordman",
"Knight", "Longbower", "Crossbower", "Ballista"]
singleTargetDictionary = {}
table = patchnotes.TableToDict(
"https://pastebin.com/raw/xchHf3Gp")
for item in singleTargetArray:
if type == "dps":
singleTargetDictionary[item] = round(float(table[item]["Damage"] /
table[item]["Rate"]), 2)
if type == "health":
singleTargetDictionary[item] = table[item]["MaxHealth"]
if type == "speed":
singleTargetDictionary[item] = table[item]["Speed"]
sorted_dict = dict(
sorted(singleTargetDictionary.items(), key=lambda x: x[1]))
# single Target
embed = Embed()
embed.title = "Single Target"
for key in sorted_dict:
embed.add_field(
name=key, value=f"{type}: " + str(sorted_dict[key]), inline=False)
return embed
def splashRankingList(type):
splashArray = ["Wizard", "Catapult"]
splashTargetDictionary = {}
table = patchnotes.TableToDict(
"https://pastebin.com/raw/xchHf3Gp")
for item in splashArray:
if type == "dps":
splashTargetDictionary[item] = round(float(table[item]["Damage"] /
table[item]["Rate"]), 2)
if type == "health":
splashTargetDictionary[item] = table[item]["MaxHealth"]
if type == "speed":
splashTargetDictionary[item] = table[item]["Speed"]
sorted_dict = dict(
sorted(splashTargetDictionary.items(), key=lambda x: x[1]))
embed = Embed()
embed.title = "Splash Target"
for key in sorted_dict:
embed.add_field(
name=key, value=f"{type} " + str(sorted_dict[key]), inline=False)
return embed