[Circle] [Code] list functions

From: Christopher M. Ryan (drizzt@visi.net)
Date: 11/23/96


world. They are also good for upkeep ect.. I hope someone finds them
usefull <maybe they would make a good edition to OLC but is not dependant
upon it's existance in the mud  I gave my commands persmision to
LVL_BUILDER, else it would have defeated my purpose for making it ;) Have
fun!

Christopher M. Ryan
drizzt@visi.net
http://www.visi.net/~drizzt/index.html
http://www.visi.net/~drizzt/quake/index.html

-------- Snip ----------
/*
**   My own edition for helping out in creating a new world
** from scratch using OLC. This can also be used to assist
** imorts and other higher powers in upkeep additions
** and other tasks where you might need to know room, obj,
** and mob vnums.
**
**   I used a simple linear search in all the functions but if you
** have a large database with lots of rooms and ect.. you may
** want to convert the first search for s (start) to a binary.
**
** Christopher M. Ryan
*/
ACMD(do_rlist)
{
  int s, e, z;

  one_argument(argument, arg);

  if(!*arg)
    z = ((int)((world[ch->in_room].number)/100))*100;
  else
    z = (atoi(arg))*100;

  for(s = 0; s <= top_of_world; s++)
    if(world[s].number >= z)
      break;

  for(e = s; e <= top_of_world; e++)
    if(world[e].number >= z + 100)
      break;

  if( s == e )
  {
    send_to_char("That zone does not exist or there are no\r\n", ch);
    send_to_char("rooms in that zone.\r\n", ch);
    return;
  }

  send_to_char("V-Num Name\r\n", ch);
  send_to_char("----- ------------------\r\n", ch);

  for(; s < e; s++)
  {
    sprintf(buf, "%5d %s\r\n", world[s].number, world[s].name);
    send_to_char(buf, ch);
  }
}

ACMD(do_olist)
{
  int s, e, z;

  one_argument(argument, arg);

  if(!*arg)
    z = ((int)((world[ch->in_room].number)/100))*100;
  else
    z = (atoi(arg))*100;

  for(s = 0; s <= top_of_objt; s++)
    if(obj_index[s].virtual >= z)
      break;

  for(e = s; e <= top_of_objt; e++)
    if(obj_index[e].virtual >= z + 100)
      break;

  if( s == e )
  {
    send_to_char("That zone does not exist or there are no\r\n", ch);
    send_to_char("objects in that zone.\r\n", ch);
    return;
  }

  send_to_char("V-Num Name\r\n", ch);
  send_to_char("----- ------------------\r\n", ch);

  for(; s < e; s++)
  {
    sprintf(buf, "%5d %s\r\n", obj_index[s].virtual, obj_proto[s].name);
    send_to_char(buf, ch);
  }
}

ACMD(do_mlist)
{
  int s, e, z;

  one_argument(argument, arg);

  if(!*arg)
    z = ((int)((world[ch->in_room].number)/100))*100;
  else
    z = (atoi(arg))*100;

  for(s = 0; s <= top_of_mobt; s++)
    if(mob_index[s].virtual >= z)
      break;

  for(e = s; e <= top_of_mobt; e++)
    if(mob_index[e].virtual >= z + 100)
      break;

  if( s == e )
  {
    send_to_char("That zone does not exist or there are no\r\n", ch);
    send_to_char("mobs in that zone.\r\n", ch);
    return;
  }

  send_to_char("V-Num Name\r\n", ch);
  send_to_char("----- ------------------\r\n", ch);

  for(; s < e; s++)
  {
    sprintf(buf, "%5d %s\r\n", mob_index[s].virtual,
mob_proto[s].player.name);
    send_to_char(buf, ch);
  }
}
-------- Snip ----------
+-----------------------------------------------------------+
| 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