[Circle] [CODE SPAM][problem]

From: Brian Williams - Nashak (bmw@efn.org)
Date: 11/05/96


Okay.. here is my problem, I added an attributes command, and a new score
thing.. anyways.. here is the problem.. I type att.. it says all the stuff
fine except for one thing, the top line:
             C Craraererttttbubus s r r shsh
should be
             Character attributes for Nashak
and
             ScSce e fofoatatn n r r shsh
should be
             Score information for Nashak
my code is as follows:

ACMD(do_attributes)
{
  sprintf(buf, "                 Character attributes for %s\r\n", 
GET_NAME(ch));
  sprintf(buf, "\r\n%sLevel: %d   Race: %s   Class: %s\r\n", buf, 
GET_LEVEL(ch),
               RACE_ABBR(ch), CLASS_ABBR(ch));
  sprintf(buf, "%sAge: %d yrs / %d mths  Height: %d inches  Weight: %d 
lbs\r\n", buf,
               age(ch).year, age(ch).month, GET_HEIGHT(ch), GET_WEIGHT(ch));
  if (GET_CLASS(ch) == CLASS_WARRIOR && GET_STR(ch) == 18)
    sprintf(buf, "%sStr: %d/%d    Int: %d       Wis: %d\r\nDex: %d       
Con: %d      Cha: %d",
                 GET_STR(ch), GET_ADD(ch), GET_INT(ch), GET_WIS(ch),
                 GET_DEX(ch), GET_CON(ch), GET_CHA(ch));
  else
    sprintf(buf, "%sStr: %d       Int: %d       Wis: %d\r\nDex: %d       
Con: %d      Cha: %d",
                 GET_STR(ch), GET_INT(ch), GET_WIS(ch), GET_DEX(ch),
                 GET_CON(ch), GET_CHA(ch));
  sprintf(buf, "%sArmor Class: %d\r\n", buf, GET_AC(ch));
  sprintf(buf, "%sHitroll: %d   Damroll: %d\r\n", buf, (ch)->points.hitroll,
               (ch)->points.damroll);
  sprintf(buf, "%sAlignment: %d\r\n", buf, GET_ALIGNMENT(ch));
  sprintf(buf, "%sSaving Throws: PAR[%d]  ROD[%d]  PET[%d]  BRE[%d] 
SPE[%d]\r\n", buf,
               GET_SAVE(ch, 0), GET_SAVE(ch, 1), GET_SAVE(ch, 2), 
GET_SAVE(ch, 3),
               GET_SAVE(ch, 4));
}

ACMD(do_score)
{
  struct time_info_data playing_time;
  struct time_info_data real_time_passed(time_t t2, time_t t1);

  sprintf(buf, "                Score information for %s\r\n", GET_NAME(ch));
  sprintf(buf, "\r\n%sLevel: %d   Race: %s    Class: %s     Sex: ", buf,
                GET_LEVEL(ch), RACE_ABBR(ch), CLASS_ABBR(ch));
  switch (GET_SEX(ch)) {
    case SEX_MALE: strcat(buf, "Male\r\n"); break;
    case SEX_FEMALE: strcat(buf, "Female\r\n"); break;
    default: strcat(buf, "Neutral\r\n"); break;
  }
  sprintf(buf, "%sHit points: %d(%d)   Moves: %d(%d)    Mana: 
%d(%d)\r\n", buf,
                GET_HIT(ch), GET_MAX_HIT(ch), GET_MOVE(ch), GET_MAX_MOVE(ch),
                GET_MANA(ch), GET_MAX_MANA(ch));
  sprintf(buf, "%sCoins carried:    %d gold\r\n", buf, GET_GOLD(ch));
  sprintf(buf, "%sCoins in bank:    %d gold\r\n", buf, GET_BANK_GOLD(ch));
  playing_time = real_time_passed((time(0) - ch->player.time.logon) +
                ch->player.time.played, 0);
  sprintf(buf, "%sPlaying time: %d days / %d hours.\r\n", buf, 
playing_time.day,
                playing_time.hours);
  sprintf(buf, "%sStatus: ", buf);
  switch (GET_POS(ch)) {
    case POS_DEAD: strcat(buf, "Dead.\r\n"); break;
    case POS_MORTALLYW: strcat(buf, "Mortally wounded.\r\n"); break;
    case POS_INCAP: strcat(buf, "Incapacitated.\r\n"); break;
    case POS_STUNNED: strcat(buf, "Stunned.\r\n"); break;
    case POS_SLEEPING: strcat(buf, "Sleeping.\r\n"); break;
    case POS_RESTING: strcat(buf, "Resting.\r\n"); break;
    case POS_SITTING: strcat(buf, "Sitting.\r\n"); break;
    case POS_FIGHTING: strcat(buf, "Fighting.\r\n"); break;
    case POS_STANDING: strcat(buf, "Standing.\r\n"); break;
    default: strcat(buf, "Floating.\r\n"); break;
  }
  sprintf(buf, "%sEnchantments: ", buf);
  if (IS_AFFECTED(ch, AFF_BLIND))
    strcat(buf, "Blindness   ");
  if (IS_AFFECTED(ch, AFF_INVISIBLE))
    strcat(buf, "Invisible   ");
  if (IS_AFFECTED(ch, AFF_DETECT_INVIS))
    strcat(buf, "Detect Invis   ");
  if (IS_AFFECTED(ch, AFF_SANCTUARY))
    strcat(buf, "Sanctuary   ");
  if (IS_AFFECTED(ch, AFF_POISON))
    strcat(buf, "Poison   ");
  if (affected_by_spell(ch, SPELL_ARMOR))
    strcat(buf, "Armor   ");
  if (IS_AFFECTED(ch, AFF_INFRAVISION))
    strcat(buf, "Infravision   ");
  strcat(buf, "\r\n");
  if (GET_COND(ch, DRUNK) > 10)
    strcat(buf, "You are drunk.\r\n");
  if (GET_COND(ch, FULL) == 0)
    strcat(buf, "You are hungry.\r\n");
  if (GET_COND(ch, THIRST) == 0)
    strcat(buf, "You are thirsty.\r\n");
  send_to_char(buf, ch);
}

does anyone have any idea why it doesn't show the top lines correctly?
maybe should I *buf = '\0'  at the top? don't think that would change
anything though, since I started the fresh buf by not adding %s in front
of the top line, then putting buf.. anyways.. I am stumped here.. please
help =)


		 	   |-\ \            / /
			    \ \ \          /<
			     \ \-|        /  \
                              ..... asha .....
				bmw@efn.org
			      mud.penguin.net
				    4000

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



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