Autoexit Code [by Nashak]
Snippet Posted Wednesday, August 12th @ 11:24:11 PM, by George Greer in the Commands dept.
. Click the link below to read it or download it.

From: Brian Williams - Nashak <bmw@efn.org>
Subject: autoexits

This is one method of doing autoexits.

act.informative.c

(do_auto_exits)

for (door = 0; door < NUM_OF_DIRS; door++)
   if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE)
      if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
          sprintf(buf, "%s-%s# ", buf, dirs[door]);
      else
          sprintf(buf, "%s-%s ", buf, dirs[door]);

Well... this puzzled me.. (it puts "-north -east -south -west#") west
being a door... but I wanted it to be "-North.. etc" so if you want
that... just change the 'dirs[door]' to a 'capdirs[door]' and then in
constants.c do a search for 'north' and make a:

const char *capdirs[] =
{
  "North",
  "East",
  "South",
  "West",
  "Up",
  "Down",
  "\n"
};

Add this right above the const char *dirs[]... and then at the top of
act.informative.c, put an 'extern char *capdirs[];' right above the
'extern char *dirs[]'...


<< Autodiagnosis Code [by Will Shaw] | Reply | View as text | Threaded | Autoexit Code (Another) [by Eric Kilfoil] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.