Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, Bing

Members: 0
Guests: 22
Stats
Files
Topics
Posts
Members
Newest Member
489
3,791
19,644
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SWR FUSS » Wizhelp Update
Forum Rules | Mark all | Recent Posts

Wizhelp Update
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 24, 2010 7:54 am   
Go to the top of the page
Go to the bottom of the page

Keirath
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;
}

Post is unread #2 Feb 24, 2010 4:33 pm   
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

 
Could also change that call to pager_printf in the nested for loop command hash lookup like so:
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. :)

Post is unread #3 Feb 24, 2010 5:44 pm   
Go to the top of the page
Go to the bottom of the page

Keirath
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.

Post is unread #4 Feb 24, 2010 5:58 pm   
Go to the top of the page
Go to the bottom of the page

Andril
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.

Pages:<< prev 1 next >>