LootBotApi
This is an API wrapper for Loot Bot (https://telegra.ph/Guida-alle-LootBot-API-04-06)
Installation
Download from PyPi
pip install LootBotApifrom LootBotApi import LootBotApiapi = LootBotApi(TOKEN)--> the token can be found using the command /token on https://t.me/lootplusbot- 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 rarityget_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 LootBotget_player(player)It returns the info about the player
Crafting
get_crafts()It returns all the crafts in the gameget_craft_needed(item_id)It returns the items requested to craft the itemget_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 hourget_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})
"""
Metadata
Release files for LootBotApi 0.5.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| LootBotApi-0.5.9.3.tar.gz | 6.2 kB | Without provenance | Details for LootBotApi-0.5.9.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| LootBotApi-0.5.9.3-py3-none-any.whl | Python 3 | none | any | Details for LootBotApi-0.5.9.3-py3-none-any.whl |
Total release size: 12.6 kB
Release files / LootBotApi-0.5.9.3.tar.gz
| Download URL | LootBotApi-0.5.9.3.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e87506578d3c8b665e694891aca54cbac3f66960a6fbdd9d2030118d2254ea06
|
|
BLAKE2b-256 checksum How to use checksums |
70393ef4ab73ddf52456309ad07b62f720ba904dd9bdda5a141464711240e49b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / LootBotApi-0.5.9.3-py3-none-any.whl
| Download URL | LootBotApi-0.5.9.3-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7573f707cfc374d2c47dc49f672a5ebddb6985e05ba2a56b3548971d071c63c7
|
|
BLAKE2b-256 checksum How to use checksums |
529d9f5c4340bbe2acec16cb7c187572ebdec699e99bb905184e404b61430d90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for LootBotApi 0.5.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.