Echo with color.
Re: Echo with color.
Works as expected... thanks! Hope to include it in the next release of Mudlet.
Re: Echo with color.
I'm working on merging the two functions for the next version of Mudlet so that you'll be able to use hex, decimal or name color tags.
Re: Echo with color.
Can we still optionally have the non-lrexlib dependent version available separately?
Lua already has pattern matching which is pretty similar to regular expressions anyway. That, and lrexlib wont work on my system and probably a couple of others
Lua already has pattern matching which is pretty similar to regular expressions anyway. That, and lrexlib wont work on my system and probably a couple of others
Re: Echo with color.
Good point... I still have yet to package lrexlib for ubuntu. This'll save a lot of work.
Re: Echo with color.
After some discussion, instead of merging them I'm creating separate functions, cecho for named colors, decho for decimal RGB, etc. I'll probably include versions using Lua's pattern matching that it will fall back on if lrexlib isn't loaded.
Re: Echo with color.
Looking at these functions, there's one I am really missing. A colorable prefix. I like to put prefixes before stuff and tend to add colors all over my system Is it at all possible to make a prefix and/or replace function for this as well?
Re: Echo with color.
It's possible. Prefix is defined in the LuaGlobal as
So we can either wait until denarii puts in the separately-named functions in luaglobal and make it work or overwrite in the client for now.
Code: Select all
-- Echo something before your line
function prefix(what)
moveCursor("main",0,getLineNumber());
insertText(what)
end
Re: Echo with color.
Oh, I have already seen that one, but not with a simple coloring syntax. Of course, I could hack the cecho functions to do everything backwards, but that's a bit of a roundaway way of doing it Can I put in ansi codes directly into echo/prefix text somehow? If so, I can just put it in a Lua table..
Re: Echo with color.
well, insertText = echo now afaik.
Re: Echo with color.
Well I can change the color echo functions to be able to prefix.. right now there is an arg to make them use inserttext, but you still have to position the cursor. And my changes won't be available until the next release.