@@ -30,13 +30,13 @@ async def select_callback(self, interaction: discord.Interaction, select: discor
3030 return
3131
3232 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 )
3434
3535 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 "
3737 table_rows = ""
3838 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 "
4040 table = f"```{ table_header } { table_rows } ```"
4141 await self .interaction .followup .send (content = f"{ self .interaction .user .mention } Here are the results:\n { table } " )
4242
@@ -50,6 +50,8 @@ async def select_callback(self, interaction: discord.Interaction, select: discor
5050 f"**Raw Price:** { row ['Raw Price' ]} \n "
5151 f"**Cooked Price:** { row ['Cooked Price' ]} \n "
5252 f"**Profit:** { int (row ['Profit' ])} \n "
53+ f"**XP/hr:** { row ['XP/hr' ]} \n "
54+ f"**GP/hr:** { row ['XP/hr' ]} \n "
5355 ),
5456 inline = False
5557 )
@@ -63,21 +65,27 @@ def __init__(self, bot):
6365 @app_commands .command (name = "fish_profit" , description = "Calculate the potential profit from cooking fish." )
6466 async def fish_profit (self , interaction : discord .Interaction ):
6567 prices = fetch_latest_prices ()
68+ cooking_rate = 1435
6669
6770 profit_results = []
6871 for fish_name , info in fish .items ():
6972 raw_id_str = str (info ["raw_id" ])
7073 cooked_id_str = str (info ["cooked_id" ])
74+ fish_xp_each = info ["xp_each" ]
7175 raw_price = prices [raw_id_str ]["high" ]
7276 cooked_price = prices [cooked_id_str ]["high" ]
7377
7478 if raw_price and cooked_price :
7579 profit_fish = cooked_price - raw_price
80+ xphr = cooking_rate * fish_xp_each
81+ gphr = cooking_rate * profit_fish
7682 profit_results .append ({
7783 "Fish" : fish_name ,
7884 "Raw Price" : raw_price ,
7985 "Cooked Price" : cooked_price ,
80- "Profit" : profit_fish
86+ "Profit" : profit_fish ,
87+ "XP/hr" : xphr ,
88+ "GP/hr" : gphr
8189 })
8290
8391 view = FormatSelectView (bot = self .bot , interaction = interaction , fish_prices = profit_results )
0 commit comments