ANSI Color & MOO

36 views
Skip to first unread message

Chris Hogan

unread,
May 25, 2015, 7:22:16 PM5/25/15
to MOO-...@googlegroups.com
Hi!

I'm starting a new MOO -- and I need ANSI color to work on it. 

I just got the server portion up, and it works with minimal.db, but not the RPG Core I was going to use.

I have no love for the RPG Core. I was just told that RPG Core has working ANSI built in.

Does anyone on here know, a step by step way or means that I can get ANSI to work? 

Thank you!

Michael Munson

unread,
May 25, 2015, 10:38:15 PM5/25/15
to Chris Hogan, MOO-...@googlegroups.com
I created an ansi color (256 color with options to fallback to regular ansi color if unsupported) system on the stunt variant of the MOO server. It looks something like depicted in the attachment below. The hardest part to code an ANSI system is to get the escape character in the MOO database, and this can be done pretty easily nowadays. The simplest method is probably using a perl script (or similar) to do a search and replace operation on a specific character string like "<----ESCAPE CHAR HERE---->" and then create a property with a string value that matches that.

--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+u...@googlegroups.com.
To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at http://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.

ansi.png

Bubba Krunch

unread,
Jun 2, 2015, 10:41:56 AM6/2/15
to MOO-...@googlegroups.com

I would also suggest using hellcore.db from:

http://hellmoo.org/wiki/index.php/HellCore

Built-In overheap ASCII map and a good ANSI setup..
plus a thousand extra generics for you to play with..

you really can't go wrong.. great for beginners and new RPG MOO's

Ross Cook

unread,
Jun 28, 2015, 4:45:10 PM6/28/15
to MOO-...@googlegroups.com
Dark Owl's ANSI colour implementation has been around for-ever. Does too much for my tastes, but you should pretty much be able to roll it straight into your MOO. As Michael Munson mentioned, you'll need to find a way to get the escape character set (personally I just roll in the ANSI solution, set the escape prop to a placeholder value, dump the db, open it in a suitable plaintext editor, search/replace the placeholder with the escape character and restart the MOO).

Quick search turned up this for DarkOwl's ANSI 2.1:

http://www.fringenet.net/MOO/ANSI-2.1.moo.txt

Matthew Duhan

unread,
Jul 4, 2015, 4:15:00 PM7/4/15
to Ross Cook, MOO Talk
Oh wow, I'm glad that my site is still useful!


There's also version 2.2 which was updated by Remco de Groot.

--

Tim van Dijen

unread,
Oct 24, 2016, 2:57:21 PM10/24/16
to MOO-...@googlegroups.com

Hey Michael,

I ran into this old post and I was wondering how you've managed to get all those colours!
Could you please elaborate a bit more on how it was implemented??

- Tim

Op 26-5-2015 om 04:38 schreef Michael Munson:

Michael Munson

unread,
Oct 31, 2016, 5:25:55 PM10/31/16
to Tim van Dijen, MOO-...@googlegroups.com
I implemented a simple 256 color ANSI escape system.

