mIRC Home    About    Download    Register    News    Help

Print Thread
Highlight Event or $highlighted Identifier #218616 20/02/10 07:02 AM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
It'd be nice if we could get either a $highlighted identifier or an on HIGHLIGHT event.

Quote:
$highlight

$true if event was highlighted
$false if event was not highlighted


Quote:
<level>:HIGHLIGHT:<matchtext>:<*><?><#[,#]>:<commands>

Works the same way as on TEXT but only if the event was highlighted


I really think this would be useful. Thanks ^^

Last edited by StrawberryKitty; 20/02/10 07:11 AM.
Re: Highlight Event or $highlighted Identifier [Re: StrawberryKitty] #218617 20/02/10 07:42 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$highlight would be much better than an extra event.

Of course there's already an identifier named $highlight, though poorly named..


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Highlight Event or $highlighted Identifier [Re: argv0] #218618 20/02/10 07:48 AM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
Problem being it only returns information about highlight properties and not if highlight occured in an event. It's nothing like what I'm requesting above as far as I know.

This is what the current $highlight identifier does:

Quote:
$highlight

Returns $true if highlighting is turned on in the Highlight dialog, otherwise returns $false.


$highlight(N/text)

Returns the Nth line in the highlight listbox, or if text is specified, returns the properties for the highlight line that matches text.



Properties: text, color, sound, flash, message, nicks, regex, cs

Re: Highlight Event or $highlighted Identifier [Re: StrawberryKitty] #218629 20/02/10 08:51 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$highlight($1-) should do what you want. If it doesn't match any highlight entries it will return $null, otherwise you can assume a match was made.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Highlight Event or $highlighted Identifier [Re: argv0] #218635 20/02/10 11:11 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
By the way, it would be nice if something was done about the inherent limitation of such a syntax (problematic when $1- from the event happens to be a number), essentially the same issue as with $timer().


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Highlight Event or $highlighted Identifier [Re: argv0] #218636 20/02/10 11:56 PM
Joined: Jun 2009
Posts: 48
StrawberryKitty Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Jun 2009
Posts: 48
And this so belonged in the help section, sorry ^^; Thanks again argv0.

Maybe we can get querty said fixed instead, cause I actually ran into that problem with cline, people had nicks as numbers, so I just eventually fed it the position number on the list. But yeah was a confusing thing ^^;

Re: Highlight Event or $highlighted Identifier [Re: StrawberryKitty] #218638 21/02/10 12:22 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
The issue qwerty described should only occur if the entire line is a single number,

For instance

$highlight(1 2 3) will be treated as text
similarly, $highlight(mynick5) will also be text

The only issue would be that $highlight(1) will not. however, it's rare that you have a line $1- that is entirely numeric (and will match a highlight rule). This was probably not your issue.



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Highlight Event or $highlighted Identifier [Re: argv0] #218667 21/02/10 07:20 PM
Joined: Jan 2003
Posts: 1,063
D
Doqnach Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
I've actually ran into this problem a few times where the line consisted out of just a number which caused my script to tag the line as highlighted.

so I always do something in the line of "if $1 !isnum && $highlight($1-)" instead of only the $highlight check.


If it ain't broken, don't fix it!