@@ -30,13 +30,13 @@ async def select_callback(self, interaction: discord.Interaction, select: discor
30
30
return
31
31
32
32
df = pd .DataFrame (self .fish_prices )
33
- df_sorted = df .sort_values (by = "Profit " , ascending = False )
33
+ df_sorted = df .sort_values (by = "GP/hr " , ascending = False )
34
34
35
35
if format_choice == "markdown" :
36
- table_header = f"{ 'Fish' :<12} { 'Raw Price' :<12} { 'Cooked Price' :<12} { 'Profit' :<12} \n { '-' * 12 } { '-' * 12 } { '-' * 12 } { '-' * 12 } \n "
36
+ table_header = f"{ 'Fish' :<12} { 'Raw Price' :<12} { 'Cooked Price' :<12} { 'Profit' :<12} { 'XP/hr' :<12 } { 'GP/hr' :<12 } \n { '-' * 12 } { '-' * 12 } { '-' * 12 } { '-' * 12 } { '-' * 12 } { '-' * 12 } \n "
37
37
table_rows = ""
38
38
for index , row in df_sorted .iterrows ():
39
- table_rows += f"{ row ['Fish' ]:<12} { row ['Raw Price' ]:<12} { row ['Cooked Price' ]:<12} { int (row ['Profit' ]):<12} \n "
39
+ table_rows += f"{ row ['Fish' ]:<12} { row ['Raw Price' ]:<12} { row ['Cooked Price' ]:<12} { int (row ['Profit' ]):<12} { row [ 'XP/hr' ]:<12 } { row [ 'GP/hr' ]:<12 } \n "
40
40
table = f"```{ table_header } { table_rows } ```"
41
41
await self .interaction .followup .send (content = f"{ self .interaction .user .mention } Here are the results:\n { table } " )
42
42
@@ -50,6 +50,8 @@ async def select_callback(self, interaction: discord.Interaction, select: discor
50
50
f"**Raw Price:** { row ['Raw Price' ]} \n "
51
51
f"**Cooked Price:** { row ['Cooked Price' ]} \n "
52
52
f"**Profit:** { int (row ['Profit' ])} \n "
53
+ f"**XP/hr:** { row ['XP/hr' ]} \n "
54
+ f"**GP/hr:** { row ['XP/hr' ]} \n "
53
55
),
54
56
inline = False
55
57
)
@@ -63,21 +65,27 @@ def __init__(self, bot):
63
65
@app_commands .command (name = "fish_profit" , description = "Calculate the potential profit from cooking fish." )
64
66
async def fish_profit (self , interaction : discord .Interaction ):
65
67
prices = fetch_latest_prices ()
68
+ cooking_rate = 1435
66
69
67
70
profit_results = []
68
71
for fish_name , info in fish .items ():
69
72
raw_id_str = str (info ["raw_id" ])
70
73
cooked_id_str = str (info ["cooked_id" ])
74
+ fish_xp_each = info ["xp_each" ]
71
75
raw_price = prices [raw_id_str ]["high" ]
72
76
cooked_price = prices [cooked_id_str ]["high" ]
73
77
74
78
if raw_price and cooked_price :
75
79
profit_fish = cooked_price - raw_price
80
+ xphr = cooking_rate * fish_xp_each
81
+ gphr = cooking_rate * profit_fish
76
82
profit_results .append ({
77
83
"Fish" : fish_name ,
78
84
"Raw Price" : raw_price ,
79
85
"Cooked Price" : cooked_price ,
80
- "Profit" : profit_fish
86
+ "Profit" : profit_fish ,
87
+ "XP/hr" : xphr ,
88
+ "GP/hr" : gphr
81
89
})
82
90
83
91
view = FormatSelectView (bot = self .bot , interaction = interaction , fish_prices = profit_results )
0 commit comments