React - A little game to be played in chat

This is a discussion topic for the Ore project, React. View the full project on Ore for downloads and more information.


React

This is a little game that is played in chat. A bit of JSON text is shown to all players every so often, with some hover text. The first person to correctly type the hover text wins, and it is shown in chat who won and how long it took.

If the server is not currently running (for example: a singleplayer world that is not open to LAN), this plugin is not active.

Commands

/wins [player]: Gets the number of times player has won.
/sponge plugins reload: Reloads the config and resets the game.

Configuration

There are three Text blocks, text{}, prefix{}, and suffix{}. prefix{} and suffix{} go before and after text respectively when creating the message, and only text{} has the hover text on it. prefix{} and suffix{} are also optional.

There is also the words[] block. words[] is a list of things to put on the hover text. Which one to use is chosen randomly each time. Each entry in words[] does not have to be a single word, and can be multiple words. Note that any word using any characters other than letters must have quotes around it.

delay is the number of seconds between new words being selected. It is also the delay after starting or reloading before a new game is selected.

If max-delay is greater than delay, the delay will instead be a random number between delay and max-delay.

min-players is the number of players that is required for the game to start. Set to 0 to disable.

The rewards{} block handles extra handling when someone wins. Inside rewards{}, there is commands[], which is a list of commands that will get run. If a command starts with *, it will be run by the console; otherwise, it will be run by the player who won. In all commands, $winner will get replaced by the name of the player who won. Also in rewards{} is economy{}, which has two keys, currency and amount. currency is the name of the currency to use, as defined by the economy plugin. All economy plugins have a default currency, so this is optional. reward is the amount of money to award the player with.

Changelog

Note: The latest version of this plugin is compatible with both API 5 and API 4.1

1.0.0: If you hover over the version number, it’ll tell you.

1.1.0: Added support for rewards.

1.2.0: Added a minimum players count, and fixed configs not version checking.

1.2.1: Fixed rewards being applied on every chat message.

1.2.2: Fixed the config not generating properly.

1.2.3: Fixed a bug where the config would not load unless words[] was edited.

1.2.4: Fixed min-players acting like a maximum

Note

This plugin uses bStats, which collects data about your server. This data is in no way intrusive, is completely anonymized, and has a negligible impact on server performance, so there is no reason whatsoever to disable it. However, if you wish to anyway, simply set enabled to false in config/bStats/config.conf.

2 Likes

Thanks :smiley:

And will there be economy support? or run multiple commands on correct answer? i.e /pay [user] /give item

I didn’t think it really fitted, since it’s more or less a constant occurrence, there’s nothing invested in it, and operated entirely by chance.

1 Like

It would just be another way for people to earn money since, for example I only have shops and voting, I would like to make the economy more dynamic, if you have a larger server 20+ players and run it at a 5 minute interval while giving a small amount of money it could work fairly well, and competitive if you track the stats with SQL for a /reaction top

Added rewards, and I tend to destroy the universe every time I try to use SQL so I’m gonna say no thank you on that one.

Awesome look forward to adding and testing

Can there be min-num players? To prevent this from running if only a few number of players are online

I just added that, but Ore is throwing a 503. For now, you can grab the latest release off the github.

Everytime a user talks in chat it runs the command, in this case with the default a cookie. And the interval for it seems to be missing from the config

Fixed in the latest version. Ore is still 503ing unfortunately.

I don’t mind using the github, and is the interval added to the config so I can test it at something like every 5-10 seconds then switch it back to something around 5 min or whatever eventually feels natural

The interval’s always been in the config. Should be under the key delay.

This is how the config it generated looked like:

That makes absolutely zero sense. Can you try deleting the config and trying again

Same thing

The chat bug is fixed though, but a reload command would be nice instead of having to restart the server, especially if players are onling

lol
/sponge plugins reload

Oh cool, but won’t that break some plugins like it did with Bukkit? Or is that fixed with Sponge

When the /sponge plugins reload command is run, it fires GameReloadEvent. That’s it. Plugins decide how (or whether) they reload.
I merely set mine to reload the config.

Alright, and I set min-players=1, just waiting for it to show up to test

New release with a fixed config, and boy am I stupid for missing it. I forgot to load the config again after copying the file.