Basically, a version of "red" in a traditional ansi system is: e[31m where e is the terminal escape character.

One tone of red using 256 colors would be: e[38;5;196m

Basically, just change or augment the way your ansi system sends out codes. I have users specify colors by hex code (like HTML) and then internally convert the hex into RGB and use a distance algorithim to find the closest of the 256 colors to the one the user specified.


On Mon, Oct 24, 2016 at 12:57 PM, Tim van Dijen <tvd...@gmail.com> wrote:

Hey Michael,

I ran into this old post and I was wondering how you've managed to get all those colours!
Could you please elaborate a bit more on how it was implemented??

- Tim

Op 26-5-2015 om 04:38 schreef Michael Munson:
I created an ansi color (256 color with options to fallback to regular ansi color if unsupported) system on the stunt variant of the MOO server. It looks something like depicted in the attachment below. The hardest part to code an ANSI system is to get the escape character in the MOO database, and this can be done pretty easily nowadays. The simplest method is probably using a perl script (or similar) to do a search and replace operation on a specific character string like "<----ESCAPE CHAR HERE---->" and then create a property with a string value that matches that.
On Mon, May 25, 2015 at 2:09 PM, Chris Hogan <goog34...@gmail.com> wrote:
Hi!

I'm starting a new MOO -- and I need ANSI color to work on it. 

I just got the server portion up, and it works with minimal.db, but not the RPG Core I was going to use.

I have no love for the RPG Core. I was just told that RPG Core has working ANSI built in.

Does anyone on here know, a step by step way or means that I can get ANSI to work? 

Thank you!
--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+unsubscribe@googlegroups.com.

To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at http://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+unsubscribe@googlegroups.com.

To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at http://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+unsubscribe@googlegroups.com.

To post to this group, send email to MOO-...@googlegroups.com.

Michael Munson

unread,
Nov 1, 2016, 12:25:52 PM11/1/16
to Just Johnny, Tim van Dijen, MOO-...@googlegroups.com
It's a standard terminal code so it is implemented in some clients. BeipMU for Windows, Atlantis for Mac OS X to give an example.

On Tue, Nov 1, 2016 at 10:00 AM, Just Johnny <joh...@sindome.org> wrote:
How does the client end handle this format e[38;5;196m?

Just Johnny

unread,
Nov 1, 2016, 1:53:32 PM11/1/16
to Michael Munson, Tim van Dijen, MOO-...@googlegroups.com
How does the client end handle this format e[38;5;196m?
On Mon, Oct 31, 2016 at 2:25 PM, Michael Munson <michael....@gmail.com> wrote:

the Prometheus MOO

unread,
Nov 21, 2016, 11:03:14 AM11/21/16
to MOO-...@googlegroups.com
Greetings!

I am using the latest git pull of StuntMaster from
https://github.com/toddsundsted/stunt.git
Everything else seems to work fine, except that with lists, I got this
error (and the MOO shut down after):
[con@moo old]$ tail old.log.old
Nov 21 09:40:10: CHECKPOINTING: Done writing 83920 objects ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 83920 objects ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 83920 objects ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 83920 objects ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 83920 objects ...
Nov 21 09:40:10: CHECKPOINTING: Writing 5229 MOO verb programs ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 5000 verb programs ...
Nov 21 09:40:10: CHECKPOINTING: Done writing 5229 verb programs ...
Nov 21 09:40:11: CHECKPOINTING on old.db.new.#47# finished
moo: list.cc:60: Var new_list(int): Assertion
`gc_get_color(emptylist.v.list) ==
GC_GREEN' failed.
[con@moo old]$

This happens with garbage colleciton enabled. I know from experience
that if it's disabled, it throws a double free or corruption error.

Would anybody have any suggestions as in how to fix this?

Sincerely,

Con

Todd Sundsted

unread,
Nov 21, 2016, 12:28:32 PM11/21/16
to MOO Talk
Con,

I'd love to troubleshoot this, but there's not enough to go on. This specific failure could be happening as collateral damage caused by a memory access bug somewhere else. It could also be some interaction between the verb dumping code and the garbage collector. Or something else.

There are a couple ways to proceed. If you can run Stunt with valgrind, and send me the output, that might help point out the problem. Otherwise (and I hate to ask for this), an actual database that I can use to reproduce the problem would help.

What is the last commit in the git database you have? Also what OS are you running this on? Do this happen every time the server checkpoints?

Thanks!
Todd

the Prometheus MOO

unread,
Nov 21, 2016, 2:25:59 PM11/21/16
to MOO-...@googlegroups.com
Todd,

I am using Fedora Server 24. No, this does not happen every time the
server checkpoints. I am suspecting it is due to a certain task doing
something funky with lists, but what exactly, I am not sure.

As for the commits, git log lists the following (from my current Stunt
git directory):

commit fe68f1a4b19c8c413fdc20b9c51c7eb11355dad1
Merge: 335d433 d688799
Author: Todd Sundsted <to...@sundsted.com>
Date: Mon Nov 7 13:36:36 2016 -0500

Merge pull request #6 from tvdijen/patch-2

Provide process id in-MOO

commit d688799c638ac4457beb84e568306a19e3a87d92
Author: Tim van Dijen <tvd...@gmail.com>
Date: Mon Nov 7 18:56:21 2016 +0100

Update ProgrammersManual.texinfo

commit 4aaed42461a4ad28e13c4dbb05409d4e09ecbd44
Author: Tim van Dijen <tvd...@gmail.com>
Date: Mon Nov 7 18:33:44 2016 +0100

Provide process id in-MOO

commit 335d433d92d703b2fba804974e0c077374bc95bb
Author: Todd Sundsted <to...@sumall.com>
:

So I seem to have the latest one.

Todd Sundsted

unread,
Nov 21, 2016, 7:26:58 PM11/21/16
to MOO Talk
Ok, that is the latest version. I don't have enough information to troubleshoot right now. Anything else you have, including code that triggers it, would be ideal. Do you have the entire log and could you share that with me?

Todd
Reply all
Reply to author
Forward
0 new messages