### POST Request via HTTPS Proxy Example (Lua) Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/postrequestthroughhttpsproxy This Lua example showcases the usage of the postRequestThroughHTTPSProxy function. It illustrates making a POST request with and without custom headers, demonstrating the flexibility of the function for various scenarios. ```lua developer:postRequestThroughHTTPSProxy("https://httpbin.org/ip", "param1=value1¶m2=value2¶m3=value3", "185.211.211.211", 2000, "user", "pass", {"User-agent"}, {"AnkaBot"}) -- Sans les headers developer:postRequestThroughHTTPSProxy("https://httpbin.org/ip", "param1=value1¶m2=value2¶m3=value3", "185.211.211.211", 2000, "user", "pass") ``` -------------------------------- ### POST Request Example with SOCKS5 Proxy in Lua Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/postrequestthroughsocks5proxy This Lua example demonstrates how to use the developer:postRequestThroughSocks5Proxy function to send a POST request through a SOCKS5 proxy. It shows two scenarios: one with custom headers and another without, highlighting the optional nature of headers. ```lua developer:postRequestThroughSocks5Proxy("https://httpbin.org/ip", "param1=value1¶m2=value2¶m3=value3", "185.211.211.211", 2000, "user", "pass", {"User-agent"}, {"AnkaBot"}) -- Sans les headers developer:postRequestThroughSocks5Proxy("https://httpbin.org/ip", "param1=value1¶m2=value2¶m3=value3", "185.211.211.211", 2000, "user", "pass") ``` -------------------------------- ### Example: Request via SOCKS5 Proxy (Lua) Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/getrequestthroughsocks5proxy This Lua example demonstrates how to use the `getRequestThroughSocks5Proxy` method to fetch IP information through a SOCKS5 proxy. It shows two scenarios: one with custom headers and another without. ```lua developer:getRequestThroughSocks5Proxy("https://httpbin.org/ip", "185.211.211.211", 2000, "user", "pass", {"User-agent"}, {"AnkaBot"}) -- Sans les headers developer:getRequestThroughSocks5Proxy("https://httpbin.org/ip", "185.211.211.211", 2000, "user", "pass") ``` -------------------------------- ### Example Usage of stabledMounts in Lua Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/stabledmounts This Lua example demonstrates how to use the stabledMounts method to retrieve and display detailed information about each stabled mount. It iterates through the returned list and prints various properties of each mount, including effects and ancestral information. Accessing an enclosure is a prerequisite for using this method. ```lua function move() global:printMessage("-----------------------------------------------") global:printMessage("Montures dans l'étable") global:printMessage("-----------------------------------------------") local stabledMounts = mount:stabledMounts() for _, stabledMount in ipairs(stabledMounts) do global:printSuccess("id: "..stabledMount.id) global:printSuccess("model: "..stabledMount.model) global:printSuccess("name: "..stabledMount.name) global:printSuccess("sex: "..tostring(stabledMount.sex)) global:printSuccess("ownerId: "..stabledMount.ownerId) global:printSuccess("experience: "..stabledMount.experience) global:printSuccess("experienceForLevel: "..stabledMount.experienceForLevel) global:printSuccess("experienceForNextLevel: "..stabledMount.experienceForNextLevel) global:printSuccess("level: "..stabledMount.level) global:printSuccess("isRideable: "..tostring(stabledMount.isRideable)) global:printSuccess("maxPods: "..stabledMount.maxPods) global:printSuccess("isWild: "..tostring(stabledMount.isWild)) global:printSuccess("stamina: "..stabledMount.stamina) global:printSuccess("staminaMax: "..stabledMount.staminaMax) global:printSuccess("maturity "..stabledMount.maturity) global:printSuccess("maturityForAdult: "..stabledMount.maturityForAdult) global:printSuccess("energy: "..stabledMount.energy) global:printSuccess("energyMax: "..stabledMount.energyMax) global:printSuccess("serenity: "..stabledMount.serenity) global:printSuccess("serenityMax: "..stabledMount.serenityMax) global:printSuccess("aggressivityMax: "..stabledMount.aggressivityMax) global:printSuccess("love: "..stabledMount.love) global:printSuccess("loveMax: "..stabledMount.loveMax) global:printSuccess("fecondationTime: "..stabledMount.fecondationTime) global:printSuccess("isFecondationReady: "..tostring(stabledMount.isFecondationReady)) global:printSuccess("boostLimiter: "..stabledMount.boostLimiter) global:printSuccess("boostMax: "..stabledMount.boostMax) global:printSuccess("reproductionCount: "..stabledMount.reproductionCount) global:printSuccess("reproductionCountMax: "..stabledMount.reproductionCountMax) global:printSuccess("harnessGID: "..stabledMount.harnessGID) global:printSuccess("useHarnessColors: "..tostring(stabledMount.useHarnessColors)) global:printSuccess("Effects :") for _,effect in ipairs(stabledMount.effectList) do global:printSuccess(" ActionID: "..effect.actionId.." - Value: "..effect.value) end global:printSuccess("ancestors :") for _,ancestor in ipairs(stabledMount.ancestor) do global:printSuccess(" "..ancestor) end global:printSuccess("behaviors :") for _,behavior in ipairs(stabledMount.behaviors) do global:printSuccess(" "..behavior) end global:printMessage("-----------------------------------------------") end global:printMessage("-----------------------------------------------") end ``` -------------------------------- ### Example Usage of getRequestThroughHTTPSProxy in Lua Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/getrequestthroughhttpsproxy This Lua example demonstrates how to call the getRequestThroughHTTPSProxy method. It shows two scenarios: one with custom headers (User-agent) and another without, illustrating the optional nature of headers. ```lua developer:getRequestThroughHTTPSProxy("https://httpbin.org/ip", "185.211.211.211", 2000, "user", "pass", {"User-agent"}, {"AnkaBot"}) -- Sans les headers developer:getRequestThroughHTTPSProxy("https://httpbin.org/ip", "185.211.211.211", 2000, "user", "pass") ``` -------------------------------- ### Example Usage of developer:fromObject (Lua) Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/fromobject An example demonstrating the practical application of the developer:fromObject method within a Lua function. It shows how to construct a Lua table, convert it to a JSON string using developer:fromObject, and then send this JSON string using developer:sendMessage. This highlights the method's role in preparing data for communication. ```lua function move() -- Le message envoyé est : {"call":"sendMessage","data":{"type":"ChatClientMultiMessage","data":{"channel":0,"content":"hahaha"}}} local obj = {} obj["call"] = "sendMessage" obj["data"] = { ["type"] = "ChatClientMultiMessage", ["data"] = { ["channel"] = 0, ["content"] = "hahaha" } } local msg = developer:fromObject(tmp) developer:sendMessage(msg) end ``` -------------------------------- ### global:loadConfiguration Source: https://doc.ankabot.dev/ankabot-touch/methodes/global/loadconfiguration Loads a bot configuration from an XML file and optionally starts the associated script. ```APIDOC ## global:loadConfiguration ### Description Loads a bot configuration from an XML file. This configuration can include details about fights, characteristics, spells, bank mode, and more. The function can also optionally start the script associated with the loaded configuration. ### Method ```coffeescript global:loadConfiguration(path, start) ``` ### Parameters #### Path Parameters - **path** (string) - Required - Absolute path to the configuration file in XML format. - **start** (boolean) - Optional - If true, launches the script associated with the configuration. ### Request Example ```coffeescript path = "C:/User/Desktop/sacrieur.xml" global:loadConfiguration(path) ``` ### Response #### Success Response Returns no specific value upon successful execution, but the configuration is loaded and applied. #### Response Example (No explicit response body for this function, success is indicated by the configuration being loaded and applied.) ``` -------------------------------- ### Access and Display Mount Properties (Lua) Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/mymount This Lua example demonstrates how to call the `myMount` function and then iterate through the properties of the returned `MountClientData` object. It includes checks for a nil return value (no mount equipped) and prints detailed information about the mount, including its stats, effects, ancestors, and behaviors. ```lua function move() local myMount = mount:myMount() if myMount == nil then return end global:printSuccess("id: "..myMount.id) global:printSuccess("model: "..myMount.model) global:printSuccess("name: "..myMount.name) global:printSuccess("sex: "..tostring(myMount.sex)) global:printSuccess("ownerId: "..myMount.ownerId) global:printSuccess("experience: "..myMount.experience) global:printSuccess("experienceForLevel: "..myMount.experienceForLevel) global:printSuccess("experienceForNextLevel: "..myMount.experienceForNextLevel) global:printSuccess("level: "..myMount.level) global:printSuccess("isRideable: "..tostring(myMount.isRideable)) global:printSuccess("maxPods: "..myMount.maxPods) global:printSuccess("isWild: "..tostring(myMount.isWild)) global:printSuccess("stamina: "..myMount.stamina) global:printSuccess("staminaMax: "..myMount.staminaMax) global:printSuccess("maturity "..myMount.maturity) global:printSuccess("maturityForAdult: "..myMount.maturityForAdult) global:printSuccess("energy: "..myMount.energy) global:printSuccess("energyMax: "..myMount.energyMax) global:printSuccess("serenity: "..myMount.serenity) global:printSuccess("serenityMax: "..myMount.serenityMax) global:printSuccess("aggressivityMax: "..myMount.aggressivityMax) global:printSuccess("love: "..myMount.love) global:printSuccess("loveMax: "..myMount.loveMax) global:printSuccess("fecondationTime: "..myMount.fecondationTime) global:printSuccess("isFecondationReady: "..tostring(myMount.isFecondationReady)) global:printSuccess("boostLimiter: "..myMount.boostLimiter) global:printSuccess("boostMax: "..myMount.boostMax) global:printSuccess("reproductionCount: "..myMount.reproductionCount) global:printSuccess("reproductionCountMax: "..myMount.reproductionCountMax) global:printSuccess("harnessGID: "..myMount.harnessGID) global:printSuccess("useHarnessColors: "..tostring(myMount.useHarnessColors)) global:printSuccess("Effects :") for _,effect in ipairs(myMount.effectList) do global:printSuccess(" ActionID: "..effect.actionId.." - Value: "..effect.value) end global:printSuccess("ancestors :") for _,ancestor in ipairs(myMount.ancestor) do global:printSuccess(" "..ancestor) end global:printSuccess("behaviors :") for _,behavior in ipairs(myMount.behaviors) do global:printSuccess(" "..behavior) end end ``` -------------------------------- ### Process Console Lines (Lua) Source: https://doc.ankabot.dev/ankabot-touch/methodes/global/consolelines This Lua example demonstrates capturing console lines using global:consoleLines() and then iterating through them to print each line. It also shows how to count the number of lines retrieved. ```lua function move() local console_lines = global:consoleLines() global:printSuccess("Il y'avait "..#console_lines.." lignes dans la console.") for _, line in ipairs(console_lines) do global:printSuccess(line) end end ``` -------------------------------- ### Get Player Mount Data (CoffeeScript) Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/mymount This snippet shows the basic invocation of the `myMount` function in CoffeeScript. It's used to retrieve information about the player's currently equipped mount. The function takes no arguments. ```coffeescript mount:myMount() ``` -------------------------------- ### Start Script with Optional Reload (Coffeescript) Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur/developer/startscript The developer:startScript method initiates a script. The 'reload' argument, when set to true, resets the script's global variables before execution. When false, it proceeds without resetting them. ```coffeescript developer:startScript(reload) ``` -------------------------------- ### Get Stabled Mounts Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/stabledmounts Retrieves a list of all stabled mounts. Requires access to a pen before use. Returns a list of MountClientData objects. ```APIDOC ## GET /mounts/stabled ### Description Retrieves a list of all stabled mounts. This function requires the user to have access to a pen. ### Method GET ### Endpoint `/mounts/stabled` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **MountClientData** (array) - A list of objects, where each object represents a stabled mount and contains detailed information. - **id** (integer) - The unique identifier of the mount. - **model** (string) - The model name of the mount. - **name** (string) - The name given to the mount. - **sex** (boolean) - The sex of the mount (true for male, false for female). - **ownerId** (integer) - The ID of the mount's owner. - **experience** (integer) - The current experience points of the mount. - **experienceForLevel** (integer) - Experience points required for the current level. - **experienceForNextLevel** (integer) - Experience points required for the next level. - **level** (integer) - The current level of the mount. - **isRideable** (boolean) - Indicates if the mount can be ridden. - **maxPods** (integer) - The maximum carrying capacity of the mount. - **isWild** (boolean) - Indicates if the mount is a wild mount. - **stamina** (integer) - The current stamina of the mount. - **staminaMax** (integer) - The maximum stamina of the mount. - **maturity** (integer) - The current maturity level of the mount. - **maturityForAdult** (integer) - The maturity level required to become an adult. - **energy** (integer) - The current energy of the mount. - **energyMax** (integer) - The maximum energy of the mount. - **serenity** (integer) - The current serenity level of the mount. - **serenityMax** (integer) - The maximum serenity level of the mount. - **aggressivityMax** (integer) - The maximum aggressiveness of the mount. - **love** (integer) - The current love level of the mount. - **loveMax** (integer) - The maximum love level of the mount. - **fecondationTime** (integer) - The time remaining until the mount is ready for fertilization. - **isFecondationReady** (boolean) - Indicates if the mount is ready for fertilization. - **boostLimiter** (integer) - The current boost limiter of the mount. - **boostMax** (integer) - The maximum boost limit of the mount. - **reproductionCount** (integer) - The number of times the mount has reproduced. - **reproductionCountMax** (integer) - The maximum number of reproductions allowed. - **harnessGID** (integer) - The GID of the harness, if equipped. - **useHarnessColors** (boolean) - Indicates if custom harness colors are used. - **effectList** (array) - A list of active effects on the mount. - **actionId** (integer) - The ID of the effect. - **value** (integer) - The value of the effect. - **ancestor** (array) - A list of ancestor IDs for the mount. - **behaviors** (array) - A list of behaviors the mount exhibits. #### Response Example ```json [ { "id": 12345, "model": "horse", "name": "Spirit", "sex": true, "ownerId": 67890, "experience": 15000, "experienceForLevel": 10000, "experienceForNextLevel": 20000, "level": 5, "isRideable": true, "maxPods": 5000, "isWild": false, "stamina": 90, "staminaMax": 100, "maturity": 75, "maturityForAdult": 100, "energy": 85, "energyMax": 100, "serenity": 70, "serenityMax": 100, "aggressivityMax": 50, "love": 60, "loveMax": 100, "fecondationTime": 0, "isFecondationReady": true, "boostLimiter": 0, "boostMax": 10, "reproductionCount": 2, "reproductionCountMax": 5, "harnessGID": 9876, "useHarnessColors": false, "effectList": [ { "actionId": 1, "value": 5 }, { "actionId": 2, "value": 10 } ], "ancestor": ["anc1", "anc2"], "behaviors": ["run", "jump"] } ] ``` ### Error Handling - **403 Forbidden**: If the user does not have access to a pen. - **500 Internal Server Error**: If there is a server-side issue. ``` -------------------------------- ### Developer Mode - Network Requests Source: https://doc.ankabot.dev/ankabot-touch/mode-developpeur Methods for performing HTTP POST and GET requests, with options for proxy and IP routing. ```APIDOC ## postRequest ### Description Method returning the result of a POST request. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the POST request to. - **data** (object) - The data to send in the request body. ### Request Example ```json { "url": "http://example.com/api/data", "data": { "key": "value" } } ``` ### Response - **result** (any) - The result of the POST request. ## getRequest ### Description Method to perform a GET request and retrieve its result. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the GET request to. ### Request Example ```json { "url": "http://example.com/api/data" } ``` ### Response - **result** (any) - The result of the GET request. ## postRequestThroughHTTPSProxy ### Description Method returning the result of a POST request through an HTTPS proxy. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the POST request to. - **data** (object) - The data to send in the request body. - **proxyUrl** (string) - The URL of the HTTPS proxy. ### Request Example ```json { "url": "http://example.com/api/data", "data": { "key": "value" }, "proxyUrl": "http://proxy.example.com:8080" } ``` ### Response - **result** (any) - The result of the POST request. ## getRequestThroughHTTPSProxy ### Description Method to perform a GET request through an HTTPS proxy and retrieve its result. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the GET request to. - **proxyUrl** (string) - The URL of the HTTPS proxy. ### Request Example ```json { "url": "http://example.com/api/data", "proxyUrl": "http://proxy.example.com:8080" } ``` ### Response - **result** (any) - The result of the GET request. ## postRequestThroughSocks5Proxy ### Description Method returning the result of a POST request through a SOCKS5 proxy. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the POST request to. - **data** (object) - The data to send in the request body. - **proxyUrl** (string) - The URL of the SOCKS5 proxy. ### Request Example ```json { "url": "http://example.com/api/data", "data": { "key": "value" }, "proxyUrl": "socks5://proxy.example.com:1080" } ``` ### Response - **result** (any) - The result of the POST request. ## getRequestThroughSocks5Proxy ### Description Method to perform a GET request through a SOCKS5 proxy and retrieve its result. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the GET request to. - **proxyUrl** (string) - The URL of the SOCKS5 proxy. ### Request Example ```json { "url": "http://example.com/api/data", "proxyUrl": "socks5://proxy.example.com:1080" } ``` ### Response - **result** (any) - The result of the GET request. ## postRequestThroughMyIP ### Description Method returning the result of a POST request through the bot's IP. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the POST request to. - **data** (object) - The data to send in the request body. ### Request Example ```json { "url": "http://example.com/api/data", "data": { "key": "value" } } ``` ### Response - **result** (any) - The result of the POST request. ## getRequestThroughMyIP ### Description Method returning the result of a GET request through the bot's IP. ### Method (Assumed to be a method call) ### Endpoint (Not applicable) ### Parameters - **url** (string) - The URL to send the GET request to. ### Request Example ```json { "url": "http://example.com/api/data" } ``` ### Response - **result** (any) - The result of the GET request. ``` -------------------------------- ### Update Item Prices in Auction House (Lua) Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale/updateallitems This Lua example demonstrates how to use the updateAllItems method with different kamas values to adjust item prices. It also shows how to use the optional MIN_PRICE table to set minimum unit prices for items. ```lua sale:updateAllItems() -- Le nouveau prix est 499 sale:updateAllItems(-1) -- Le nouveau prix est 499 sale:updateAllItems(-3) -- Le nouveau prix est 497 sale:updateAllItems(2) -- Le nouveau prix est 502 sale:updateAllItems(3) -- Le nouveau prix est 503 sale:updateAllItems(-100) -- Le nouveau prix est 400 -- Avec prix minimum MIN_PRICE = { { 6898, 20 }, -- Plume de piou violet, prix minimum de l'unité = 20 { 885, 50 }, -- Laine de Boufton Noir, prix minimum de l'unité = 50 } sale:updateAllItems(-1, MIN_PRICE) -- Si le prix de 1xPlume de piou violet est 30, le nouveau prix est 29 car 29 > 20. -- Si le prix de 10xPlume de piou violet est 190, echec car 189 < 200 (20 x 10). ``` -------------------------------- ### Display Question and Get Response (CoffeeScript) Source: https://doc.ankabot.dev/ankabot-touch/methodes/global/question The 'question' method displays a string to the user and waits for a yes/no answer. It takes a single string argument representing the question. It returns a boolean value: true if the user answers 'yes', and false if they answer 'no'. ```coffeescript global:question(q) ``` -------------------------------- ### Get Item Price (Coffeescript) Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale/getpriceitem Retrieves the price of a specific item lot using its global ID and lot size. The lot size parameter determines the quantity (1 for x1, 2 for x10, 3 for x100). Ensure the Auction House is in 'Purchase' mode before execution. ```coffeescript sale:getPriceItemV2(gid, lots) ``` ```coffeescript sale:getPriceItemV2(303, 3) ``` -------------------------------- ### Display Input Prompt and Capture String (CoffeeScript) Source: https://doc.ankabot.dev/ankabot-touch/methodes/global/input The `global:input` method displays a user-defined question and returns the string entered by the user. It takes one argument, 'q', which is the question string to be displayed. The method is synchronous and returns the user's input as a string. ```coffeescript global:input(q) ``` ```coffeescript text = global:input("Identifiant de l'objet à supprimer :") ``` -------------------------------- ### Get Item GID Example using Lua Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale/getitemgid This Lua example shows how to use the getItemGID method to get the identifier of the fourth item in the sales inventory. It highlights the input argument (index) and the expected integer return value. ```lua sale:getItemGID(4) -- Résultat: 303 ``` -------------------------------- ### Get Item GUID API Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale Retrieves the private ID of the targeted item. ```APIDOC ## GET /ankabot-touch/methodes/sale/getitemguid.md ### Description Method to get the private ID of the targeted item. ### Method GET ### Endpoint /ankabot-touch/methodes/sale/getitemguid ### Parameters #### Path Parameters None #### Query Parameters - **itemId** (integer) - Required - The ID of the item. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **itemGuid** (string) - The private ID of the item. #### Response Example ```json { "itemGuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### Get Item GUID using Coffeescript Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale/getitemguid Retrieves the private identifier of an item from the sales space using its index. This method requires the 'Sales Hall' to be open in 'Seller' mode. ```coffeescript sale:getItemGUID(index) ``` ```coffeescript sale:getItemGUID(6) ``` -------------------------------- ### Get Current Map Data (Lua) Source: https://doc.ankabot.dev/ankabot-touch/methodes/map/getmap Retrieves the current map object, returning detailed information about the map. This function takes no arguments. The returned object contains properties like subAreaId, mapId, hasAggressiveMonsters, and a list of actors. Example usage shows how to print these properties. ```lua local currentMap = map:getMap() global:printSuccess(currentMap.subAreaId) global:printSuccess(currentMap.mapId) global:printSuccess(currentMap.hasAggressiveMonsters) global:printSuccess(#currentMap.actors) ``` -------------------------------- ### Audio and Display Methods Source: https://doc.ankabot.dev/ankabot-touch/methodes Methods for playing audio files and printing messages to the console. ```APIDOC ## Audio and Display Methods ### Play Audio - **Description**: Plays a specified WAV audio file. - **Method**: Not specified (likely a function call within the script). - **Endpoint**: N/A ### Print Messages - **Description**: A series of methods for printing messages to the console. The specific type might vary (e.g., `print` suggests polymorphic behavior). - **Method**: Not specified (likely a function call within the script). - **Endpoint**: N/A ### Print Phone/Tablet - **Description**: Displays the generated phone or tablet information for the bot in the console. - **Method**: Not specified (likely a function call within the script). - **Endpoint**: N/A ``` -------------------------------- ### Utilisation de useById avec des identifiants d'élément et de réponse Source: https://doc.ankabot.dev/ankabot-touch/methodes/map/usebyid Cette méthode est utilisée pour cibler un élément spécifique sur la carte par son identifiant unique (`elementId`) et pour spécifier quelle réponse ou action doit être déclenchée (`reply`). Si `reply` est négatif, il correspond à un index. Par exemple, -1 correspond à la première réponse et -2 est utilisé pour sauvegarder un Zaap. ```coffeescript map:useById(elementId, reply) ``` ```coffeescript map:useById(12345, -1) ``` -------------------------------- ### Get Item GID API Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale Retrieves the item ID. ```APIDOC ## GET /ankabot-touch/methodes/sale/getitemgid.md ### Description Method to get the item ID. ### Method GET ### Endpoint /ankabot-touch/methodes/sale/getitemgid ### Parameters #### Path Parameters None #### Query Parameters - **offerId** (integer) - Required - The ID of the offer. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **itemId** (integer) - The ID of the item. #### Response Example ```json { "itemId": 1234 } ``` ``` -------------------------------- ### Get Item Quantity API Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale Returns the quantity of an item currently on sale. ```APIDOC ## GET /ankabot-touch/methodes/sale/getitemquantity.md ### Description Method returning the quantity of the item on sale. ### Method GET ### Endpoint /ankabot-touch/methodes/sale/getitemquantity ### Parameters #### Path Parameters None #### Query Parameters - **offerId** (integer) - Required - The ID of the offer. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **quantity** (integer) - The quantity of the item on sale. #### Response Example ```json { "quantity": 10 } ``` ``` -------------------------------- ### Initiate Exchange by Player Name (CSS) Source: https://doc.ankabot.dev/ankabot-touch/methodes/exchange/launchexchangewithplayerbyname La méthode launchExchangeWithPlayerByName initie un échange avec un joueur spécifique en utilisant son nom. Elle prend le nom du joueur comme argument de type string et retourne un booléen (true pour accepté, false pour refusé). Par défaut, les échanges sont bloqués par AnkaBot. ```css exchange:launchExchangeWithPlayerByName(playerName) ``` ```css exchange:launchExchangeWithPlayerByName("Bob") ``` -------------------------------- ### Mount Inventory Management Source: https://doc.ankabot.dev/ankabot-touch/methodes Provides methods to interact with mounts in the player's inventory. ```APIDOC ## GET /ankabot-touch/methodes/mount/inventorymounts ### Description Retrieves all information about mounts present in the inventory. ### Method GET ### Endpoint /ankabot-touch/methodes/mount/inventorymounts ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **mounts** (array) - An array of mount objects, each containing details about a mount. #### Response Example { "mounts": [ { "id": "mount_id_1", "name": "Griffin", "level": 10, "stats": {} }, { "id": "mount_id_2", "name": "Pegasus", "level": 8, "stats": {} } ] } ``` ```APIDOC ## POST /ankabot-touch/methodes/mount/movemount ### Description Allows moving a mount between different locations such as stable, enclosure, inventory, or equipped. ### Method POST ### Endpoint /ankabot-touch/methodes/mount/movemount ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **mountId** (string) - Required - The unique identifier of the mount to move. - **fromLocation** (string) - Required - The current location of the mount (e.g., "inventory", "stable", "enclosure", "equipped"). - **toLocation** (string) - Required - The target location for the mount (e.g., "inventory", "stable", "enclosure", "equipped"). ### Request Example { "mountId": "mount_id_1", "fromLocation": "inventory", "toLocation": "stable" } ### Response #### Success Response (200) - **success** (boolean) - Indicates if the move operation was successful. #### Response Example { "success": true } ``` -------------------------------- ### Get Item Price API Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale Retrieves the price of one of your items from the Auction House. ```APIDOC ## GET /ankabot-touch/methodes/sale/getitemprice.md ### Description Method to get the price of one of your items from the Auction House. ### Method GET ### Endpoint /ankabot-touch/methodes/sale/getitemprice ### Parameters #### Path Parameters None #### Query Parameters - **offerId** (integer) - Required - The ID of the offer. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **price** (integer) - The price of the item. #### Response Example ```json { "price": 1500 } ``` ``` -------------------------------- ### List and Display Inventory Mounts (Lua) Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/inventorymounts This Lua script iterates through the mounts obtained from inventoryMounts(), printing detailed information for each mount. It showcases how to access mount properties like ID, expiration date, level, stats, and effects. ```lua function move() global:printMessage("-----------------------------------------------)$\n") global:printMessage("Montures dans l'inventaire)$\n") global:printMessage("-----------------------------------------------)$\n") local inventoryMounts = mount:inventoryMounts() for _,inventoryMount in ipairs(inventoryMounts) do global:printSuccess("ID "..inventoryMount.id) global:printSuccess("Expiration Date "..inventoryMount.expirationDate) global:printSuccess("Inventory GID "..inventoryMount.gid) global:printSuccess("Inventory UID "..inventoryMount.uid) global:printSuccess("....................................)$\n") global:printSuccess("id: "..inventoryMount.mount.id) global:printSuccess("model: "..inventoryMount.mount.model) global:printSuccess("name: "..inventoryMount.mount.name) global:printSuccess("sex: "..tostring(inventoryMount.mount.sex)) global:printSuccess("ownerId: "..inventoryMount.mount.ownerId) global:printSuccess("experience: "..inventoryMount.mount.experience) global:printSuccess("experienceForLevel: "..inventoryMount.mount.experienceForLevel) global:printSuccess("experienceForNextLevel: "..inventoryMount.mount.experienceForNextLevel) global:printSuccess("level: "..inventoryMount.mount.level) global:printSuccess("isRideable: "..tostring(inventoryMount.mount.isRideable)) global:printSuccess("maxPods: "..inventoryMount.mount.maxPods) global:printSuccess("isWild: "..tostring(inventoryMount.mount.isWild)) global:printSuccess("stamina: "..inventoryMount.mount.stamina) global:printSuccess("staminaMax: "..inventoryMount.mount.staminaMax) global:printSuccess("maturity "..inventoryMount.mount.maturity) global:printSuccess("maturityForAdult: "..inventoryMount.mount.maturityForAdult) global:printSuccess("energy: "..inventoryMount.mount.energy) global:printSuccess("energyMax: "..inventoryMount.mount.energyMax) global:printSuccess("serenity: "..inventoryMount.mount.serenity) global:printSuccess("serenityMax: "..inventoryMount.mount.serenityMax) global:printSuccess("aggressivityMax: "..inventoryMount.mount.aggressivityMax) global:printSuccess("love: "..inventoryMount.mount.love) global:printSuccess("loveMax: "..inventoryMount.mount.loveMax) global:printSuccess("fecondationTime: "..inventoryMount.mount.fecondationTime) global:printSuccess("isFecondationReady: "..tostring(inventoryMount.mount.isFecondationReady)) global:printSuccess("boostLimiter: "..inventoryMount.mount.boostLimiter) global:printSuccess("boostMax: "..inventoryMount.mount.boostMax) global:printSuccess("reproductionCount: "..inventoryMount.mount.reproductionCount) global:printSuccess("reproductionCountMax: "..inventoryMount.mount.reproductionCountMax) global:printSuccess("harnessGID: "..inventoryMount.mount.harnessGID) global:printSuccess("useHarnessColors: "..tostring(inventoryMount.mount.useHarnessColors)) global:printSuccess("Effects :)$\n") for _,effect in ipairs(inventoryMount.mount.effectList) do global:printSuccess(" ActionID: "..effect.actionId.." - Value: "..effect.value) end global:printSuccess("ancestors :)$\n") for _,ancestor in ipairs(inventoryMount.mount.ancestor) do global:printSuccess(" "..ancestor) end global:printSuccess("behaviors :)$\n") for _,behavior in ipairs(inventoryMount.mount.behaviors) do global:printSuccess(" "..behavior) end global:printMessage("-----------------------------------------------)$\n") end global:printMessage("-----------------------------------------------)$\n") end ``` -------------------------------- ### Get Price Item V2 API Source: https://doc.ankabot.dev/ankabot-touch/methodes/sale Retrieves the price of an item in the Auction House. ```APIDOC ## GET /ankabot-touch/methodes/sale/getpriceitem.md ### Description Method to get the price of an item in the Auction House. ### Method GET ### Endpoint /ankabot-touch/methodes/sale/getpriceitem ### Parameters #### Path Parameters None #### Query Parameters - **itemId** (integer) - Required - The ID of the item. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **price** (integer) - The price of the item. #### Response Example ```json { "price": 1000 } ``` ``` -------------------------------- ### Get ArchiMonsters Source: https://doc.ankabot.dev/ankabot-touch/methodes/map/getarchimonsters Retrieves a list of ArchiMonster identifiers present on the map. ```APIDOC ## GET /map/getArchiMonsters ### Description Retrieves a list of ArchiMonster identifiers present on the map. ### Method GET ### Endpoint /map/getArchiMonsters ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **{int}** - A list of ArchiMonster identifiers present on the map. #### Response Example ```json { "data": [ 1234, 5678, 9012 ] } ``` ``` -------------------------------- ### Launch Exchange With Player (CSS) Source: https://doc.ankabot.dev/ankabot-touch/methodes/exchange/launchexchangewithplayer Initiates an exchange with a specific player using their ID. The function returns true if the exchange is accepted and false if refused. Note that exchanges are blocked by default. ```css exchange:launchExchangeWithPlayer(playerId) ``` ```css exchange:launchExchangeWithPlayer(123456789) ``` -------------------------------- ### GET /level/{jobId} Source: https://doc.ankabot.dev/ankabot-touch/methodes/job/level Retrieves the level of a specific job using its ID. ```APIDOC ## GET /level/{jobId} ### Description Retrieves the level of a specific job. ### Method GET ### Endpoint `/level/{jobId}` ### Parameters #### Path Parameters - **jobId** (int) - Required - Identifiant du métier. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **level** (int) - Niveau du métier. #### Response Example ```json { "level": 100 } ``` ``` -------------------------------- ### Audio and Console Output Source: https://doc.ankabot.dev/ankabot-touch/methodes/global Methods for playing audio files and printing messages to the console. ```APIDOC ## Audio and Console Output ### playAudio #### Description Plays a WAV audio file. ### print #### Description A series of methods to display a message in the console. ### printPhone #### Description Displays the generated phone/tablet for the bot in the console. ``` -------------------------------- ### GET /job/name Source: https://doc.ankabot.dev/ankabot-touch/methodes/job/name Retrieves the name of a job given its unique identifier. ```APIDOC ## GET /job/name ### Description Retrieves the name of a job using its ID. ### Method GET ### Endpoint /job/name ### Parameters #### Query Parameters - **jobId** (int) - Required - The unique identifier of the job. ### Request Example ``` GET /job/name?jobId=123 ``` ### Response #### Success Response (200) - **name** (string) - The name of the job. #### Response Example ```json { "name": "Blacksmith" } ``` ``` -------------------------------- ### Load Bot Configuration with Coffeescript Source: https://doc.ankabot.dev/ankabot-touch/methodes/global/loadconfiguration The global:loadConfiguration function loads bot settings from an XML file. It accepts the absolute path to the XML file and an optional boolean argument to determine if the associated script should be launched. Configurations are stored in the 'save' directory of AnkaBot. ```coffeescript global:loadConfiguration(path, start) ``` ```coffeescript path = "C:/User/Desktop/sacrieur.xml" global:loadConfiguration(path) ``` -------------------------------- ### Call inventoryMounts Method (CoffeeScript) Source: https://doc.ankabot.dev/ankabot-touch/methodes/mount/inventorymounts This snippet demonstrates how to call the inventoryMounts method in CoffeeScript. It's a straightforward call to retrieve mount data from the inventory. ```coffeescript mount:inventoryMounts() ``` -------------------------------- ### Get Item Type ID Source: https://doc.ankabot.dev/ankabot-touch/methodes/inventory/itemtypeid Retrieves the item type ID for a given item global ID. ```APIDOC ## GET /websites/doc_ankabot_dev_ankabot-touch/itemTypeId ### Description Retrieves the item type ID for a given item global ID. ### Method GET ### Endpoint `/websites/doc_ankabot_dev_ankabot-touch/itemTypeId(gid)` ### Parameters #### Query Parameters - **gid** (int) - Required - Identifiant de l'objet. ### Response #### Success Response (200) - **int** (int) - L'identifiant du type de l'objet. #### Response Example ```json { "itemTypeId": 12345 } ``` ```