Writing a Lua script for Dofus Retro

Updated on 8/18/2026

Ready-to-use scripts cover classic use cases, but writing your own allows you to automate exactly what you want. The language used is Lua, featuring a dedicated API that exposes over 500 functions.

The minimum structure

A script often boils down to a path: a list of steps, each describing a map, an exit direction, and what to do there (gather, fight, deposit in the bank).

bot.setBankRoute({
    { map = "4,-17", npcBank = true, path = "top" },
    { map = "5,-17", path = "right" },
})

bot.route({
    { map = "5,-24", path = "right", gather = true, fight = true },
    { map = "6,-24", path = "right", gather = true },
    { map = "7,-24", path = "bottom", fight = true },
})

Controlling combat

Two callback functions can be attached to a step: one for placement, and another for each turn. This is where the quality of a combat artificial intelligence comes into play.

fightManagement = function()
    local enemy = bot.getNearestEnemy()
    if enemy then
        while bot.canCastSpellOnCell(161, enemy.cell) == "ok" do
            bot.castSpell(161, enemy.cell)
        end
    end
    bot.endTurn()
end

Making parameters customizable

A script sold or rented can expose a configuration block: the buyer only modifies the values enclosed by the designated markers, while the rest of the code remains encrypted and unreadable.

Publishing and monetizing

A script published on the marketplace can be rented by the hour, month, or year, with an optional free trial. The code is server-side encrypted: the buyer executes it without ever accessing it.

Frequently asked questions

Do I need to know how to program?

Basic knowledge is enough for a gathering path. An advanced combat AI requires more practice, but the documentation examples serve as a great starting point.

Where can I find the list of functions?

The API documentation is published on the website, with functions categorized by theme along with complete examples.

Try it for free

Free plan with 1 active bot, with no time limit.

See plans