Re: Code bases&helpcheck

From: Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
Date: 04/20/98


Nah, we just want to see a little effort first.  Like reading the FAQ's.  You
know, have common net-manners.
--Angus

ObCircle:
ok... my version of help_check:
I got rid of is_social with a simple if check and is_fake_cmd() because I wanted
to see all of them.  but is does have the help_lookup().  Oh, i also use
george's buffer system.

int help_lookup(char *command)
{
   int chk,bot,top,mid,minlen;

   bot=0;
   top=top_of_helpt;
   minlen=strlen(command);

   for(;;)
      {
      mid=(bot+top)/2;

      if(bot>top)
         return -1;
      else if(!(chk=strn_cmp(command,help_table[mid].keyword,minlen)))
         {
         return 1;
         }
      else
         {
         if(chk>0)
            bot=mid+1;
         else
            top=mid-1;
         }
      }

}


ACMD(do_helpcheck)
{
   int i;
   int w=0;
   char *buf=get_buffer(32750);

   if(!help_table)
      {
      send_to_char("The help_table doesn't exits !?!?!\r\n",ch);
      release_buffer(buf);
      return;
      }

   strcpy(buf,"Commands without help entries:\r\n");
   strcat(buf,"------------------------------\r\n");

   for(i=i;*(cmd_info[i].command)!='\n';i++)
      {
      if(help_lookup(cmd_info[i].command)==-1)
         {
         if(cmd_info[i].command_pointer==do_action)
            continue;
         w++;
         w=w%3;
         sprintf(buf+strlen(buf)," %-20.20s%s",cmd_info[i].command,
                 (w?"|":"\r\n"));
         }
      }

   if(w)
      strcat(buf,"\r\n");

   if(ch->desc)
      page_string(ch->desc,buf,1);
   release_buffer(buf);
}


______________________________ Forward Header __________________________________
Subject: Re:  Code bases
Author:  INTERNET:CIRCLE@POST.QUEENSU.CA at CSERVE
Date:    4/20/98 12:39 PM


Alex wrote:
>
>
> Try reading documentation before just bluntly asking questions.

Hmmmmm, lets see... I want to code in some aspect of the game, and would
need some help. I guess I would have to read every documentation
published, and HOPE that the information is out there, *OR* I can try to
ask the Mailing list for a little help. And PRAY someone like this does
not spam me!

Is there some reason you have to assume that EVERYONE KNOWS WHERE TO
FIND THE INFORMATION?


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST