Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Viewing a buffer

Viewing a buffer

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Mon 29 Oct 2007 10:14 PM (UTC)
Message
Just a mod i did awhile back, got tired when going in to modify a helpfile or a room description and having to retype all the color tokens.

        if ( !str_cmp( cmd+1, "l" ) )
        {
            bool showAll = FALSE;

            if ( argument[2] == ' ' )
            {
                argument = one_argument( argument, cmd );
                if ( !str_cmp( argument, "all" ) )
                    showAll = TRUE;
            }

            if ( edit->numlines == 0 )
                send_to_char( "Buffer is empty.\n\r> ", ch );
            else
            {
                send_to_char_color( "&W------------------\n\r", ch );
                for ( x = 0; x < edit->numlines; x++ )
                {
                    ch_printf( ch, "%2d> ", x+1 );
                    if ( showAll )
                        send_to_char( edit->line[x], ch );
                    else
                        ch_printf( ch, "%s\n\r", edit->line[x] );
                    send_to_char( "\n\r", ch );
                }
                send_to_char( "&W------------------\n\r> ", ch );
            }
	    return;
	}


mine looks a little different since in my code i had already redone send_to_char to automatically redirect to send_to_char_color, so i have something called send_to_char_nocolor.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,077 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.