mIRC Home    About    Download    Register    News    Help

Print Thread
rookie looking for scripting help #270473 03/07/22 03:41 PM
Joined: Jul 2022
Posts: 2
C
caeden19821118 Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
C
Joined: Jul 2022
Posts: 2
hello,

I am a noob, is there a way to output the message i type to others, so they will be able to see my message in my favourite color and pattern?

My intended output looks something like this: [ my message ] , the [ ] symbols appear in red color and bold, and "my message" appear in grey color, can this be permanent?

thank you so much in advance, may god bless all of you!

Re: rookie looking for scripting help [Re: caeden19821118] #270476 03/07/22 08:12 PM
Joined: Jan 2004
Posts: 1,796
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,796
It's possible, but a better question is whether everyone else in channel wants you to do this. From your choice of colors, because depending on the shade of gray you're talking about, it's going to be either hard to see against a white background, or hard to see against black. So, the only way to make sure your text looks fine for everyone else is to send the background color too, which will annoy everyone who's using the opposite color of background. Also, you have 2 choices for which color codes to use. The color index 0-15 is supported by more not-mirc clients, but they can also be configured to be a different red/green/blue color shade, so it's not guaranteed that everyone else's color index 4 looks red to them. So, on the other hand, you can send colors in the range 16-98 range which can't be changed by other people, but these colors are not supported by all not-mirc clients either, which results in them either ignoring the color index or showing it as black-on-black.

Here's an example of doing it where only yourself can see it:

//echo -a $chr(3) $+ 52[ $+ $chr(3) $+ 96message goes here $+ $chr(3) $+ 52]

It wasn't clear which gray you wanted, so the 96 might need to be changed slightly. Some people may find gray to have insufficient contrast against red, as with the default color set this is one of the hardest to read:

//echo -a $chr(3) $+ 4,14 test message is hard to read
//echo -a $chr(3) $+ 14,4 test message is hard to read

If you still want to do it, and have it be done automatic, you'd need to do something like:

edit: added 3 lines so it won't send a /command to channel and can be overridden by pressing ctrl+enter, and won't mess with things being pasted

Code
on *:INPUT:*:{
if (/* iswm $1) return
if ($inpaste) return
if ($ctrlenter) return
  if (!$istok(channel query,$window($active).type,32)) return
  msg $active $chr(3) $+ 52[ $+ $chr(3) $+ 96 $+ $1- $+ $chr(3) $+ 52]
  halt
}


if you do it automatically, you should probably have a way of either whitelisting or blacklisting destinations, so it only goes to some places and not others. Because I can guarantee that this behavior will get you banned from some channels.

Re: rookie looking for scripting help [Re: maroon] #270483 04/07/22 02:41 PM
Joined: Jul 2022
Posts: 2
C
caeden19821118 Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
C
Joined: Jul 2022
Posts: 2
thank you so much for your input, I would like to send a token of appreciation to u(private message me please), deeply appreciated for your kind help!

Re: rookie looking for scripting help [Re: maroon] #270484 04/07/22 04:52 PM
Joined: Jan 2004
Posts: 1,796
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,796
For making something be bold, it gets toggled on/off using $chr(2) the same way that html uses <b> and <b/> toggles. It doesn't matter whether you put the bold before or after the color code. So the formatting line looks more like

msg $active $chr(2) $+ $chr(3) $+ 52[ $+ $chr(2) $+ $chr(3) $+ 96 $+ $1- $+ $chr(2) $+ $chr(3) $+ 52] $+ $chr(2)

Note that the trailing chr2 isn't needed since it's already at the end of the line.
Also note that if you change the 96 to a single digit number like 3, you should make it be 03 so that if the message begins with a number, it wouldn't grab the 1st digit of the display as if it's part of the color code.