API Lua Inventaire & Banque

108 entradas — Referencia del bot WGRetro para Dofus Retro

Documentación completa
Inventaire
local ble = bot.findByName("Ble")
if ble then
    log("Ble: " .. ble.quantity .. " en inventaire")
end
Banque
-- Deposer tout en banque
bot.openBank(42)
bot.depositAll()
bot.closeBank()
HDV Avance (Hotel de Vente)
bot.openSell(cellId)  -- ouvrir HDV vente via NPC
local price = bot.listItem(289)  -- prix actuel du template
local prices = bot.itemPrices(289)  -- {x1, x10, x100}
local lowest = bot.getLowestPrice(289, 1)  -- prix min lot de 1
bot.updatePrice(uid, 1, 289, 500)  -- uid, lotSize, templateId, newPrice
bot.removeListing(uid)  -- retirer annonce
bot.buyItem(289, 10, 100)  -- templateId, qty, price
bot.closeHdv()
local listings = bot.myListings()  -- mes annonces
Monture Inventaire
if bot.hasMount() then
    bot.toggleRide()  -- monter/descendre
    bot.setXpShare(30)  -- 30% XP monture
    bot.openMountInventory()
    bot.mountPutItem(289, 10)  -- vers monture
    bot.mountGetItem(289, 5)   -- depuis monture
    local items = bot.mountInventoryItems()
    bot.closeMountInventory()
end
Craft
bot.useInteractive(cellId, skillId)  -- ouvrir atelier
sleep(1)
bot.putItem(289, 2)  -- ingredients
bot.exchangeReady()  -- valider craft
sleep(2)
bot.exchangeLeave()
Boutique PNJ / Marchand
bot.openNpcShop(42)
bot.npcShopBuy(289, 10)  -- acheter 10 x template 289
bot.merchantLeave()
Craft avance
bot.openCraftStation(cellId, skillId)
bot.craftPutItem(289, 2)  -- ingredients
bot.craftSetQuantity(5)   -- crafter 5 fois
bot.craftCombine()        -- lancer
bot.craftWaitForResult()
bot.craftLeave()

Inventaire

Propiedad / MétodoTipoDescripción
bot.getInventory()tableTous les items
bot.getItem(nameOrId)table\nil | Chercher par nom ou ID
bot.countItem(templateId)numberQuantite d'un item par template ID
bot.findByTemplate(templateId)table\nil | Premier item par template ID
bot.findByUid(uid)table\nil | Item par UID
bot.findByName(name)table\nil | Premier item par nom exact
bot.findAllByName(name)tableItems dont le nom contient la chaine
bot.isEquipped(uid)booleanItem equipe ?
bot.totalQuantity()numberQuantite totale de tous les items
bot.itemCount()numberNombre d'items uniques
bot.getEquipment()tableItems equipes (pos 0-8)
bot.useItem(uid)voidUtiliser un item
bot.equipItem(uid)voidEquiper
bot.unequipItem(uid)voidDesequiper
bot.dropItem(uid, qty?)voidJeter
bot.deleteItem(uid, qty?)voidDetruire

Banque

Propiedad / MétodoTipoDescripción
bot.openBank(npcCellId)voidOuvrir la banque via PNJ
bot.depositAll()voidDeposer tous les items
bot.depositItem(uid, qty)voidDeposer un item
bot.withdrawItem(uid, qty)voidRetirer un item
bot.closeBank()voidFermer la banque
bot.depositKamas(amount?)voidDeposer des kamas (0=tout)
bot.withdrawKamas(amount)voidRetirer des kamas
bot.bankItemCount()numberNombre d'items uniques en banque
bot.getBankItems()tableContenu de la banque
bot.bankItemQuantity(templateId)numberQuantite d'un item en banque

Hotel de Vente (HDV)

Propiedad / MétodoTipoDescripción
bot.openHdv(npcCellId?)voidOuvrir l'HDV
bot.searchHdv(typeId)voidRechercher par categorie
bot.getPrice(templateId)voidDemander le prix moyen
bot.sellItem(uid, qty, price)voidMettre en vente
bot.buyItem(templateId, qty, price)voidAcheter
bot.closeHdv()voidFermer l'HDV

Configuration Banque

Propiedad / MétodoTipoDescripción
bot.setBankThreshold(percent)voidSeuil pods pour aller en banque (0.0-1.0)
bot.getBankThreshold()numberSeuil actuel
bot.addBankKeepItem(templateId, qty?)voidItem a ne PAS deposer
bot.clearBankKeepItems()voidVider la liste keep
bot.addBankWithdrawItem(templateId, qty?)voidItem a retirer automatiquement
bot.clearBankWithdrawItems()voidVider la liste withdraw
bot.addAutoDeleteItem(templateId, qty?)voidItem a supprimer automatiquement
bot.clearAutoDeleteItems()voidVider la liste delete
bot.depositKamas(amount?)voidDeposer kamas (0=tout)
bot.withdrawKamas(amount)voidRetirer kamas
bot.putAllItemsExcept(exceptIds)voidDeposer tout sauf les items specifies

Craft

