Aller au contenu

title: controller — Multi-comptes | MoonBot API description: API multi-comptes moonbotController : orchestration de plusieurs bots simultanés.


controller — Multi-comptes

API multi-comptes moonbotController : orchestration de plusieurs bots simultanés.

17 fonctions dans ce namespace.

Index


Référence

Recherche de comptes

moonbotController.getAccountControllerByAlias(alias) / getAccountControllerByUsername(username)

returns accountController | nil

Trouve un bot par alias ou username.


Listes

moonbotController.getAllAccountControllers() / getConnectedAccountControllers()

returns table

Tous les bots ou seulement les connectes.


Compteurs

moonbotController.accountCount() / connectedAccountCount()

returns number

Nombre total et connectes.


Commandes

moonbotController.sendCommand(accountId, command)

returns boolean

Commandes : "stop", "pause", "resume", "reconnect", "pass_turn", "toggle_mount".


Lancer un script

moonbotController.executeScript(accountId: string, scriptName: string)

returns boolean

Lance un script sur un autre bot.


Chat

moonbotController.sendChat(accountId, channel, message)

returns boolean

Envoie un message depuis un autre bot.


Paquet brut

moonbotController.sendRawPacket(accountId, packet)

returns boolean

Envoie un paquet brut depuis un autre bot.


Etat d'un bot

moonbotController.characterState(accountId: string)

returns {name: string, level: number, hp: number, hp_max: number, kamas: number, map_id: number, x: number, y: number, cell_id: number, server_name: string} | nil

Etat du personnage d'un autre bot. nil si non connecte.


Inventaire d'un bot

moonbotController.inventory(accountId: string)

returns table of {id: number, uid: number, quantity: number, name: string, position: number}

Inventaire d'un autre bot. Meme format que inventory.list().


Proxy

moonbotController.setProxy(accountId, ip, port, user, pass, type?) / removeProxy(accountId)

Configure ou retire le proxy d'un bot.


Alias

moonbotController.setAlias(accountId, alias)

Change l'alias d'un bot.


Creation perso

moonbotController.scheduleCreation(accountId, classId, sex, serverId?) / cancelCreation(accountId)

Planifier/annuler la creation de personnage sur un autre bot.


Mon ID

moonbotController.myAccountId()

returns string

ID du compte actuel.


Connecter un bot

moonbotController.connectBot(accountId: string, timeoutMs?: number)

returns boolean

Connecte un bot du gestionnaire (par son account ID). Attend qu'il soit en jeu (polling). Timeout par defaut 30s. Retourne true si connecte, false si timeout ou erreur. Utile pour connecter un bot banque depuis un script.


Deconnecter un bot

moonbotController.disconnectBot(accountId: string)

returns boolean

Deconnecte un bot. Si le bot est sur le meme worker, l'arret est immediat. Sinon la demande est envoyee au control-plane.


accountController

accountController.getAlias() / getUsername() / getAccountId() / getServer() / getLevel()

returns string / string / string / string / number

getAlias()→string. getUsername()→string (nom de compte). getAccountId()→string (UUID). getServer()→string (nom serveur). getLevel()→number. Obtenu via moonbotController ou global.thisAccountController().


accountController etat

accountController.isAccountConnected() / isScriptPlaying() / isTeamLeader() / isBoss() / isItATeam()

returns boolean

Etat du bot.