API Lua Personnage

60 entrées — Référence du bot WGRetro pour Dofus Retro

Documentation complète
Personnage — Identite
-- Exemple
log("Personnage: " .. bot.name() .. " niveau " .. bot.level())
log("Classe: " .. bot.breedName())
Personnage — Points de vie / Energie
log("PV: " .. bot.hp() .. "/" .. bot.hpMax() .. " (" .. bot.hpPercent() .. "%)")
Personnage — Kamas / Pods
if bot.isPodsFull(0.8) then
    log("Pods presque pleins !")
end
Stats & Sorts — Upgrade
-- Monter la force a 300 base
bot.statUpgrade("strength", 300)

-- Monter le sort 161 au niveau 5
bot.spellUpgrade(161, 5)

Personnage — Identite

Propriété / MéthodeTypeDescription
bot.name()stringNom du personnage
bot.level()numberNiveau
bot.classId()numberID de classe (1=Feca..12=Pandawa)
bot.breed()numberAlias de classId
bot.breedName()stringNom de la classe ('Iop', 'Cra'...)
bot.sex()booleanfalse=male, true=female
bot.characterId()stringID du personnage
bot.nickname()stringSurnom
bot.server()stringServeur
bot.serverId()stringID du serveur

Personnage — Points de vie / Energie

Propriété / MéthodeTypeDescription
bot.hp()numberPV actuels
bot.hpMax()numberPV max
bot.hpPercent()numberPV en pourcentage (0-100)
bot.energy()numberEnergie actuelle
bot.energyMax()numberEnergie max

Personnage — XP

Propriété / MéthodeTypeDescription
bot.xp()numberXP actuelle
bot.xpPercent()numberXP en pourcentage du niveau (0-100)

Personnage — Stats de combat

Propriété / MéthodeTypeDescription
bot.pa()numberPoints d'action
bot.pm()numberPoints de mouvement
bot.initiative()numberInitiative
bot.prospecting()numberProspection
bot.range()numberPortee

Personnage — Statistiques

Propriété / MéthodeTypeDescription
bot.vitality()numberVitalite (total)
bot.wisdom()numberSagesse (total)
bot.strength()numberForce (total)
bot.intelligence()numberIntelligence (total)
bot.chance()numberChance (total)
bot.agility()numberAgilite (total)
bot.vitalityBase()numberVitalite (base sans equip)
bot.wisdomBase()numberSagesse (base)
bot.strengthBase()numberForce (base)
bot.intelligenceBase()numberIntelligence (base)
bot.chanceBase()numberChance (base)
bot.agilityBase()numberAgilite (base)
bot.statsPoints()numberPoints de stats disponibles
bot.spellPoints()numberPoints de sorts disponibles

Personnage — Kamas / Pods

Propriété / MéthodeTypeDescription
bot.kamas()numberKamas
bot.pods()numberPods actuels
bot.podsMax()numberPods max
bot.podRatio()numberRatio pods (0.0-1.0)
bot.podsPercent()numberPods en pourcentage (0-100)
bot.isPodsFull(threshold?)booleanPods > seuil (default 0.9)

Personnage — Etat

Propriété / MéthodeTypeDescription
bot.inFight()booleanEn combat
bot.isMyTurn()booleanMon tour (combat)

Stats & Sorts — Upgrade

Propriété / MéthodeTypeDescription
bot.boostStat(statId)voidBoost stat +1 (10=force, 11=vita, 12=sagesse, 13=chance, 14=agi, 15=intel)
bot.statUpgrade(name, targetBase)booleanMonte une stat de base jusqu'a la cible ('strength', 'vitality'...)
bot.boostSpell(spellId)voidBoost sort +1 niveau
bot.spellLevel(spellId)numberNiveau actuel d'un sort (0 si pas appris)
bot.spellUpgrade(spellId, targetLevel)booleanMonte un sort au niveau cible
bot.getStats()tableTable stats complet
bot.getSpells()table{{ id, name, level }}

Personnage — Alias

Propriété / MéthodeTypeDescription
bot.id()stringAlias characterId
bot.username()stringNom du compte
bot.myBreed()numberAlias classId
bot.alignment()tableInfo alignement
bot.alliance()tableInfo alliance
bot.getKamas()numberAlias kamas
bot.podsP()numberAlias podsPercent
bot.subscriptionEnd()stringDate fin abonnement
bot.subscriptionDaysLeft()numberJours restants abo

Ces fonctions s'utilisent dans les scripts Lua du bot WGRetro — testables avec le plan gratuit (1 bot, sans limite de durée). Scripts prêts à l'emploi sur la marketplace.