mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Hi guys,

I am in a news channel. The format of the text in this channel is like this

<CNN> ......
<BBC> ......
<FOX> &#8230;..

What I would like to do is to change the color of each line according to the source. For instance, CNN will have a red color whereas BBC will have Blue. Can you help me? Can I mix the colors so the source (i.e. <CNN>) will have a color different than the text??

Regards,

P.S. I am only a regular user, so I do not have access to the bot

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Try looking at your address book (Alt B), and select the colors tab. You can select colors for individual nicks and channel modes.

Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Thnx for the reply...

The news sources (i.e. CNN, FOX, ..etc) are not nicks, It is like this

[NICK] <BBC> ...............
[NICK] <CNN> ...............

So I am not sure if what you said is till valid. Can you explain more please?

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: pif___
Hi guys,

I am in a news channel. The format of the text in this channel is like this

<CNN> ......
<BBC> ......
<FOX> &#8230;..

What I would like to do is to change the color of each line according to the source. For instance, CNN will have a red color whereas BBC will have Blue. Can you help me? Can I mix the colors so the source (i.e. <CNN>) will have a color different than the text??

Regards,

P.S. I am only a regular user, so I do not have access to the bot


Code:
on ^*:TEXT:*:#:{
if (CNN isin $1-) { echo # $replace($1-,CNN,4CNN) | halt }
}




Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
You can't use the Address book's 'Colors' tab, but you can use the Options/IRC/Highlight stuff.

This can match text strings, and highlights (or plays a sound or ... etc.) based on the plain text string you've entered.

For example, I highlight '*bek*' to higlight lines with a partial-match of my nick in it.

Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Originally Posted By: Lpfix5

Code:
on ^*:TEXT:*:#:{
if (CNN isin $1-) { echo # $replace($1-,CNN, 4CNN ) | halt }
}




Thnx smile The script does work, is it possible to modify it to do the following

<NICK_1> |CNN| news news news news

What I want to do is this, if the text is from a certain nick (i.e. NICK_1), "|CNN|" will have a color, and "news news news news" will have a different color. If the text is from a different nick -other than NICK_1- it will be ignored. Currently I am using a "Digital Color Nick v3.5" to change the nicks' colors; it will be good if the script also changes the nicks color also.

It is something like this:

Take the input, verify the nick, if OK, change the colors, otherwise skip.

I appreciate all the help.

Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Originally Posted By: Bekar
You can't use the Address book's 'Colors' tab, but you can use the Options/IRC/Highlight stuff.

This can match text strings, and highlights (or plays a sound or ... etc.) based on the plain text string you've entered.

For example, I highlight '*bek*' to higlight lines with a partial-match of my nick in it.


It is not something that I write, it is something that the others write.

Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Originally Posted By: pif___
It is not something that I write, it is something that the others write.

That's what the Highlight stuff does. It doesn't highlight your own messages, only those sent by other users.

Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Originally Posted By: Bekar
Originally Posted By: pif___
It is not something that I write, it is something that the others write.

That's what the Highlight stuff does. It doesn't highlight your own messages, only those sent by other users.


sorry i did not know that...

*EDIT*
I just tested it, it is good and simple, but the only problem is that you will have a single color for the whole line.

Last edited by pif___; 04/08/07 01:54 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If you don't like how the highlighting works, then just use the script that was given to you. If you want the CNN part to have |'s around it, just make the script that way...

Code:
on ^*:TEXT:*:#:{
  if (CNN isin $1) { echo $chan $+(03<,$nick,>) 04|CNN|05 $2- | halt }
  elseif (MSN isin $1) { echo $chan $+(03<,$nick,>) 04|MSN|05 $2- | halt }
}


And so on. If you want the |'s to have color, just move the color control codes outside of the |'s rather than inside them.

Note that this was changed to trigger only when the network is in the first "word" (i.e. <CNN> news here)... not when it appears anywhere else in the text. It will also only color the first word. In my opinion, that will look better. Note that it will not change any other colors of text in the news message if there are colors in it.

*EDITED* Changed the colors to use 3 colors as requested. Just change the numbers to suit your needs.

Last edited by Riamus2; 04/08/07 03:07 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Riamus: Can you update your code so it does the following if it is no too much trouble, otherwise just ignore my request

<NICK_1> |CNN| news news news news

<NICK_1> === color1
|CNN| === color2
news news news news === color3

thnx in advance





Last edited by pif___; 04/08/07 02:55 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Edited... see above.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Thnx....

Can I do something like this

Code:
on ^*:TEXT:*:#:{
  if ($nick == NICK_1) {
    if (CNN isin $1) { echo $chan $+(03<,$nick,>) 04|CNN|05 $2- | halt }
    elseif (MSN isin $1) { echo $chan $+(03<,$nick,>) 04|MSN|05 $2- | halt }
} }


GR8...Thnx everyone for the help...this code now modifies the posts made by NICK_1 only. I will try to modify it further. Something I noticed is that the spaces between the braces and after the if statemnts are mandatory!...thnx to all of you especially Riamus2 and Lpfix5.

Last edited by pif___; 04/08/07 04:11 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, spacing is required. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: pif___
Thnx....

Can I do something like this

Code:
on ^*:TEXT:*:#:{
  if ($nick == NICK_1) {
    if (CNN isin $1) { echo $chan $+(03<,$nick,>) 04|CNN|05 $2- | halt }
    elseif (MSN isin $1) { echo $chan $+(03<,$nick,>) 04|MSN|05 $2- | halt }
} }


GR8...Thnx everyone for the help...this code now modifies the posts made by NICK_1 only. I will try to modify it further. Something I noticed is that the spaces between the braces and after the if statemnts are mandatory!...thnx to all of you especially Riamus2 and Lpfix5.


Code:
on ^*:TEXT:*:#:{
if ($nick == NICK_1) && (MSN isin $1) || (CNN isin $1) { echo # $+(03<,$nick,>) $replace($1-,$1,$+(4|,$1,|5)) | halt }
}


&& means like saying AND/Bitwise Comparison and || means saying Or so in the script we check if $nick Matches and if MSN or CNN is in


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Close, but you didn't remove the <>'s. Besides, if they are one, then you can't make different colors for each kind of news item, which was the original request.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: Riamus2
Close, but you didn't remove the <>'s. Besides, if they are one, then you can't make different colors for each kind of news item, which was the original request.


What are you talking about? Im copying from PIF's last post has I quoted it and made it smaller, I didnt read anything else, + making new colors within one line of code for every word is easier then saying pie.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
Thnx guys, i appreciate it a lot.

I am trying to add spaces after one of the variables
Code:
echo $chan [ $chr(32) $1 $chr(32) $chr(32) ]

does not work...any thoughts?

Something else I noticed
Code:
$+(1,[ 06,$2 1,])

produce the output w/o extra spaces, which is good

Code:
1 [ 06 $2 1 ]

This one adds a lot of spaces, which is in my case bad! I am not sure why is that and what is the difference.

Last edited by pif___; 05/08/07 11:22 AM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
1. Try using $chr(160) I could be wrong but I think that only works with certain fonts, but I don't have the time to check through them all.

2. The $+ identifier is the difference maker.

From the help file:

$+(n1,...,nN)

Combines all of the specified parameters, the same as using $+ in between each item.

So without it you're gonna get the spaces.

Joined: Aug 2007
Posts: 11
P
pif___ Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2007
Posts: 11
$chr(160) gave me the wrong ascii, did you mean 255 instead?

thnx for that hint.


*EDIT*
255 is wrong also...

Last edited by pif___; 05/08/07 12:44 PM.
Page 1 of 2 1 2

Link Copied to Clipboard