Skip to content

Blank3495/Transfromage

 
 

Repository files navigation

Donate

Transformice's API written in Lua (5.1▲) using the Luvit runtime environment

About

Transformice is an online independent multiplayer free-to-play platform video game created by the French company Atelier801.

Luvit is an open-source, asynchronous I/O Lua runtime environment that makes requests and connections possible for the Lua programming language.

Transfromage API is a documented API that allows developers to make bots for the aforementioned game.

Join the Fifty Shades of Lua discord to discuss about this API and to receive special support.

You can also check out Fromage API for Atelier801's forum.

This API had many indirect contributors, including @Tocutoeltuco, @Useems, @Turkitutu, @Athesdrake and the python version of Transfromage API.

/!\ Versions under 2.0 are no longer working due to internal changes of the game.
To persist using an older version, please check the changes in enum.lua in this commit.

Keys Endpoint

This API depends on an endpoint that gives you access to the Transformice encryption keys.

To use it you will need a token which you can get by applying through this form. See below to know the names of Transfromage managers who handle the token system.

  • Tocutoeltuco @discord=> Tocutoeltuco#0018 212634414021214209;
  • Blank3495 @discord=> 󠂪󠂪 󠂪󠂪 󠂪󠂪󠂪󠂪 󠂪󠂪 󠂪󠂪󠂪󠂪 󠂪󠂪 󠂪󠂪#8737 436703225140346881;
  • Bolodefchoco @discord=> Lautenschlager#2555 285878295759814656.

Installation

  • To install Luvit, visit https://luvit.io and follow the instructions provided for your platform.
    • If you face problems installing it on Windows, please use Get-Lit
  • To install Transfromage, run lit install Lautenschlager-id/transfromage
  • Run your bot script using luvit, for example: luvit bot.lua
If you are new and can't follow these steps, please consider using the MyFirstBot.zip that has been premade with the executables and the API.
(4MB) Windows | Linux

API Update

To update the API automatically all you need to do is to create a file named autoupdate in the bot's path.
You can create it running cd. > autoupdate (for Windows) or touch autoupdate (for Linux);

The update will overwrite all the old files and dependencies.

For semi-automatic updates (which asks for your permission before updating), create the file semiautoupdate instead.

Contributing

The best way to contribute to this API is by donating creating pull requests with bug fixes and new events / methods (like joining the map editor, getting a map XML, loading Lua...)

Read CONTRIBUTING to learn about how you can contribute to the API.
See CONTRIBUTORS.

Base example

You can check more examples here.
local api = require("Transfromage")
local client = api.client()

client:once("ready", function()
	client:connect("Username#0000", "password")
end)

client:start("PLAYER_ID", "API_TOKEN")
Suggestion to prevent this issue
client:on("whisperMessage", function(playerName, message, playerCommunity)
	if playerName == "OWNER_NAME#0000" then -- Not the bot name, but yours (the bot developer)
		if message == "shutdown" then -- Command shutdown
			client:disconnect()
		end
	end
end)
Suggestion for reconnection on login failure to prevent this issue
client:on("ready", function()
	client:connect("Username#0000", "password")
end)

client:on("connectionFailed", function()
	client:start("PLAYER_ID", "API_TOKEN")
end)

client:emit("connectionFailed")

About

An API that provides access to the game Transformice.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%