Vote rewards for Tibia

One Lua script works on The Forgotten Server 1.4+ and Canary. Players type !vote and receive items, coins or premium days.

Create your vote page

Sign up, name your server and choose Tibia. Setup fills in the usual settings: players enter “Your in-game name” and claim with !vote.

You should now see: Your vote page at its own address.

Add your toplists

Paste the link of your server on each list. For this game, VoteRank, TopG, XtremeTop100 and others are ready.

You should now see: Each list on your vote page.

Choose the reward

The item id for your client version, or a word such as coins.

You should now see: The reward under “What you earn” on your page.

Create an API key

Open Game server in the dashboard and create a key. It is shown once. You need it in the next step.

Connect the game

Follow the steps below.

Try it

Open a vote site in your dashboard, use Send a test vote with your own name, then type !vote in the game.

You should now see: The reward in your game, and “Your game has used a key”.

The Forgotten Server 1.4+ and Canary

Tested against a live VoteScript with a simulated game

Step 1

Put votescript.lua in data/scripts/. It works on both engines.

Step 2

Next to the server, run php votescript-delivery.php once, fill in votescript.ini with mode = "game", your key and your database, and start it again. Lua there has no web requests, so this program asks VoteScript.

votescript.ini
[database]
dsn = "mysql:host=127.0.0.1;dbname=YOUR_DATABASE;charset=utf8mb4"
user = ""
password = ""

[votescript]
url = "https://votescript.voterank.net"
key = "YOUR_KEY"
mode = "game"

Step 3

At the top of the script you choose what votes may give: premium days, storages, teleports, experience, outfits, mounts, your own actions. The script finds out by itself what your server can do and tells VoteScript.

data/scripts/votescript.lua
local VIP = { vip = true, premium = true }
local STORAGES = { { 30000, 39999 } }
local UNLOCK = { vote_dungeon = 30100 }
local PLACES = { temple = { 1000, 1000, 7 } }
local RUN = {
  daily_box = function(player, amount)
    player:addItem(2160, 5)
    return true
  end
}

Step 4

Players type !vote to claim by character name, or !vote CODE.

Toplists for Tibia

VoteRank is recommended for every game. Lists marked “test first” have a format we only found in other people’s code.

If it does not work

The command says there is nothing to claim
Check that the name on the vote page is the same as in the game, and that the vote shows as counted in the callback log.
Votes are not checked right now
Your game could not reach VoteScript, or the key is wrong. Look at “Last used” next to the key under Game server.
A reward says it waits
Your game said it cannot give it yet, or the player was in a fight. Open Rewards in the dashboard to see what your game can do, and allow it in the settings of the script or plugin.
Nothing arrives from a toplist
Compare the callback URL on the list with the one in VoteScript, letter by letter, with https. The common problems guide has every case.

Do it yourself

The API, webhooks and clients work with any game.

Give your players one place to vote

Your page is live as soon as you create your server. You can connect the rest step by step.