Stats & Achievements
This Project is currently abandoned (and probably will forever be). See here for a alternative plugin
2-in-1 Stats and Achievements
This plugin logs various player activity as stats in a MySQL or SQLite database. With the integrated achievement system it is possible to award players when they reached a predefined target.
Features
- Logs block, mob, pvp and miscellaneous player statistics very detailled
- Logs also crafting statistics when spout is installed
- Integrated achievements system
- New database format which is more performant than older databases
- Integrated time delay to reduce server load and the number of SQL queries
- Planned web stats system
- Compatible with every Bukkit version since 1.1-R4
Tools
- You can convert older databases using our utility: http://89.144.25.51:8888/convert.php
- Achievements generator (will be extended soon): http://plugins.maniacraft.de/SaAPlugin/achgen
Requirements
- Vault (Permissions)
- Spout (if you want to get crafting stats)
Commands
- /stats help - General Help
- /stats [<player>] - Shows your stats or stats by <player>.
- /stats block [<player>] <block>[:<data>] - Shows stats for <block>.
- /stats pvp [<player>] [<player2>] - Shows PVP stats.
- /stats mob [<player>] [<mob>] - Shows mob damage stats.
- /achievements help - General Help
- /achievements [<player>] - Shows your obtained achievements or achievements obtained by <player>.
- /achievements list [<page>] - Lists all available achievements.
- /achievements admin add <name> <description> <category> <block> <data> <value> <command> - Adds a new achievement.
- /achievements admin remove <id> - Removes the achievement <id>.
- /achievements admin convert - Convert old achievements.
Achievement Commands
- /give <block>[:<data>] [<amount>] - gives the player the item <block> <data>
- All commands available on your server. Example (Essentials warp): /warp darkroom %player%
Permissions
Permission | Description |
---|---|
stats.show.blocks.own | Show own block stats |
stats.show.blocks.other | Show block stats by others |
stats.show.pvp.own | Show own pvp stats |
stats.show.pvp.other | Show pvp stats by others |
stats.show.mob.own | Show own mob stats |
stats.show.mob.other | Show mob stats by others |
stats.overview.own | Show your overview |
stats.overview.other | Show overview by others |
stats.receive | Log stats at all (for example not for Guests) |
achievements.receive | Gives achievements at all (for example not for Guests) |
achievements.admin.remove | Admin Command Remove |
achievements.admin.add | Admin Command Add |
achievements.admin.convert | Admin Command Convert achievements from old DB |
achievements.list | List all achievements |
achievements.show.own | Show obtained achievements |
achievements.show.other | Show achievements obtained by others |
Config
general: language: en # Language (Available: en/de, other languages can be added in plugins/StatsAndAchievements/lang/) update-delay: 30 # The time interval in seconds how often the stats will be updated in the database (Default and recommended: 30) achievements: true # Activating and deactivating Achievements text_color: '&6' # Color of command texts (1st color) data_color: '&7' # Color of data output (2nd color) debug: false # Debug output (Default and recommended: false) database: type: mysql # Database type, either mysql or sqlite table_prefix: '' # Table prefix to save stats of more than one server in a single database host: localhost # Only MySQL: Database server (Default: localhost) port: 3306 # Only MySQL: Database server port (MySQL default 3306) database: minecraft # Only MySQL: Database name user: root # Only MySQL: Database user password: stats123 # Only MySQL: Database password DisabledWorlds: # In this worlds the stats will be deactivated - disabledworld1 - creative listeners: blockStats: true # Block related stats brewingStats: true # Brewing related stats (maybe bugged) craftingStats: true # Crafting related stats (maybe bugged) enchantingStats: true # Enchanting related stats (maybe bugged) entityStats: true # Entity related stats playerStats: true # Player related stats (Your really should NOT disable this or you'll break everything!) playerMoveStats: true # Player move stats (if you experience lags you should set this to false) vehicleStats: true # Vehicle related stats
Language file formating
{br} - Line break &[0-f] - Color codes (http://img109.imageshack.us/img109/4334/mccolors.png) %[A-Z0-9]% - Internal variables, don't supposed to be translated!
I am a little bit confused on how to create an achievement. Is there some page or such that explains what the Categories, Data, and Values are? -Thanks
Loving the plugin, but I'm really missing the documentation, everytime I get an error I can't tell if its my fault or a legitimate error D:.
Of few things I'd love to know how todo, if someone wouldn't mind educating me:
How can I set an achievement to track multiple blocks break, like dirt and grass, or ALL blocks?
Does this plugin Still need spout to track certain stats?
Thanks for the Simple Spleef support :-)
@pyrotech1620
For my website stats page I use a bit of math to calculate play time when they are logged in that way its always accurate. If you were looking for a solution to make getting a play time achievement a bit more "live" I don't have a good solution. Frankly, the people who play on mine don't pay too much attention to the stats as they are playing and its exciting to log in and be granted an achievement or two without expecting it :)
@Lucskywalk75
Yes, depending on what permissions plugin you have. If you can use a command to give a player permissions, than you can just set that to be the achievement command.
Is there a way to have it record the number of hours a player has played, and then grant this player with certain permissions once he/she has played a certain amount of hours? This would be awesome! Thanks!
Unfortunately I'm busy for the next week, so work for me has slowed quite a bit.
My guide is nearly done though and I'm hoping to get that done by the weekend.
@pyrotech1620
At the moment it doesn't update as a player plays. It's suprisingly annoying to do this and get it optimised not to affect permformance. There are a few methods I'm looking into, but I'm still not sure.
If however you just wanted to display their current playtime on a web page, then all you need is some math ;)
@Aangiix3
It doesn't generate them automatically, you have to create them yourself. I'm going to look and see If I can't change that at some point.
Here is a copy of the english version. Just translate this one. (I'm not at home so I can't get the default German one).
It didn't generate the "language" folder for me, I really need the german translations for my German Server..
@wattzy
I have updated "forcePlayTimeUpdate" to true it will update the play time when a user exits.. But is there anyway to have this update even while the player is still online?
@oman95891
In the config file (1.8) set
"forcePlayTimeUpdate" to true
This will force playtime's to update regardless of players permissions.
This is used because of the way some permissions plugins work, they return false or 'incorrect player' when a player is offline, and when the playtime is updated the player is already offline so it doesn't work.
Can someone tell me where I might be going wrong?
The times are not updating. Player's times are staying the same and never updating, and this is becoming a very big problem as our server depends on this playtime.
Things to consider: 1. I personally host my database, but there is no connection problem that I am aware of. SAAplugin shows no errors, and the other plugins that use that database are working perfectly (hawkeye, ultrabans)
2. I have used multiple versions of SAAplugin. Telling me to update is not going to fix it; I have used versions 1.4-1.8 and none of them have worked.
3. The groups do have the permission for stats. In fact, the stats did work for a while, but then suddenly stopped working. Most players are stuck at 7 hours or so.
thanks, oman.
@Schlumpf9
1. MOVE,MINECART...etc. is total blocks traversed. I believe the general consensus is that 1 block in game is 1 metre. Which is the measurement I go by ;)
2. playtime is in seconds
3. LASTLOGIN & LASTLOGOUT are unix timestamp values link for description,
PHP example "date("F j, Y, g:i a", $lastlogout);" with lastlogout a variable that's holding the lastlogout time from the database.
The result of that statement would be "May 11, 2012, 10:24 pm"
4. Lets see If I can get this right ;)
ok, "block" should be 0 (Unless, you are doing a player/pvp kill, then the block value would be the ID of the player from the players table).
"data" would be a entity ID, from here, use the ID value.
"value" would be the amount you want to compare against.
So, example:
Name - "BOOOOOOOM"
Description - "Kill 15 creepers"
Type - "KILLS"
block - "0"
data - "13" taken from the table
value - "15"
command - "/say %player% has Killed 15 creepers"
5. Move is the TOTAL movement of all of them. No matter how you move this will increase.
I hope that makes sense :D
@wattzy
Hi, k nice :)
Some questions:
1. What is the value of MOVE,MINECART... are this moved blocks or metres, kilometres, what exactly is this value like?
2. what is the value at playtime? Are this seconds, minutes?
3. LASTLOGIN is created from which algorithm? time()?
4. How must I create Achievements with Mob Kills? As type "KILLS" block=0 data="mob id?" value="amount". Must I buillt them as this or where must I define the Mob ID?
5. Is MOVE the total amount of all MOVEMENTS (foot,minecart,boat) togheter or is MOVE the way he moved by foot?
Hope you can answer soem of this questions :)
@Schlumpf9
@Decagonapus
@Schlumpf9
I'll try and add a section on to the end of the guide with a brief and simple example of php'ing the info from the databases.
I have stats and stuff working well on my site, but its a mess, so much info and so little space to show it all, tables everywhere! :(
@Decagonapus
hmm, if there is no script I have to do it myself -.- Good that I can php :)
@Schlumpf9
ZoRkCreativeCrafts posted a while ago that he had been making something to display the stats via web. "I've starting to make a web page on my site to display all players's stats. With Global and individual player's pages."
I'm looking for something too. Any chance of including a basic example with the plugin?
Hi, is there anywhere a php Script for the Stats to shiow them on the website? :D
A couple of examples for achievements would be wonderful since I don't get this at all atm. :P
@PainKNero
achievement generator is unfortunately out of my control, it is not up-to-date, and I don't know when it will be. I am attempting to write a guide, when I get free time, explaining achievements and how-to's though ;)
I'll look into the "/achievements list" command. I know achievements are stored in the database in the order they were obtained, but it shouldn't be too hard to order them with latest first. :)
I'm also going to look at adding perhaps a difficulty rating column and a pre-requisite column to achievements. So players can't obtain an achievement before getting a previous one. Or even, maybe add achievements that are rewarded for completing a group of achievements. (This will probably require a lot of work, and for now, don't expect any progress from me on this, I'm busier than normal for the next two weeks) :(
With regards to limiting to regions, this can already be done per-world, inside the config file, under the disabledWorlds option. Just place any worlds you don't want players to receive stats/achievements on, here.
- yes... please update the achievement generator... or is it just done ?
- ok, more input: I build my achievements like that: Digger I: pickup 1 dirt Digger II: pickup 10 dirt ... ... ... Digger IX: pickup 10000 dirt
and so on ...
If i type achievements list, i want to see only the highest rank earned, not Digger I,II,III,IV, just VIII (if that is my current level)
- Or, perhaps more simple to build: Please sort the player owned achievements by name, so if i input "/achievements" i'll see Digger I Digger II Digger III Hunter I Hunter II Fisher I
etc...
In the moment, "/achievements" give an unsorted list.
- Or, next idea, put the latest achievement on top of the command /achievements"
- Stats and Achievements only in certain regions (e.g. Worldguardregion or worlds) availible ! Just my ideas at that moment.
Greetings,
Nero
Are there any other ideas/features that people would like added?
Occasionally I get bored and I like to work on things that the community can enjoy ;)