do_toggle is made for use with multiple versions of a certain command. In this snippet I'll be using do_score as an example since I actually have two different do_score's I allow people to use which by using the toggle command they can switch between each one to figure out which one they'd like to view for ease on their behalf. This snippet basically shows you how to go about doing this, some parts you may have to use your own knowledge. -----tables.c----- This can go anywhere in the file but I put it near where all the other flag_type's were located /* Now you can add ANY flag you want here. Doesn't have to be scoreone */ const struct flag_type togg_flags[] = { { "scoreone", TOGG_SCOREONE, TRUE }, { NULL, 0, 0 } }; -----save.c------ In fwrite_char Under: fprintf( fp, "Comm %s\n", print_flags(ch->comm)); add: fprintf( fp, "Togg %s\n", print_flags(ch->togg)); In fread_char Under the "case 'T'" right above this: KEY( "TrueSex", ch->pcdata->true_sex, fread_number( fp ) ); add: KEY( "Togg", ch->togg, fread_flag( fp ) ); -----handler.c----- right before: char *comm_bit_name(int comm_flags) add: char *togg_bit_name(int togg_flags) { static char buf[512]; buf[0] = '\0'; if (togg_flags & TOGG_SCOREONE ) strcat(buf, " scoreone"); return ( buf[0] != '\0' ) ? buf+1 : "none"; } ----act_info.c----- Now like I said this would be for most any other command not just used for in do_score unless you happen to have two versions of score then this is perfect. My original score is under do_score and my 2nd one is under do_scoretwo which isn't placed inside interp.c so a character can't type scoretwo and get it to work. So basically try refraining from putting the defines in interp.c/interp.h for the "second" command that's able to be toggled. That way this command (do_toggle) isn't as useless. in at the top of do_score add: if (IS_SET(ch->togg, TOGG_SCOREONE)) { do_function(ch, &do_scoretwo, ""); } else This next part is the "crappy" version since the actual version I use is "fancy" in looks so it really looks ugly in code, and I don't want rants about being more organized in my "border" creation =oD Dress the argument0 to what you want, this is basically how it prints. Put this at the bottom of act_info.c or basically anywhere you want void do_toggle( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; one_argument( argument, arg ); if (argument[0] == '\0' ) { send_to_char("\n\rToggle-Able Commands\n\r", ch ); send_to_char("Score ", ch ); if (!IS_SET(ch->togg,TOGG_SCOREONE)) send_to_char("Score# 1\n\r", ch ); else send_to_char("Score# 2\n\r", ch ); } if (!str_cmp(arg,"score")) { if (IS_SET(ch->togg,TOGG_SCOREONE)) { send_to_char("\n\rScore #1 enabled.\n\r", ch ); REMOVE_BIT(ch->togg,TOGG_SCOREONE); } else { send_to_char("\n\rScore #2 enabled.\n\r", ch ); SET_BIT(ch->togg,TOGG_SCOREONE); } } } ----merc.h----- Right above RT comm flags add this: /* TOGGLE FLAGS */ #define TOGG_SCOREONE (A) Under: long comm; /* RT added to pad the vector */ add: long togg; Under: char * comm_bit_name args( ( int comm_flags ) ); add: char * togg_bit_name args( ( int togg_flags ) ); ----tables.h------ under: extern const struct flag_type comm_flags[]; add: extern const struct flag_type togg_flags[]; ----interp.h------ under: DECLARE_DO_FUN( do_title ); add: DECLARE_DO_FUN( do_toggle ); ----interp.c------ under: { "commands", do_commands,POS_DEAD, 0, LOG_NORMAL, 1}, add: { "toggle", do_toggle, POS_DEAD, 0, LOG_NORMAL, 1}, -----END------- AuthorNotes: If you notice this is very much like the way "do_channels" works. SO I must give them credit but this is just an idea I've wanted to do for sometime now. Also another plan I'm going to do with this code is add the do_longequipment snippet and have it toggle-able so that people can see the original 'equipment' which shows equiped items and their slots, or have the longequipment which shows equiped items and empty slots. Here's how mine is dressed up on the MUD: Toggle-Able Commands -=+=-.oOo.-=+=-.oOo.+-=+=-.oOo.-=+=-.oOo.-=+=- | Command | Toggled To | --=------------------------------------------- | Score | Score# 1 | -=+=-.oOo.-=+=-.oOo.+-=+=-.oOo.-=+=-.oOo.-=+=- | How to Use: Just type toggle 'command' | | Toggle only works on the commands listed | | above. | -=+=-.oOo.-=+=-.oOo.+-=+=-.oOo.-=+=-.oOo.-=+=- Sorry for all the 'yip yap(ramblings)' all around this file, Mallyrn of aeternitas aeternitas@programmer.net