[code][help]

From: Raven (joker831@viconet.com)
Date: 01/03/97


ok i am adding in the rlist,mlist, and olist

first were do i add them and is this the whole code????

sorry but ya know   *NEWBIE*
ACMD(do_rlist)
{
  extern struct room_data *world;
  extern int top_of_world;

  int first, last, nr, found = 0;

  two_arguments(argument, buf, buf2);

  if (!*buf || !*buf2) {
    send_to_char("Usage: rlist <begining number> <ending number>\r\n", ch);
    return;
  }

  first = atoi(buf);
  last = atoi(buf2);

  if ((first < 0) || (first > 99999) || (last < 0) || (last > 99999)) {
    send_to_char("Values must be between 0 and 99999.\n\r", ch);
    return;
  }

  if (first >= last) {
   send_to_char("Second value must be greater than first.\n\r", ch);
    return;
  }

  for (nr = 0; nr <= top_of_world && (world[nr].number <= last); nr++) {
    if (world[nr].number >= first) {
      sprintf(buf, "%5d. [%5d] (%3d) %s\r\n", ++found,
              world[nr].number, world[nr].zone,
              world[nr].name);
      send_to_char(buf, ch);
    }
  }

  if (!found)
    send_to_char("No rooms were found in those parameters.\n\r", ch);
}


ACMD(do_mlist)
{
  extern struct index_data *mob_index;
  extern struct char_data *mob_proto;
  extern int top_of_mobt;

  int first, last, nr, found = 0;
  two_arguments(argument, buf, buf2);

  if (!*buf || !*buf2) {
    send_to_char("Usage: mlist <begining number> <ending number>\r\n", ch);
    return;
  }

  first = atoi(buf);
  last = atoi(buf2);

  if ((first < 0) || (first > 99999) || (last < 0) || (last > 99999)) {
    send_to_char("Values must be between 0 and 99999.\n\r", ch);
    return;
  }

  if (first >= last) {
    send_to_char("Second value must be greater than first.\n\r", ch);
    return;
  }

  for (nr = 0; nr <= top_of_mobt && (mob_index[nr].virtual <= last); nr++)
{
    if (mob_index[nr].virtual >= first) {
      sprintf(buf, "%5d. [%5d] %s\r\n", ++found,
              mob_index[nr].virtual,
              mob_proto[nr].player.short_descr);
      send_to_char(buf, ch);
    }
  }

  if (!found)
    send_to_char("No mobiles were found in those parameters.\n\r", ch);
}


ACMD(do_olist)
{
  extern struct index_data *obj_index;
  extern struct obj_data *obj_proto;
  extern int top_of_objt;

  int first, last, nr, found = 0;

  two_arguments(argument, buf, buf2);

  if (!*buf || !*buf2) {
    send_to_char("Usage: olist <begining number> <ending number>\r\n", ch);
    return;
  }
  first = atoi(buf);
  last = atoi(buf2);

  if ((first < 0) || (first > 99999) || (last < 0) || (last > 99999)) {
    send_to_char("Values must be between 0 and 99999.\n\r", ch);
    return;
  }

  if (first >= last) {
    send_to_char("Second value must be greater than first.\n\r", ch);
    return;
  }

  for (nr = 0; nr <= top_of_objt && (obj_index[nr].virtual <= last); nr++)
{
    if (obj_index[nr].virtual >= first) {
      sprintf(buf, "%5d. [%5d] %s\r\n", ++found,
              obj_index[nr].virtual,
              obj_proto[nr].short_description);
      send_to_char(buf, ch);
    }
  }

  if (!found)
    send_


thanks in advance
QuOtE ThE RaVeN "NeVeRmOrE"


The Raven

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST