I recently found this: http://rainbowcoding.com/how-to-create- ... avascript/
And I was wondering if you could make a Mudlet function to make text rainbow colored Is this possible?
Mudlet features and API requests
Re: Mudlet API requests
You can do this in lua. Just have a rainbowecho() function or whatever. The arguments would be your starting point/end point, and word. Then just divide your RGB spectrum defined by your gradient range by your word length.
Something like this (written in a browser, so it probably won't work and some functions might not exist as they're written . Also, change end to something that isn't a reserved name. You can do the same if you want to change the background too)
Something like this (written in a browser, so it probably won't work and some functions might not exist as they're written . Also, change end to something that isn't a reserved name. You can do the same if you want to change the background too)
Re: Mudlet API requests
o.O
I prefer to simplify basic things like this personally. How about:
I prefer to simplify basic things like this personally. How about:
?
Re: Mudlet API requests
Alternative method. (Just change the colours as required.)
Re: Mudlet API requests
Thanks Chris, and Phasma! Let's say I wanted to use string.format() on it, how would I go about getting this code to work:
rainbow("This is a %s", "Test")
Thanks!
Basically, what I'm trying to accomplish is something like this:
rainbow("This is a %s", "Test")
Thanks!
Re: Mudlet API requests
It really depends on what you want to format it to, although simply doing:
Will ensure it gets formatted as a string.
Re: Mudlet API requests
I also did this, and it seems to work nicely..
Re: Mudlet API requests
A function to check if the selection is underlined/bold/italic would be nice - useful in scripts.
-
- Posts: 11
- Joined: Mon Dec 17, 2012 2:58 am
Re: Mudlet API requests
How about extended IRC support? An idea we've been throwing around on a MUSH I play is how cool it would be to have a sub-channel for scripts, like in WoW, that talk to one another for various networking purposes. Implementing better IRC functionality in Mudlet would make this very possible.
Re: Mudlet API requests
Would be nice to have events for when installing packages either through the gui or the new function. One for erroring and another for success.
Also, the ability to give a profile argument to the connect and disconnect functions.
Also, the ability to give a profile argument to the connect and disconnect functions.