|
Joined: Jul 2006
Posts: 3
Self-satisified door
|
OP
Self-satisified door
Joined: Jul 2006
Posts: 3 |
Hi everyone, this is my first post here. Though i've used the search tool, i (think) have not foud what i was looking for (the "(think)" is because i'm rather new to this scripting thing, and maybe i simply didn't understand what i found ) So, basically, what i want, is an alias that allows me to say in a channel a text, e.g. "BLAH" but using random colors every time. I mean, typing /blah will say in current channel "BLAH" in random colors (both text and background) Can somebody help me with this? Thanks in advance
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
alias blah {
var %r = $regsubex(hello you there,/(\w)/g,$(, $!+ $!r(0,15) $!+ $iif($r(1,10) // 2,$!+ $!chr(44) $!+ $!r(0,15)) $!+ \t))
if (!$isid) msg $1 %r
else return %r
}
usage: /blah #myroom sometext goes here or /msg #myroom $blah(sometext goes here)
Last edited by Mpdreamz; 11/07/06 02:47 PM.
$maybe
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
using Mpdreamz code.
; ;usage /blah <channel/nick> <message> ;or ;usage $blah(<message>) ; alias blah { $iif($isid,return,msg $1) $regsubex($iif($isid,$1-,$2-),/(\w)/g,$(, $!+ $!r(0,15) $!+ $iif($r(1,10) // 2,$!+ $!chr(44) $!+ $!r(0,15)) $!+ \t)) }
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
whoops copy paste the wrong one :tongue: Thats what you get for visiting forums in your boss's time :tongue:
$maybe
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I really hate to say this, It didn't work
just got the error message of msg insufficient parameters
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
//echo -a $blah(Cool cool) it does work, make sure you have 6.17. Also if your refering to my code i pasted the wrong one :tongue: Improved it alitle bit.
alias blah $iif($isid,return,msg $1) $regsubex($iif($isid,$1-,$2-),/(\S)/g,$+(,$r(0,15),$iif($r(1,10) // 2,$+($chr(44),$r(0,15))),\t))
code tag mocks it up so here it is in one line: alias blah $iif($isid,return,msg $1) $regsubex($iif($isid,$1-,$2-),/(\S)/g,$+(,$r(0,15),$iif($r(1,10) // 2,$+($chr(44),$r(0,15))),\t))
Last edited by Mpdreamz; 11/07/06 07:32 PM.
$maybe
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
must have been something in the msg board, having pasted the one Outside the code tags , it then worked one thng i did note is there is noting coded to stop it from coloring the text and "space" the same color (ie: 01,01) and in fact no sorting of bright colors and dark colors to make sure you can actually read it (this being more important on 6.17 that has the highlight issue that is expected to be improved in the future bugfix) I dont know if the regext/regsub is capable of sorting letters to all bright/warm colors and background/space colors to dark colors or not to maintain readability. this can of course be done with tokens easily enough, with more code (does size matter in this case?) one day i will try to wrap my head around regex, one day... someday
|
|
|
|
Joined: Jul 2006
Posts: 3
Self-satisified door
|
OP
Self-satisified door
Joined: Jul 2006
Posts: 3 |
I wasn't really expecting to get that many answers in my first post... i appreciate :tongue: I'm going to use the codes... Last one didn't work :S (maybe i mis-pasted it)... But actually, what i was looking for, was something that when i type /haha says "HAHAHAHAHAHAHA" in random background and text colors (for all the "HAHAHAHAHAHAHA", not every letter in different colors) in active window... Put in other words, i basically don't know how to make a particular text go in random colors... Again, thanks...
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
what if someone s color scheme is different?
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
ahh i thought you meant every letter too! lol how about
alias blah {
var %i $rand(0,15)
var %o $rand(0,15)
if %i == %o { inc %i }
say $+ %i $+ , $+ %o $+ $1-
} usage /blah this is some text btk
Last edited by billythekid; 11/07/06 11:09 PM.
billythekid
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
then they wont see it the same! btk
billythekid
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
what if someone s color scheme is different? I don't know what the color sceme would do to anything. if the letter is colored 3,10 it would be hard to read. several other color combinations wil also be very hard to read. has nothing to do with the screen color being white black grey or with a photo background, thats all I was saying
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
yeah but if someone has colour 3 set to a pink colour and colour 10 set to a similar hue they would have trouble seeing it. you can change your colours in teh mirc colour dialog.(the crayons)
not their mirc theme per sé (backgrounds n stuff) but their actual colours..
thats what he was getting at
btk
billythekid
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
and this helps others in the channel see it .... how exactly
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Here's another method. It has advantages over the others for a couple reasons: 1. It uses double digit colors. 2. It's not possible for both the foreground and background to end up as the same color. alias rcmsg {
var %rc = $base($r(0,15),10,10,2), %nums = 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
$iif($isid,return,msg $active) $+(,%rc,$chr(44),$gettok($remtok(%nums,%rc,1,32),$r(1,15),32),$1-,)
} Useage /rcmsg <text> (Works in query and channel windows) //msg <#Channel or Nick> $rcmsg(text)
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
it doesnt help them see it, it just reminds you that although it might look yellow on black to you it could be white on white to someone else...
btk
billythekid
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
1.Double diggits are an advantage for what reason ? 2. As mentioned before colour code 03 and 04 can very well be the same colour eventhough theyre not the same colourcode. Without lengthy solutions involving picture windows and $getdot (slow) this is unsolveable.
$maybe
|
|
|
|
Joined: Jul 2006
Posts: 3
Self-satisified door
|
OP
Self-satisified door
Joined: Jul 2006
Posts: 3 |
WOW That was just what i wanted!!! Thanks a lot!!!
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Well, it doesn't matter so much with the foreground. The background should be double though since the text could begin with a number. Say the background is randomly chosen as white (0) and the text is "123". The background then effectively becomes black (01) and the output is "23". I'm aware the colors could be the same, but I don't think it's something to worry about as that is the fault of the receiver or theme author. I rather just assume they use the default colors.
|
|
|
|
Joined: Apr 2004
Posts: 759
Hoopy frood
|
Hoopy frood
Joined: Apr 2004
Posts: 759 |
ah of course lol shoulda known that :tongue:
$maybe
|
|
|
|
|