Api - Transformice
Since Atelier 801 (the developer) has not released an official REST API for developers, the community built its own tools. Using network sniffing and public data endpoints, the Transformice Web API was born.
Transformice uses a custom binary protocol over TCP. You cannot simply send JSON. You must either:
The API is logically divided into namespaces. Here are the critical ones you need to know:
This namespace is used to force actions to happen in the game world. It is the primary tool for event integration.
What can you actually build with this? Here are a few ideas:
Happy coding, and may your shaman builds be structurally sound! 🐭
To "provide a proper post" for the Transformice API depends on whether you are interacting with the Module API (in-game Lua) or the Web/Stats API (external data). 1. In-Game Module API (Lua)
If you are writing a script for a minigame, a "proper post" usually refers to an event trigger or a command that outputs information to the chat.
Triggering an Event: Use the tfm.exec functions for standard actions or define an event handler. For example, to post a message in the chat when a player joins:
function eventNewPlayer(playerName) tfm.exec.chatMessage("Welcome to the room, " .. playerName .. "!", playerName) end Use code with caution. Copied to clipboard Resources:
Find the full list of functions on the Lua Transformice Wiki. transformice api
For official discussions or reporting bugs, use the Module Suggestions Thread on Atelier 801. 2. External Stats API (Web/Data)
If you want to pull data like Cheeseformice does for leaderboards, you are looking for the Stats API.
Access: This API is not fully public. You must typically request access through the Atelier 801 forums by providing details about your project.
Authentication: If approved, you will likely receive an API key to access a MySQL database containing player statistics. 3. Community Tools For developers looking for pre-built wrappers or libraries:
Transfromage API: An open-source GitHub repository that provides a documented API for making bots.
pshy_merge: A tool to compile multiple Lua files into a single script for easy deployment in-game, found on GitHub. Lua | Transformice Wiki | Fandom
The "Transformice API" typically refers to the Lua Module API
, a powerful scripting system that allows players to create custom minigames (known as "modules"), automated tribe house activities, and specialized room events 1. The Lua Module API The core of Transformice development is built on the Lua scripting language
. Players can use it to manipulate game physics, track player actions, and design unique user interfaces. Primary Functions : Developers use events like eventChatCommand to trigger scripts via chat, or eventKeyboard to track player movement and key presses. : Any player can test scripts in their Tribe House
followed by their code. Larger, community-wide modules (like ) are managed by the Module Team Since Atelier 801 (the developer) has not released
, a group of volunteer developers with access to persistent databases and official room hosting. Documentation official Lua help can be accessed in-game by typing
, which provides a live tree of all available functions and events. 2. Bot & External APIs
For developers looking to interact with the game from outside the client, there are unofficial but widely used libraries: Transfromage : An asynchronous Python and Luvit-based API
designed for creating game bots. It requires an API token (often applied for through community managers) to access the game's encryption keys. Connection Key Parsers : Tools like TransformiceKeys
help developers retrieve the necessary connection tokens and keys required to establish a socket connection with the Atelier 801 servers. 3. Data Retrieval & Statistics
While there isn't a traditional REST API for player global stats, the community uses several methods to pull data: Web Scrapers
: Platforms often crawl server images or shop banners to track new items and events. Third-Party Trackers : Sites like PlayTracker
aggregate player counts and achievements, though they often rely on Steam's API rather than a direct Transformice endpoint. sample Lua script to see how a basic Transformice module is structured? Lua | Transformice Wiki | Fandom
Transformice , the "API" typically refers to the Lua scripting engine
, which allows you to create custom minigames (modules) or tribe house scripts. To display and manipulate text within the game, you use the tfm.enum.addTextArea function and its related events. Transformice Wiki Creating a Text Area Happy coding, and may your shaman builds be
To develop a text element, you must define its ID, the content, and its position on the screen. -- Basic script to show text to all players
"
Welcome to my Map!
"-- tfm.enum.addTextArea(id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, alpha, fixedPos) tfm.exec.addTextArea(textId, content, Use code with caution. Copied to clipboard Interactive Text (Buttons) You can make text clickable by using the
(anchor) tag with a custom event name. When a player clicks it, the eventTextAreaCallback is triggered. Transformice Wiki Define the Link: Wrap your text in Text Handle the Click:
Use the callback function to run code when that specific action is clicked. -- Example: A clickable "Close" button tfm.exec.addTextArea( "[ Close ]" eventTextAreaCallback(id, player, callback) callback == "close_menu" tfm.exec.removeTextArea(id, player) Use code with caution. Copied to clipboard Key Formatting Tags
Transformice text areas support a limited subset of HTML/CSS for styling: ... ... Alignment:
...
(Supported values: (Underline) External ToolsIf you are looking to develop external tools like bots or forum integration rather than in-game scripts: Transfromage A documented Lua API for creating game bots. Fromage API Specifically for interacting with the Atelier801 forums. , such as a leaderboard or a shop menu? Lua | Transformice Wiki | Fandom
The most common use of the Transformice API (external) is to create a Discord bot that displays stats.