Results 1 to 8 of 8

Thread: Color codes support for printf

  1. #1
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts

    Color codes support for printf

    Click image for larger version. 

Name:	57f636275b1849f6b7221aa2ad8d0b0a.png 
Views:	58 
Size:	46.0 KB 
ID:	1289

    https://github.com/voron00/libcod/co...0a880cfb5d3f24

    Note 1: Your terminal MUST support and have enabled ANSI colors.
    Note 2: Same for your ssh client.
    Note 3: It works for gsc_printf() function only.
    Note 4: It can be disabled by setting 'colored_prints' cvar to 0.
    Last edited by voron00; 10th March 2017 at 00:30.
    sudo apt-get rekt

  2. The Following 4 Users Say Thank You to voron00 For This Useful Post:

    kung foo man (9th March 2017),Lonsofore (10th March 2017),maxdamage99 (9th March 2017),Whiskas (9th March 2017)

  3. #2
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    I like it!

    Is there any known hook to add text to every printf generated by the server?

  4. #3
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    I don't think server prints got any colors, except for chat perhaps, but chat can be easily replaced with gsc using callback_playercommand.
    sudo apt-get rekt

  5. #4
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Good idea, but all .ssh clients can show colors or only Putty?
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  6. #5
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Quote Originally Posted by voron00 View Post
    I don't think server prints got any colors, except for chat perhaps, but chat can be easily replaced with gsc using callback_playercommand.
    I was rather talking about adding current timestamp before printed text.

  7. #6
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Quote Originally Posted by maxdamage99 View Post
    Good idea, but all .ssh clients can show colors or only Putty?
    Works for putty, idk about others.

    Quote Originally Posted by Whiskas View Post
    I was rather talking about adding current timestamp before printed text.
    Proably doable.
    sudo apt-get rekt

  8. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Just pipe output of your process to a nodejs file that adds the timestamp for you.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  9. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (9th March 2017),Whiskas (9th March 2017)

  10. #8
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Quote Originally Posted by IzNoGoD View Post
    Just pipe output of your process to a nodejs file that adds the timestamp for you.
    Thanks, your reply inspired me to find out whether the Screen GNU has built-in timestamp or not. It seems that it has.

  11. The Following User Says Thank You to Whiskas For This Useful Post:

    kung foo man (9th March 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •