Creds to fab for guiding me a little on how to use variable from another file
Navigate to
wServer>program.cs
Add this line near the top with the rest of the lines that look a bit similar
Code:
public static readonly DateTime StartTime = DateTime.Now;
Now navigate to your command file you want to put this in, which is probably
wServer>realm>commands>WorldCommand.cs
Add this command, at the top, I guess, doesn't matter as long as you don't be a retard when placing it and interfere with a bracket or another command.
Code:
internal class UptimeCommand : Command
{
public UptimeCommand() : base("uptime") { }
protected override bool Process(Player player, RealmTime time, string[] args)
{
var uptime = DateTime.Now - Program.StartTime;
var minutes = uptime.TotalMinutes;
player.SendInfo("Server Uptime: " + uptime.ToString());
return true;
}
}
Yeah Ik there is an unused variable, I was gonna make it show as a solid number of minutes, but I'd rather it show as
hr:min:sec.
Gimme more command ideas, xD I have made a few commands from NR already, I am pretty sure they have uptime command and then the gift command except their version of /gift sends item to vault but I like mine how it sends to inv, can easily be done to send to vault tho, and then done a few more simple ones like /visit and the quake one he has and i wanna try /reboot soon.