Votifier for your RSPS, in one jar
Four short methods connect the jar to your game. It answers ::claimvote, pays players who are online by itself, and can receive Votifier votes. With a VoteScript key, or without an account.
Votifier for an RSPS5 steps
What you need
- The source of your RSPS
- Java 8 or newer
Add the jar
Download votescript.jar and add it to the libraries of your project. It needs nothing else.
your-server/
libs/
votescript.jarnew
data/
server.jar
Start it and pass commands
Start it when your server starts, with the four methods, and give it every command a player types. The names in the code are examples: use the ones of your own server.
// what your game does for each kind of reward
VoteActions<Player> actions = new VoteActions<>();
actions.on("item", (p, i) -> p.getInventory().add(i.number(0, 1, 65535), i.amount));
actions.on("vip/donator", (p, i) -> p.addDonatorDays(i.amount));
actions.on("title", (p, i) -> p.setTitle(i.words(), i.forever() ? -1 : i.amount));
actions.on("xp", (p, i) -> p.getSkills().addXp(Skill.byName(i.arg(0)), i.amount));
actions.on("storage/votePoints", (p, i) -> p.addAttribute("votePoints", i.amount));
actions.on("teleport/vote_island", (p, i) -> !p.inCombat(), (p, i) -> p.moveTo(3222, 3222, 0));
actions.on("run/daily_box", (p, i) -> DailyBox.open(p, i.amount)); // your own
// when the server starts
static final Queue<Runnable> TASKS = new ConcurrentLinkedQueue<>();
static VoteServer votes;
votes = VoteServer.start(new File("data/votes"), new VoteServer.Game() {
public void run(Runnable task) { TASKS.add(task); }
public Collection<String> online() {
List<String> names = new ArrayList<>();
for (Player p : World.getPlayers()) if (p != null) names.add(p.getUsername());
return names;
}
public boolean give(String name, VoteScript.Claim claim) {
Player p = World.getPlayer(name);
if (p == null || p.getInventory().freeSlots() < claim.items.size()) return false; // kept for later
return actions.give(p, claim);
}
public void message(String name, String text) {
Player p = World.getPlayer(name);
if (p != null) p.sendMessage(text);
}
}, actions);
// in your game tick
for (Runnable t; (t = TASKS.poll()) != null; ) t.run();
// in your command handler, with the whole text the player typed
if (votes != null && votes.command(player.getUsername(), text)) return;Set your key
Start the server once. It writes the settings file. Put in your API key from Game server and restart.
url=https://votescript.voterank.net key=YOUR_KEY automatic=true every=10
key= votifier=true port=8192 # What a vote pays, as KEY:AMOUNT,KEY:AMOUNT reward=995:100000 hours-between=1 keep-days=60
Optional: receive Votifier votes
Set votifier=true and open the port. Give lists the token from the settings file, or the key in data/votes/rsa/public.key. If all your lists use the token, set v1=false, because the old protocol proves nothing about the sender.
url=https://votescript.voterank.net key=YOUR_KEY automatic=true every=10 votifier=true host=0.0.0.0 port=8192 v1=true
data/votes/
votescript.propertiesedit
rsa/
public.keycopy
Try it in the game
Send a test vote from a vote site in your dashboard. Online players are paid by themselves, and ::claimvote works too.
Iron Moss: ::claimvote
Thank you for voting! Rewards received for 2 votes.
If it does not work
Nothing happens on ::claimvote
The player has no room
Crashes or strange items
Has it run on a live server?
Next
GuideSend votes to your VotifierVoteScript confirms each vote and sends it to your game as a Votifier vote. The plugin that already pays your voters sees one more vote.
GuideRewards, bonuses and streaksStart with one reward per vote: an item, a day of VIP, a title, a teleport. Add a bonus and a streak when the first one works.
GuideToplist callbacksA callback is how a toplist tells VoteScript that someone really voted. Lists also call it postback, incentive, pingback or webhook. You paste one address per list.
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.

