Ejemplo n.º 1
0
 async def tasks_command(self, ctx, num_of_tasks, *username):
     """ Calculates estimated slayer tasks remaining """
     async with ctx.typing():
         safe_username = '******'.join(username)
         user = Tasks(safe_username, num_of_tasks)
         embed = discord.Embed(
             title="Slayer Task Calculator",
             description=
             f'**{user.slayer_level}** slayer ({user.slayer_xp:,} xp) | {safe_username}'
         )
         embed.set_thumbnail(url=get_icon_url("slayer"))
         embed.add_field(name="Average XP per task",
                         value=f'{user.avg_xp_per_task():,}',
                         inline=True)
         embed.add_field(
             name="Tasks needed to level up",
             value=
             f'{user.tasks_to_level_up() + 1:,.0f} ({user.xp_needed_to_level_up():,} xp)',
             inline=True)
         if user.slayer_level < 99:
             embed.add_field(name="Tasks to level 99",
                             value=f'{user.tasks_to_level_99()}',
                             inline=True)
             embed.add_field(name="Estimated total tasks",
                             value=f'{user.estimated_total_tasks()}',
                             inline=True)
         embed.set_footer(
             text="This calculator is more accurate at higher slayer levels"
         )
         await ctx.send(f'{ctx.message.author.mention}', embed=embed)
         return
Ejemplo n.º 2
0
 async def wines_command(self, ctx, *username):
     """ Calculates wines needed to level 99 """
     async with ctx.typing():
         safe_username = '******'.join(username)
         user = Wines(safe_username)
         embed = discord.Embed(
             title="Wine cooking calculator",
             description=
             f'**{user.cooking_level}** cooking ({user.cooking_xp:,} xp) | {safe_username}'
         )
         embed.set_thumbnail(url=get_icon_url("cooking"))
         if (user.cooking_level < 99):
             embed.add_field(name="Wines to reach level 99",
                             value=f'{user.wines_to_level_99():,}',
                             inline=True)
             embed.add_field(name="Inventories",
                             value=f'{user.invs_to_level_99():,}',
                             inline=True)
         else:
             embed.add_field(name="Wines to reach 200m xp",
                             value=f'{user.wines_to_200m():,}',
                             inline=True)
             embed.add_field(name="Inventories",
                             value=f'{user.invs_to_200m():,}',
                             inline=True)
         await ctx.send(f'{ctx.message.author.mention}', embed=embed)
         return
Ejemplo n.º 3
0
 async def rooftop_command(self, ctx, *username):
     """ Rooftop agility course calculator """
     async with ctx.typing():
         safe_username = '******'.join(username)
         user = Agility(safe_username)
         embed = discord.Embed(
             title="Rooftop agility calculator",
             description=
             f'**{user.agility_level}** Agility ({user.agility_xp:,} xp) | {safe_username}'
         )
         embed.set_thumbnail(url=get_icon_url("agility"))
         if (user.course == None):
             embed.add_field(
                 name="Level too low",
                 value=
                 "You need at least 10 agility to use the Draynor rooftop course",
                 inline=False)
         else:
             embed.add_field(name="XP needed to level up",
                             value=f'{user.xp_needed_to_level_up():,.0f}',
                             inline=True)
             embed.add_field(
                 name=f'Laps to level up',
                 value=f'{user.laps_to_level_up():,.0f} on {user.course}',
                 inline=True)
             embed.add_field(name=f'Laps until {user.next_course}',
                             value=f'{user.laps_to_next_course():,.0f}',
                             inline=True)
         await ctx.send(f'{ctx.message.author.mention}', embed=embed)
