Wizhelp Update
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Feb 24, 2010 7:54 am
Magician
GroupMembers
Posts148
JoinedJan 24, 2008
This is just a little enhancement - it's actually from FotE but it's quite nice for admin - especially new ones. It separates the commands by level - overall just cleans up the function.
void do_wizhelp( CHAR_DATA * ch, const char *argument ) { CMDTYPE * cmd; int col, hash; int curr_lvl; col = 0; set_pager_color( AT_WHITE, ch ); for ( curr_lvl = LEVEL_AVATAR; curr_lvl <= get_trust( ch ); curr_lvl++) { send_to_pager( "\n\r\n\r", ch); col = 1; pager_printf( ch, "[LEVEL %-2d] ", curr_lvl); for (hash = 0; hash < 126; hash++ ) for ( cmd = command_hash[hash]; cmd; cmd = cmd->next ) if (( cmd->level == curr_lvl) && cmd->level <= get_trust( ch ) ) { pager_printf( ch, "%-12s", cmd->name ); if ( ++col % 6 == 0 ) send_to_pager( "\n\r", ch ); } } if ( col % 6 != 0 ) send_to_pager( "\n\r", ch ); return; }
#2 Feb 24, 2010 4:33 pm
Magician
GroupMembers
Posts147
JoinedJun 9, 2009
Could also change that call to pager_printf in the nested for loop command hash lookup like so:
Of course, if it's an issue of there is a help file and it's simply too high level for that player to read it'll still show as red, which can cause much confusion.
pager_printf( ch, "%s%-12s&W ", get_help( ch, cmd->name ) ? "&W" : "&R", cmd->name );This will display commands that have help files white, but any that don't have help files red so you'll know which ones may need creating.
Of course, if it's an issue of there is a help file and it's simply too high level for that player to read it'll still show as red, which can cause much confusion.
#3 Feb 24, 2010 5:44 pm
Magician
GroupMembers
Posts148
JoinedJan 24, 2008
Ah that's a good idea. Though - in my mind - there is little opportunity that a command that an immortal has access too will have a help file too high for them to read. If that's the case, it's probably a mistake.
#4 Feb 24, 2010 5:58 pm
Magician
GroupMembers
Posts147
JoinedJun 9, 2009
I've seen it happen and yes, it's usually just a case of whoever wrote the help file not making sure to set the level properly to reflect that of the command it's meant to reference. Could also have been a case of a holder file where the coder made a help file with every intention of actually writing it up and forgetting about it. *shrug*
Either way it lets people know that there's a help file issue one way or another, even if it's just a case of needing to play with the level a little, which can be handy.
Plus you can also do it with the list of commands using that, well, command.
Either way it lets people know that there's a help file issue one way or another, even if it's just a case of needing to play with the level a little, which can be handy.
Plus you can also do it with the list of commands using that, well, command.
Pages:<< prev 1 next >>