mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2009
Posts: 48
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.
Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Jun 2009
Posts: 48
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

Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Jun 2009
Posts: 48
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 ^^;

Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Jan 2003
Posts: 1,063
D
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!

Link Copied to Clipboard