Ejemplo n.º 4
0
 async def zeah_command(self, ctx, *username):
     """ Blood and soul rune calculator """
     safe_username = '******'.join(username)
     user = Zeah(safe_username)
     bloods = GrandExchange("Blood rune")
     souls = GrandExchange("Soul rune")
     async with ctx.typing():
         await user.fetch()
     embed = discord.Embed(title="Zeah runecrafting calculator",
                           description=f'**{user.runecraft_level}** Runecraft ({user.runecraft_xp:,} xp)'
                                       f' | {safe_username}')
     embed.set_thumbnail(url=get_icon_url("runecraft"))
     footer = f'{next_level_string(user.runecraft_xp, "runecraft")}'
     if user.runecraft_level < 77:
         embed.add_field(name="Level too low",
                         value="You need a runecraft level of at least 77 to make blood runes", inline=True)
     elif user.runecraft_level < 90:
         await bloods.fetch()
         embed.add_field(name="Bloods to level up",
                         value=f'{user.bloods_to_level_up() + 1:,.0f}\n'
                               f'~{nice_price(user.bloods_to_level_up() * bloods.current_price)}\n'
                               f'({user.blood_trips_to_level_up() + 1:,.0f} trips)',
                         inline=True)
         embed.add_field(name="Bloods to level 99",
                         value=f'{user.bloods_to_level_99() + 1:,.0f}\n'
                               f'~{nice_price(user.bloods_to_level_99() * bloods.current_price)}\n'
                               f'({user.blood_trips_to_level_99() + 1:,.0f} trips)',
                         inline=True)
         footer += f'\nBlood rune price: {bloods.current_price} gp'
     else:
         await bloods.fetch()
         await souls.fetch()
         embed.add_field(name="Bloods to level up",
                         value=f'{user.bloods_to_level_up() + 1:,.0f}\n'
                               f'~{nice_price(user.bloods_to_level_up() * bloods.current_price)}\n'
                               f'({user.blood_trips_to_level_up() + 1:,.0f} trips)',
                         inline=True)
         embed.add_field(name="Souls to level up",
                         value=f'{user.souls_to_level_up() + 1:,.0f}\n'
                               f'~{nice_price(user.souls_to_level_up() * souls.current_price)}\n'
                               f'({user.soul_trips_to_level_up() + 1:,.0f} trips)',
                         inline=True)
         footer += f'\nBlood rune price: {bloods.current_price} gp\n' \
                   f'Soul rune price: {souls.current_price} gp'
         if user.runecraft_level < 99:
             embed.add_field(name="Bloods to level 99",
                             value=f'{user.bloods_to_level_99() + 1:,.0f}\n'
                                   f'~{nice_price(user.bloods_to_level_99() * bloods.current_price)}\n'
                                   f'({user.blood_trips_to_level_99() + 1:,.0f} trips)',
                             inline=True)
             embed.add_field(name="Souls to level 99",
                             value=f'{user.souls_to_level_99() + 1:,.0f}\n'
                                   f'~{nice_price(user.souls_to_level_99() * souls.current_price)}\n'
                                   f'({user.soul_trips_to_level_99() + 1:,.0f} trips)',
                             inline=True)
     embed.set_footer(text=footer)
     await ctx.send(f'{ctx.message.author.mention}', embed=embed)
     return
Ejemplo n.º 5
0
 async def zeah_command(self, ctx, *username):
     """ Blood and soul rune calculator """
     async with ctx.typing():
         safe_username = '******'.join(username)
         user = Zeah(safe_username)
         embed = discord.Embed(
             title="Zeah runecrafting calculator",
             description=
             f'**{user.runecraft_level}** Runecraft ({user.runecraft_xp:,} xp) | {safe_username}'
         )
         embed.set_thumbnail(url=get_icon_url("runecraft"))
         embed.set_footer(
             text=f'{next_level_string(user.runecraft_xp, "runecraft")}')
         if (user.runecraft_level < 77):
             embed.add_field(
                 name="Level too low",
                 value=
                 "You need a runecraft level of at least 77 to make blood runes",
                 inline=True)
         elif (user.runecraft_level < 90):
             embed.add_field(
                 name="Bloods to level up",
                 value=f'{user.bloods_to_level_up() + 1:,.0f}\n'
                 f'({user.blood_trips_to_level_up() + 1:,.0f} trips)',
                 inline=True)
             embed.add_field(
                 name="Bloods to level 99",
                 value=f'{user.bloods_to_level_99() + 1:,.0f}\n'
                 f'({user.blood_trips_to_level_99() + 1:,.0f} trips)',
                 inline=True)
         else:
             embed.add_field(
                 name="Bloods to level up",
                 value=f'{user.bloods_to_level_up() + 1:,.0f}\n'
                 f'({user.blood_trips_to_level_up() + 1:,.0f} trips)',
                 inline=True)
             embed.add_field(
                 name="Souls to level up",
                 value=f'{user.souls_to_level_up() + 1:,.0f}\n'
                 f'({user.soul_trips_to_level_up() + 1:,.0f} trips)',
                 inline=True)
             if (user.runecraft_level < 99):
                 embed.add_field(
                     name="Bloods to level 99",
                     value=f'{user.bloods_to_level_99() + 1:,.0f}\n'
                     f'({user.blood_trips_to_level_99() + 1:,.0f} trips)',
                     inline=True)
                 embed.add_field(
                     name="Souls to level 99",
                     value=f'{user.souls_to_level_99() + 1:,.0f}\n'
                     f'({user.soul_trips_to_level_99() + 1:,.0f} trips)',
                     inline=True)
         await ctx.send(f'{ctx.message.author.mention}', embed=embed)
         return