Propiedad / MétodoTipoDescripción
bot.openCraftStation(cellId, skillId?)booleanOuvrir un atelier
bot.craftPutItem(templateId, qty?)booleanAjouter un ingredient
bot.craftRemoveItem(templateId, qty?)booleanRetirer un ingredient
bot.craftWaitForResult(timeout?)table\nil | Attendre resultat { success }
bot.craftOpen()booleanAtelier ouvert ?

Monture Inventaire

Propiedad / MétodoTipoDescripción
bot.openMountInventory()booleanOuvrir l'inventaire monture
bot.closeMountInventory()voidFermer
bot.mountPutItem(templateId, qty?)booleanDeposer item dans monture
bot.mountGetItem(templateId, qty?)booleanRetirer item de monture
bot.mountInventoryItems()tableContenu inventaire monture
bot.setMountXp(percent)void% XP monture (0-90)
bot.getMountId()numberID unique monture

HDV Avance (Hotel de Vente)

Propiedad / MétodoTipoDescripción
bot.openSell(npcCellId?)voidOuvrir HDV mode vente
bot.openBuy(npcCellId?)voidOuvrir HDV mode achat
bot.listItem(templateId)numberPrix moyen du marche
bot.itemPrices(templateId)tablePrix par lot { x1, x10, x100 }
bot.getLowestPrice(templateId, lotSize?)numberPrix minimum pour un lot
bot.updatePrice(uid, lotSize, templateId, newPrice)booleanModifier prix d'annonce
bot.removeListing(uid)voidRetirer une annonce
bot.myListings()tableMes annonces {{ uid, templateId, qty, price }}
bot.undercutAll(lotSize?, maxDropPercent?)tableSous-coter toutes les annonces
bot.getTax()numberTaxe HDV actuelle (%)
bot.getLotSizes()tableTailles de lots disponibles
bot.autoSell()booleanVente automatique de tous les items

Boutique PNJ / Marchand

Propiedad / MétodoTipoDescripción
bot.openNpcShop(npcId)voidOuvrir la boutique d'un PNJ
bot.npcShopBuy(templateId, qty)voidAcheter un item au PNJ
bot.npcShopSell(uid, qty)voidVendre un item au PNJ
bot.merchantLeave()voidFermer la boutique
bot.openPlayerShop(actorId)voidOuvrir la boutique d'un joueur marchand
bot.shopBuyItem(uid, qty)voidAcheter dans la boutique joueur
bot.requestMerchantMode()voidActiver le mode marchand
bot.confirmMerchantMode()voidConfirmer le mode marchand

Banque — Gestion kamas automatique

Propiedad / MétodoTipoDescripción
bot.setBankKamas(amount)voidKamas a garder en inventaire (seuil)
bot.getBankKamas()numberSeuil kamas actuel
bot.setBankWithdrawKamas(amount)voidKamas a retirer auto de la banque
bot.getBankWithdrawKamas()numberMontant retrait auto

Craft avance

Propiedad / MétodoTipoDescripción
bot.craftSetQuantity(qty)voidDefinir la quantite a crafter
bot.craftCombine()voidLancer le craft
bot.craftLeave()voidFermer l'atelier

Inventaire — Alias et utilitaires

Propiedad / MétodoTipoDescripción
bot.inventoryItems()tableAlias getInventory
bot.getAllItems()tableTous les items (inventaire + equipes)
bot.itemQuantity(templateId)numberQuantite par template ID
bot.openInventory()voidOuvrir l'inventaire
bot.closeInventory()voidFermer l'inventaire

Banque — Alias et utilitaires

Propiedad / MétodoTipoDescripción
bot.isBankOpen()booleanBanque ouverte ?
bot.bankItems()tableAlias getBankItems
bot.bankKamas()numberKamas en banque
bot.storageItems()tableItems en banque
bot.storageKamas()numberKamas en banque
bot.storageItemCount()numberNombre d'items en banque
bot.storageItemQuantity(templateId)numberQuantite item en banque
bot.deposit(uid, qty)voidDeposer item
bot.depositAllExcept(ids)voidDeposer tout sauf certains items
bot.withdraw(uid, qty)voidRetirer item
bot.withdrawAll()voidRetirer tout
bot.putAllItems()voidDeposer tous les items
bot.enableAutoBank()voidActiver banque auto
bot.disableAutoBank()voidDesactiver banque auto
bot.isAutoBankEnabled()booleanBanque auto active ?

Boutique PNJ — Details

Propiedad / MétodoTipoDescripción
bot.npcShopItems()tableItems disponibles en boutique
bot.canSellItem(uid)booleanItem vendable au PNJ ?
bot.sellableItems()tableItems vendables

HDV — Alias

Propiedad / MétodoTipoDescripción
bot.myListingCount()numberNombre de mes annonces
bot.refreshMyListings()tableRafraichir mes annonces
bot.openShop(actorId)voidAlias openPlayerShop

Estas funciones se usan en los scripts Lua del bot WGRetro — probables con el plan gratis (1 bot, sin límite de tiempo). Scripts listos para usar en el marketplace.