RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

Shard Statistics 1.3

No permission to download
Introduction

This is a Plug & Play Utility to help you showing/using statistics from the shard.

I've listed the most common statistics of the shard. If you have any suggestion about stats to be added, feel free to ask. You can also implement them by yourself, it's pretty easy.

Functionality

By default, it will start collect statistics as soon you start the shard, and auto-update them every 5 minutes. Also, the statistics will be reported on console.



You can change this on the Config class, at the top of the script.

C#:
bool Enabled = true;                            // Is this system enabled?
bool ConsoleReport = true;                      // Should we report statistics on console?
int Interval = 5;                              // What's the statistics update interval, in minutes?
AccessLevel CanSeeStats = AccessLevel.Player;  // What's the level required to see statistics in-game?
AccessLevel CanUpdateStats = AccessLevel.Seer;  // What's the level required to update statistics in-game?

Players in-game can check the status using the command:
[Statistics (Shows the gump below)



And your staff members can force the statistics update using the command:
[UpdateStatistics (By default, accessible to Seers and above levels).

Installation

Just drop this script somewhere in your Scripts folder and restart the shard.

For Developers

This is the list of the current statistics you can use on your scripts:

C#:
TimeSpan ShardAge
TimeSpan Uptime
TimeSpan TotalGameTime
DateTime LastRestart
DateTime LastStatsUpdate
int ActiveAccounts
int ActiveStaffMembers
int ActiveGuilds
int ActiveParties
int PlayersInParty
int PlayerHouses
int PlayerGold
int PlayersOnline
int StaffOnline

To use them, after you've installed the script, all you need to do is to refer them like this:

C#:
Statistics.PlayerHouses

In this example, you'll get the number of player houses. You can assign to a variable, print a message with it or whatever you want.

Let's see a more complete example. Let's say you want to tell the player the Total Game Time of the shard:

C#:
Player.SendMessage("The game time sum of all players in this shard is {0} days, {1} hours, {2} minutes and {3} seconds!", Statistics.TotalGameTime.Days, Statistics.TotalGameTime.Hours, Statistics.TotalGameTime.Minutes, Statistics.TotalGameTime.Seconds);

Last Words

You probably won't need to add any "using" statement, as Statistics are on Server namespace.

If you have any doubt, you can ask on the discussion thread of this script.
Author
Felladrin
Downloads
95
Views
416
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Felladrin

Latest updates

  1. Changed display of Uptime and Total Game Time

    Uptime is now displayed as: # days, # hours and # minutes. Total Game Time is now displayed...
  2. Hotfix for String.Join() method

    Fixed bug reported by Kingllama. It shall now compile fine on Net Framework 2.0.
  3. Added command, gump, and improved the code

    - Added commands to see/update statistics in-game. - Added gump for statistics in-game - Added...
Top