mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#153101 11/07/06 11:26 AM
Joined: Jul 2006
Posts: 3
I
iNSeKT Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
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 blush)

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 smile

#153102 11/07/06 02:46 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Code:
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
#153103 11/07/06 04:31 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
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)) }

#153104 11/07/06 04:47 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
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
#153105 11/07/06 05:08 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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

#153106 11/07/06 05:43 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
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.
Code:
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
#153107 11/07/06 09:49 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
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 smile

#153108 11/07/06 10:11 PM
Joined: Jul 2006
Posts: 3
I
iNSeKT Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Jul 2006
Posts: 3
shocked

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... laugh

#153109 11/07/06 10:56 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
what if someone s color scheme is different?

#153110 11/07/06 11:04 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
ahh i thought you meant every letter too! lol

how about
Code:
 
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
#153111 12/07/06 12:51 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
then they wont see it the same! wink

btk


billythekid
#153112 12/07/06 01:04 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
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

#153113 12/07/06 03:10 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
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
#153114 12/07/06 03:36 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
and this helps others in the channel see it .... how exactly

#153115 12/07/06 05:16 AM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
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.

Code:
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)

#153116 12/07/06 05:27 AM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
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
#153117 12/07/06 10:44 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
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
#153118 12/07/06 12:20 PM
Joined: Jul 2006
Posts: 3
I
iNSeKT Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Jul 2006
Posts: 3
WOW laugh laugh laugh

That was just what i wanted!!! Thanks a lot!!!

#153119 12/07/06 12:54 PM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
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.

#153120 12/07/06 01:40 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
ah of course lol shoulda known that :tongue:


$maybe
Page 1 of 2 1 2

Link Copied to Clipboard