Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Yahoo!, Google

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Capper
Forum Rules | Mark all | Recent Posts

Capper
< Newer Topic :: Older Topic > I couldn't think of a better name?

Pages:<< prev 1 next >>
Post is unread #1 Dec 22, 2006, 8:41 pm   Last edited Dec 22, 2006, 8:54 pm by Strakc
Go to the top of the page
Go to the bottom of the page

Metsuro
Apprentice
GroupMembers
Posts68
JoinedSep 2, 2006

On well basically I wanted to make my channels have Caps at the begining and period at the end so...

char *capper( const char *str )
{
   int i;
   static char temp[MAX_STRING_LENGTH];

   i = strlen( str );
   if( str[i-1] !=  '.' && str[i-1] != '!' && str[i-1] != '?' )
     sprintf( temp, "%s.", capitalize( str ) );
   else
     sprintf( temp, "%s", capitalize( str ) );
   return temp;

}

/*
 * Returns an initial-capped string.
 */
char *capitalize( const char *str )
{
   static char strcap[MAX_STRING_LENGTH];
   int i;

   for( i = 0; str[i] != '\0'; i++ )
      strcap[i] = str[i];
   strcap[i] = '\0';
   strcap[0] = UPPER( strcap[0] );
   return strcap;
}
I created capper, and changed my capitalize to take the lower() out of it. and this changes....

You say, 'hrm' to... You say, 'Hrm."

Ok well I forgot how it will change it... soo the change to a channel would be... something like...

ch_printf( ch, "You %s '%s'\r\n", verb, capper(argument) );
         snprintf( buf, MAX_STRING_LENGTH, "$n %ss '%s'", verb, capper(argument) );

       
Post is unread #2 Dec 22, 2006, 11:33 pm
Go to the top of the page
Go to the bottom of the page

kiasyn
Magician
GroupMembers
Posts121
JoinedJun 30, 2006

why not use ispunct for the . , ? ! etc.
       
Post is unread #3 Dec 23, 2006, 12:00 am
Go to the top of the page
Go to the bottom of the page

Metsuro
Apprentice
GroupMembers
Posts68
JoinedSep 2, 2006

Didn't know about it, prolly still wont add it in cause I dont know what it does. Or where it is.
       
Post is unread #4 Dec 23, 2006, 12:06 am
Go to the top of the page
Go to the bottom of the page

Metsuro
Apprentice
GroupMembers
Posts68
JoinedSep 2, 2006

And cause apparently... smaugfuss doesn't come with it?
       
Post is unread #5 Dec 23, 2006, 12:24 am   Last edited Dec 23, 2006, 12:25 am by kiasyn
Go to the top of the page
Go to the bottom of the page

kiasyn
Magician
GroupMembers
Posts121
JoinedJun 30, 2006

From the man pages:
       ispunct()
              checks  for  any  printable character which is not a space or an
              alphanumeric character.

       
Post is unread #6 Dec 23, 2006, 12:40 am
Go to the top of the page
Go to the bottom of the page

Metsuro
Apprentice
GroupMembers
Posts68
JoinedSep 2, 2006

Ah that would be why! thanks I'll look into using that instead maybe or something I donno
       
Pages:<< prev 1 next >>