World command help

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
9 months 3 weeks ago - 9 months 3 weeks ago #6921 by JTP
World command help was created by JTP
Hi
I know there is show stat, but it would be cool with a World command for all, that shows the below info, BUT only from zones marked with GRID. So the info would be more relevant. The unused zones i have marked with closed.
Anyone who can help me make such a command ?

Mud version:
Start time:
Lokal time:
Uptime : days hours mins
Mobiles: Objects:
Rooms : Zones:
Players: 4/441
Last edit: 9 months 3 weeks ago by JTP.

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #6922 by thomas
Replied by thomas on topic World command help
I'm unsure what you're asking. Can you supply an example of the expected output?

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
9 months 3 weeks ago - 9 months 3 weeks ago #6923 by JTP
Replied by JTP on topic World command help
Here is the idea


Typing world

Would show:

Mud version: Getting version info from the code
Start time: What time and date was the mud restartet
Lokal time: The local time and date of the server If possible
Uptime : How long has the mud been running since last reboot in days and hours and mins
Mobiles: show amount of mob there are in all the combined zones with GRID Objects: same as in mobiles just with objects
Rooms: same as the others just with rooms Zones: and amount of zones with GRID.
Players: 4/441 shows How many players that are online/and How many there is in the playerbase.



Mud version:
Start time:
Lokal time:
Uptime : 00 days 00 hours 01 mins
Mobiles: 0000 Objects: 0000
Rooms : 0000 Zones: 0000
Players: 1/0001
Last edit: 9 months 3 weeks ago by JTP.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
9 months 2 weeks ago #6930 by JTP
Replied by JTP on topic World command help
Any luck findout out about this command ? And how to add up those infos from zones marked with GRID

Please Log in or Create an account to join the conversation.

More
9 months 2 weeks ago #6931 by thomas
Replied by thomas on topic World command help
Well, there already exists commands for some of the parts - date, time, uptime. Some of the counts are readily available.
So it boils down to "how do I count the number of X in zones marked as GRID?"

As I see it, a loop over rooms would do it. Something like this pseudocode:
int room_count = 0, mob_count = 0, pc_count = 0, object_count = 0 

for (room in world) {
  if (!is_in_grid_zone(room))
    continue;
  room_count++;
  for (char in room) {
    if (is_npc(char))
      mob_count++;
    else
      pc_count++;
    object_count += count_objects(char->wears);
    object_count += count_objects(char->carries);
  }
  for (object in room) {
    object_count++;
    object_count += count_objects(object->contains);
  }
}
The count of zones with GRID is a simple loop over the zones, and counting just the ones with the GRID flag.

I hope this can work as a template for your further work on this feature.

Please Log in or Create an account to join the conversation.

Time to create page: 1.290 seconds