Astat command [by Josh Anderson]
Snippet Posted Sunday, June 18th @ 02:23:36 PM, by Brandon Brown in the Wizard dept.
Josh Anderson writes, "I have aedit installed on my mud and one of my builders [our "Head Socialist" :)] requested that I imp a command to stat socials so that he would not have to actually enter aedit just to see what statements were associated with each social. I decided to oblige him, and here is the result...."
I have aedit installed on my mud and one of my builders (our "Head Socialist" :) )
requested that I imp a command to stat socials so that he would not have to actually
enter aedit just to see what statements were associated with each social.  I decided
to oblige him, and here is the result.

This code is modeled after the menu from aedit, and is a very very simple command.
Standard disclaimers apply, though, and you may have to change some of this to get
it to work for you if you don't use aedit, but it's pretty straightforward.  Imp as
any other command.  Colorize if you feel froggy :)


ACMD(do_astat)
{
  int i, real = FALSE;

  if (IS_NPC(ch))
    return;

  one_argument(argument, buf);

  if(!*buf)
  {
    send_to_char("Astat which social?\r\n", ch);
    return;
  }

  for (i = 0; i <= top_of_socialt; i++)
  {
    if (is_abbrev(buf, soc_mess_list[i].command))
    {
      real = TRUE;
      break;
    }
  }

  if (!real)
  {
    send_to_char("No such social.\r\n", ch);
    return;
  }

  sprintf(buf,
    "\r\n"
    "Command         : %-15.15s\r\n"
    "Sort as Command : %-15.15s\r\n"
    "Min Position[CH]: %-8.8s\r\n"
    "Min Position[VT]: %-8.8s\r\n"
    "Min Level   [CH]: %-3d\r\n"
    "Show if Invis   : %s\r\n"
    "Char    [NO ARG]: %s\r\n"
    "Others  [NO ARG]: %s\r\n"
    "Char [NOT FOUND]: %s\r\n"
    "Char  [ARG SELF]: %s\r\n"
    "Others[ARG SELF]: %s\r\n"
    "Char      [VICT]: %s\r\n"
    "Others    [VICT]: %s\r\n"
    "Victim    [VICT]: %s\r\n"
    "Char  [BODY PRT]: %s\r\n"
    "Others[BODY PRT]: %s\r\n"
    "Victim[BODY PRT]: %s\r\n"
    "Char       [OBJ]: %s\r\n"
    "Others     [OBJ]: %s\r\n",

    soc_mess_list[i].command,
    soc_mess_list[i].sort_as,
    position_types[soc_mess_list[i].min_char_position],
    position_types[soc_mess_list[i].min_victim_position],
    soc_mess_list[i].min_level_char,
    (soc_mess_list[i].hide ? "HIDDEN" : "NOT HIDDEN"),
    soc_mess_list[i].char_no_arg ? soc_mess_list[i].char_no_arg : "",
    soc_mess_list[i].others_no_arg ? soc_mess_list[i].others_no_arg : "",
    soc_mess_list[i].not_found ? soc_mess_list[i].not_found : "",
    soc_mess_list[i].char_auto ? soc_mess_list[i].char_auto : "",
    soc_mess_list[i].others_auto ? soc_mess_list[i].others_auto : "",
    soc_mess_list[i].char_found ? soc_mess_list[i].char_found : "",
    soc_mess_list[i].others_found ? soc_mess_list[i].others_found : "",
    soc_mess_list[i].vict_found ? soc_mess_list[i].vict_found : "",
    soc_mess_list[i].char_body_found ? soc_mess_list[i].char_body_found : "",
    soc_mess_list[i].others_body_found ? soc_mess_list[i].others_body_found : "",
    soc_mess_list[i].vict_body_found ? soc_mess_list[i].vict_body_found : "",
    soc_mess_list[i].char_obj_found ? soc_mess_list[i].char_obj_found : "",
    soc_mess_list[i].others_obj_found ? soc_mess_list[i].others_obj_found : "");

    send_to_char(buf, ch);
}

Josh Anderson
joshua18@home.com

<< Ordinal Directions for 3.0bpl17 (nw, ne, sw, se) [by Khalun] | Reply | Threaded >>

 


Related Links
  Josh Anderson
Related Articles
More by bbrown
 
 

Quick Links
 
The CircleMUD FAQ
The CircleMUD home page
Alex's Snippets
Wintermute Snippets
CircleMUD Bug Reporting or Help
CircleMUD List Archives
CircleMUD Resources
Death Gate's Scripts
(Author of C conversion)
Sammy's code site
Erwin S. Andreasen's page
(Author of mudFTP and other goodies)
Death's Gate Scripting site
Help for CircleMUD in Windows
The OasisOLC Maintenance Effort
George's Random Stuff
Imaginary Realities
MUD Dictionary