API Lua Carte & Deplacement

44 entries — WGRetro bot reference for Dofus Retro

Full documentation
Position & Map
log("Position: " .. bot.x() .. "," .. bot.y() .. " cellule " .. bot.cellId())
if bot.onMap("4,-17") then
    log("On est a Astrub !")
end
Deplacement
-- Se deplacer vers une cellule
bot.move(256)

-- Changer de map vers la droite
bot.changeMap("right")

-- Teleportation zaap
bot.useZaap(7411)
Zaap / Zaapi avance
-- Sauvegarder zaap
bot.saveZaap()

-- Ouvrir zaap et voir destinations
bot.openZaap()
local dests = bot.getZaapDestinations()
for _, d in ipairs(dests) do
    log(d.name .. " (" .. d.cost .. " kamas)")
end
Zaap / Zaapi / Navigation
bot.zaap("1234")          -- teleport zaap
bot.navigateTo("5,-12")   -- coordonnees "x,y"
bot.navigateTo("7411")    -- mapId direct
bot.door(cellId)           -- entrer par porte
bot.useInteractiveAt(cellId, skillId)  -- interactive

Position & Map

Property / MethodTypeDescription
Propriete / MethodeTypeDescription
bot.mapId()stringID de la map
bot.cellId()numberCellule actuelle
bot.mapCoordstable{ x, y } ou nil
bot.x()numberCoordonnee X
bot.y()numberCoordonnee Y
bot.mapName()string"[x,y]"
bot.currentArea()stringZone actuelle
bot.currentSubArea()stringSous-zone actuelle
bot.dimensionstable{ width, height }
bot.width()numberLargeur de la map
bot.height()numberHauteur de la map
bot.onMap(coordsOrId)booleanVerifie si sur une map ("x,y" ou mapId)
bot.getWalkableCells()tableCellules walkable
bot.isWalkable(cellId)booleanCellule marchable ?
bot.getInteractives()table{{ cellId, skills }}

Deplacement

Property / MethodTypeDescription
bot.move(cellId)booleanDeplacement vers une cellule
bot.changeMap(direction)booleanChanger de map ('top', 'bottom', 'left', 'right')
bot.useZaap(destMapId)voidTeleportation Zaap
bot.zaap(destMapId)voidAlias de useZaap
bot.navigateTo(targetMapId)booleanNavigation monde
bot.useInteractive(cellId, skillId?)voidUtiliser un interactif
bot.useInteractiveAt(cellId, skillId?)voidAlias de useInteractive
bot.door(cellId)voidUtiliser une porte/portail
bot.sendEmote(emoteId)voidEnvoyer une emote
bot.sit()voidS'asseoir (emote 1)

Zaap / Zaapi avance

Property / MethodTypeDescription
bot.saveZaap()voidSauvegarder le zaap actuel comme point de respawn
bot.openZaap()booleanOuvrir la liste zaap (marche vers zaap + interaction)
bot.openZaapi()booleanOuvrir la liste zaapi
bot.getZaapDestinations()tableDestinations zaap {{ mapId, cost, name, x, y }}

Navigation avancee

Property / MethodTypeDescription
bot.getMapId(coordsOrId)string\nil | Resoudre "x,y" ou mapId en mapId
bot.getX(mapId)number\nil | Coordonnee X d'une map
bot.getY(mapId)number\nil | Coordonnee Y d'une map
bot.worldDistance(x, y)numberDistance Manhattan en coords monde
bot.worldDistanceToMap(mapId)numberDistance Manhattan vers une map
bot.moveTowardMap(mapId)booleanAvancer d'une map vers la cible
bot.hasChanged()booleanMap a change depuis le dernier appel (auto-reset)

Deplacement — Alias

Property / MethodTypeDescription
bot.moveToCell(cellId)booleanAlias de move
bot.moveTowardCell(cellId)booleanSe rapprocher d'une cellule
bot.currentCell()numberAlias de cellId
bot.currentMap()stringAlias de mapId
bot.currentMapId()stringAlias de mapId
bot.position()table{ x, y, cellId, mapId }
bot.distanceBetween(cell1, cell2)numberDistance entre deux cellules

These functions are used in the WGRetro bot Lua scripts — testable with the free plan (1 bot, no time limit). Ready-to-use scripts on the marketplace.