Skip to main content

API wrapper for Loot Bot

Project description

LootBotApi

This is an API wrapper for Loot Bot (https://telegra.ph/Guida-alle-LootBot-API-04-06)

Installation

Download from PyPi

  1. pip install LootBotApi
  2. from LootBotApi import LootBotApi
  3. api = LootBotApi(TOKEN) --> the token can be found using the command /token on https://t.me/lootplusbot
  4. Call the methods from the object created above

Methods

Api Wrapper

Most of this methods will return a list of Munch objects. This means that the attributes of the result can either be accessed as dictionary keys or object attributes

Items

  • get_items(rarity = None) It returns all the items in the game, if rarity is passed it returns all the items of that rarity
  • get_item(item) It returns the info about a given item
print(api.get_item("Meccanismo di Ferro").id) #363
print(api.get_item(363).name) #Meccanismo di Ferro

History

  • get_history(place = "payments",limit = None,offset = None,fromPlayer = None,toPlayer = None,fromItem = None,toItem = None,both = None,fromPrice = None,toPrice = None,orderBy = "desc") It returns the transactions with the specificied parameters

Players

  • get_players() It returns all the players of LootBot
  • get_player(player) It returns the info about the player

Crafting

  • get_crafts() It returns all the crafts in the game
  • get_craft_needed(item_id) It returns the items requested to craft the item
  • get_craft_used(item_id) It returns the item that you can craft using the item
items = api.get_craft_needed(363)
for item in items:
  print(item.name)

#Perno
#Meccanismo di Legno
#Ferro

Shops

  • get_shop(shop) It returns the infos about the shop

Cards

  • get_cards() It returns all the cards in the game

Global

  • get_global() It returns the progress of the current global challenge, it's updated every hour
  • get_info() It returns infos about the current global challenge

Team

  • get_team(team) it returns the infos about a team

Ricerche

  • get_searches(quantity) It returns the searches made on the bot

Custom Methods

These methods are not natively implemented in the API but they are derived by them.

Crafting

Meaning of inventory

The inventory paramater excepts a dict structured like this:

{
  item1: quantity,
  item2: quantity,
  .,
  .,
  .,
  itemN: quantity
}
  • get_total_craft_points(item) It returns the total craft points that you will get to craft the item
 print(api.get_total_craft_points("Ordigno Polverizzatore")) #113
  • get_crafting_steps(item,num_elements=1,inventory=dict()) It returns as a list of dicts all the steps to craft a certain element (and in a certain quantity). If the inventory is passed the items already owned will not be listed.
def print_steps(steps):
  for step in steps:
      for elemento in step:
          print(f"Crea {elemento},{step[elemento]}")

steps = api.get_crafting_steps("Scudo Punta Doppia",5)
print_steps(steps)
"""
Crea Scudo Punta Singola,3
Crea Scudo Punta Singola,2
Crea Scudo Punta Doppia,3
Crea Scudo Punta Doppia,2
"""

inventory = {"Scudo Punta Singola":2}
steps = api.get_crafting_steps("Scudo Punta Doppia",5,inventory=inventory)
print_steps(steps)
"""
Crea Scudo Punta Singola,3
Crea Scudo Punta Doppia,3
Crea Scudo Punta Doppia,2
"""
  • get_craft_total_needed_base_items(item,num_elements=1,inventory=dict()) It returns a dict containing the name of all the base items needed to craft a certain element (and in a certain quantity). If the inventory is passed the items already owned will not be listed.
print(api.get_craft_total_needed_base_items("Scudo Punta Tripla",2))
#{'Ambra Nera': 2, 'Materiale Affilante': 2, 'Manico': 2, 'Scaglia di Rubino': 2, 'Metallo': 2, 'Scheggia': 2, 'Nastro Adesivo': 2}
  • get_craft_needed_base(item_id) It returns a list of base elements needed to craft the item
print(api.get_craft_needed_base(api.get_exact_item("Scudo Punta Tripla").id))
#[Munch({'id': 80, 'name': 'Ambra Nera', 'rarity': 'UR', 'craftable': 0}), Munch({'id': 127, 'name': 'Materiale Affilante', 'rarity': 'UR', 'craftable': 0})]

Market

  • get_average_market_price(item) It returns the average price of an item in the market as an integer
 print(api.get_average_market_price("Ferro")) #37394

Items

  • get_exact_item(item) It returns the exact item searched
print(api.get_element("Carta"))
"""
[Munch({'id': 1, 'name': 'Carta', 'rarity': 'C', 'rarity_name': 'Comuni', 'value': 410, 'max_value': 205000, 'estimate': 2000, 'spread': 46, 'spread_tot': 0.116, 'craftable': 0, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 0, 'cons_val': 0}), Munch({'id': 8, 'name': 'Carta Stropicciata', 'rarity': 'NC', 'rarity_name': 'Non Comuni', 'value': 810, 'max_value': 405000, 'estimate': 1237, 'spread': 44, 'spread_tot': 0.084, 'craftable': 0, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 0, 'cons_val': 0}), Munch({'id': 35, 'name': 'Aereo di Carta Piccolo', 'rarity': 'NC', 'rarity_name': 'Non Comuni', 'value': 1121, 'max_value': 1121000, 'estimate': 11750, 'spread': 30, 'spread_tot': 0.001, 'craftable': 1, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 0, 'cons_val': 0.1}), Munch({'id': 36, 'name': 'Aereo di Carta Grande', 'rarity': 'R', 'rarity_name': 'Rari', 'value': 1697, 'max_value': 1697000, 'estimate': 13045, 'spread': 28, 'spread_tot': 0.001, 'craftable': 1, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 1, 'cons_val': 0.15}), Munch({'id': 37, 'name': 'Caccia di Carta', 'rarity': 'UR', 'rarity_name': 'Ultra Rari', 'value': 3468, 'max_value': 3468000, 'estimate': 4650, 'spread': 25, 'spread_tot': 0, 'craftable': 1, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 3, 'cons_val': 0.25})]
"""

print(api.get_exact_item("Carta"))
"""
Munch({'id': 1, 'name': 'Carta', 'rarity': 'C', 'rarity_name': 'Comuni', 'value': 410, 'max_value': 205000, 'estimate': 2000, 'spread': 46, 'spread_tot': 0.116, 'craftable': 0, 'reborn': 1, 'power': 0, 'power_armor': 0, 'power_shield': 0, 'dragon_power': 0, 'critical': 0, 'craft_pnt': 0, 'cons_val': 0})
"""

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LootBotApi-0.5.9.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

LootBotApi-0.5.9.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file LootBotApi-0.5.9.3.tar.gz.

File metadata

  • Download URL: LootBotApi-0.5.9.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for LootBotApi-0.5.9.3.tar.gz
Algorithm Hash digest
SHA256 e87506578d3c8b665e694891aca54cbac3f66960a6fbdd9d2030118d2254ea06
MD5 04e9c35a0f7c1126d0558c7b6cdd65e1
BLAKE2b-256 70393ef4ab73ddf52456309ad07b62f720ba904dd9bdda5a141464711240e49b

See more details on using hashes here.

File details

Details for the file LootBotApi-0.5.9.3-py3-none-any.whl.

File metadata

  • Download URL: LootBotApi-0.5.9.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for LootBotApi-0.5.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7573f707cfc374d2c47dc49f672a5ebddb6985e05ba2a56b3548971d071c63c7
MD5 9f808bebb3feab99cd9155267522ffb5
BLAKE2b-256 529d9f5c4340bbe2acec16cb7c187572ebdec699e99bb905184e404b61430d90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page