Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 03-16-2003, 10:17 PM   #1
Tezcatlipoca
Member
 
Join Date: Feb 2003
Posts: 46
Tezcatlipoca is an unknown quantity at this point
To keep it simple, does anyone here know of, and where to get, a Java package, or even just a single class that provides ANSI tag support for transfer over a socket, obviously for the use of colour support in a Java coded MUD(or any telnetable server really)? I'm quite confident it is out there, as java MUDclients have been made that supports ANSI interpretation, and others have made MUDs in Java, and I would assume that at least a few of them have colour support. So my question is, where can i get my hands on it?
Tezcatlipoca is offline   Reply With Quote
Old 03-17-2003, 06:34 AM   #2
kaylus1
 
Posts: n/a
  Reply With Quote
Old 03-17-2003, 02:18 PM   #3
Tezcatlipoca
Member
 
Join Date: Feb 2003
Posts: 46
Tezcatlipoca is an unknown quantity at this point
Tezcatlipoca is offline   Reply With Quote
Old 04-10-2005, 08:53 PM   #4
Jaregarde
New Member
 
Join Date: Dec 2004
Posts: 25
Jaregarde is on a distinguished road
I'm working on using ANSI color with Java too, but I'm not quite sure if I'm doing it right...would this, for example, be a correct string?

"\033[0;34m Bla bla blah..."

I was also wondering if anyone could tell me how to test this? (I'm planning on starting a MUD, but I, er, haven't yet so I don't yet have a server with which to test it.)

Thanks,
Jaregarde
Jaregarde is offline   Reply With Quote
Old 04-11-2005, 01:11 AM   #5
milliway
New Member
 
Join Date: Feb 2005
Posts: 7
milliway is on a distinguished road
Here's a little piece of code I wrote in 2001, you're welcome to use it. You also might be able to include the .jar's from some other project in your classpath, and reuse their classes...

Thedia


public final class ANSI {

public static final String SANE = "\u001B[0m";

public static final String HIGH_INTENSITY = "\u001B[1m";
public static final String LOW_INTESITY = "\u001B[2m";

public static final String ITALIC = "\u001B[3m";
public static final String UNDERLINE = "\u001B[4m";
public static final String BLINK = "\u001B[5m";
public static final String RAPID_BLINK = "\u001B[6m";
public static final String REVERSE_VIDEO = "\u001B[7m";
public static final String INVISIBLE_TEXT = "\u001B[8m";

public static final String BLACK = "\u001B[30m";
public static final String RED = "\u001B[31m";
public static final String GREEN = "\u001B[32m";
public static final String YELLOW = "\u001B[33m";
public static final String BLUE = "\u001B[34m";
public static final String MAGENTA = "\u001B[35m";
public static final String CYAN = "\u001B[36m";
public static final String WHITE = "\u001B[37m";

public static final String BACKGROUND_BLACK = "\u001B[40m";
public static final String BACKGROUND_RED = "\u001B[41m";
public static final String BACKGROUND_GREEN = "\u001B[42m";
public static final String BACKGROUND_YELLOW = "\u001B[43m";
public static final String BACKGROUND_BLUE = "\u001B[44m";
public static final String BACKGROUND_MAGENTA = "\u001B[45m";
public static final String BACKGROUND_CYAN = "\u001B[46m";
public static final String BACKGROUND_WHITE = "\u001B[47m";

private ANSI() {} // disable automatic constructor

}
milliway is offline   Reply With Quote
Old 04-11-2005, 12:11 PM   #6
Jaregarde
New Member
 
Join Date: Dec 2004
Posts: 25
Jaregarde is on a distinguished road
Ok, thank you, Milliway; I was wondering something else, too, though. What if you want to have parts of the string have different colors? Do you just insert a new tag whenever you want to change the color?
Jaregarde is offline   Reply With Quote
Old 04-11-2005, 12:30 PM   #7
milliway
New Member
 
Join Date: Feb 2005
Posts: 7
milliway is on a distinguished road
out.println(ANSI.CYAN + "This is cyan" + ANSI.RED + ", and this is red.");
milliway is offline   Reply With Quote
Reply


Thread Tools


Java and ANSI - Similar Threads
Thread Thread Starter Forum Replies Last Post
ANSI logon screen for Circle-based mud Lazari MUD Coding 4 06-03-2006 11:22 AM
A Java Problem Almondine War MUD Coding 6 10-21-2004 11:17 PM
Ansi art, or whatever its called Enzo Tavern of the Blue Hand 3 08-21-2004 12:12 PM
ANSI prompts at initial login: good or bad? erdos Advanced MUD Concepts 9 01-10-2004 08:11 PM
ANSI Colors in muds markizs Tavern of the Blue Hand 9 04-10-2003 02:09 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 11:29 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022