Re: Training Snippet

From: Shawn Kimbley (
Date: 04/21/00

Every once in a while I go back to getting beaten profusely by this section of
code, as I've previously stated i'm no coding guru so here's my problem.

I'm using the training snippet from the ftp site/snippet site and am having
problems with the argument.  When typing trains it automatically defults to the
invalid argument line and displays the "Train what?".  I'm snipping in one
argument for an example:


  if (!*argument)
    sprintf(buf,"Hit:%d Mana:%d Str:%d Con:%d Wis:%d Int:%d Dex:%d
      GET_MAX_HIT(ch), GET_MAX_MANA(ch), GET_STR(ch), GET_CON(ch),
      GET_INT(ch), GET_DEX(ch), GET_CHA(ch));
    sprintf(buf,"%sYou have %d training session",buf, GET_TRAINING(ch));
    if (GET_TRAINING(ch) == 1)
    return 1;

  if (GET_TRAINING(ch) <= 0) {
    send_to_char("You do not seem to be able to train now.\r\n", ch);
    return 1;

  if (strcmp(argument,"hit")==0)
      GET_TRAINING(ch) -=1;
      GET_MAX_HIT(ch) +=5;
    } else
      send_to_char("Train what?\r\n",ch);
      return 1;

If you have zero trains it will call the correct if statement, if you have
trains it doesn't use the if(!*argument) at all, just defaults to the Train
what at the end.  I'm not real familiar with the string commands which i'm
assuming is my biggest problem.

Any assistance here would be greatly appreciated as Its embarrassing how much
of a beating i've taken from this.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT