mIRC Home    About    Download    Register    News    Help

Print Thread
Network specific highlighting #221899 31/05/10 12:37 PM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
Network specific highlighting would be a very useful feature, I keep getting highlights across networks for things that aren't specific to that network. Would be a great feature ^^

Re: Network specific highlighting [Re: StrawberryKitty] #221911 31/05/10 07:09 PM
Joined: Dec 2002
Posts: 344
D
drum Offline
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
This could be a useful feature if it was integrated into the UI. However, there is a workaround you can use to get this behavior in the meantime.

Let's say you want to highlight the word "strawberry" when it appears on any channel on EFnet, but not any other network. You could do that by first creating a custom alias in the remotes section like this:

Code:
alias hl-strawberry { if ($network == EFnet) { return strawberry } }


Then, you would set the highlight text to:

Code:
$hl-strawberry


This would give the desired result.

Another common example might be if you want to match when anyone uses whatever nickname you are currently using, which can be done more simply by just setting the highlight text to

Code:
$me

Re: Network specific highlighting [Re: drum] #222043 04/06/10 06:51 AM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
Hum thanks for the work around I'd still like if it was added to the GUI :3

Re: Network specific highlighting [Re: StrawberryKitty] #222044 04/06/10 08:45 AM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
Mew unfortunatly I can't seem to get it working with wild cards...

I tried this:

Code:
alias hl-straw__ {
  if ($istok(fake║notreal║boo,$network,186)) {
    return Straw *
  }
}


then added "$hl-straw__" to my highlights and typing "straw mew" did not set off the highlight. I then tried this:

Code:
alias hl-straw {
  if ($istok(fake║notreal║boo,$network,186)) {
    return Straw
  }
}


and added "$hl-straw *" same problem it doesn't trigger..

I'm guessing the wild card loses it's special quality when return is used.. Any ideas? *Hopes for a GUI version* ^^;

Re: Network specific highlighting [Re: StrawberryKitty] #222051 04/06/10 05:00 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Wilcards are not necessary there. Adding network support to the GUI won't change that fact. just use $hl-straw and that's it, it will match "Straw" anywhere in the line.

As a sidenote, why on earth are you using $chr(186) (a NON-ASCII character) as a token delimiter in your hardcoded data? Use a sane value, like a space.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Network specific highlighting [Re: StrawberryKitty] #222052 04/06/10 06:50 PM
Joined: Dec 2002
Posts: 344
D
drum Offline
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
I also can't get wildcards to work when using this method. To be honest, I'm not even sure if using identifiers with the highlight feature is intended behavior -- I just know that it works, at least in a limited capacity.

Sorry but I don't see a workaround for you at this time.

Re: Network specific highlighting [Re: argv0] #222053 04/06/10 06:55 PM
Joined: Dec 2002
Posts: 344
D
drum Offline
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
She may want the wildcards so that she can enforce spaces around the matchtext though. Normally the highlight feature does support wildcards if they are used. Perhaps a regex version would work.

Re: Network specific highlighting [Re: drum] #222074 05/06/10 08:40 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
mirc's inbuilt highlight feature supports regex. She may be able to use the $highlight() identifier with an alias, $network = to return the match she wants.

Re: Network specific highlighting [Re: Tomao] #222076 05/06/10 10:28 AM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
That'd be great if I knew how I guess ^^;