mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
There's $highlight(N/Text).nicks returning $true/$false if a highlight was set to "match nicknames".
Is there a corresponding property for "match messages", to determine which of the three possible options (match nick/message/both) was set? I didn't find it in the helpfile, or by guessing.

Checking text is ok by something like:
Code:
if ($highlight($nick) && $highlight($nick).nicks) { -- mach nicks -- }
if ($highlight($1-) && ($1- !isnum)) { -- match message -- }

But checking the Nth highlight:
Code:
if ($highlight(N).nicks) { -- match nicks -- }
if ($highlight($highlight(N))) { -- match message -- }

...won't work if the highlight is a regex or identifier

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'd call this either a bug, unintentional overlook, or a decent addition for the feature suggestions section.

Joined: Jul 2006
Posts: 3,945
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,945
Why not read the information from the mirc ini file, under the Highlight section ?
Quote:
n0=0,1,1,1,"","","$me",0,0,0,3 < Both
n0=0,1,0,1,"","","$me",0,0,0,3 < Message
n0=0,1,2,1,"","","$me",0,0,0,3 < Nickname




#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I do, but wondered - if there's the one property shouldn't exist the other one as well? As other properties aren't in the helpfile [yet], like .tip = tip delay, maybe it exists and we don't know of it laugh

Here's the awkward thing I use for the moment:
Code:
; $hltarget(N) - returns "match on:" definition of Nth highlight: "message", "nick", or "both"
alias hltarget { return $replace($gettok($readini($mircini,highlight,$+(n,$calc($int($$1) -1))),3,44),0,message,1,both,2,nick) }

Joined: Jul 2006
Posts: 3,945
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,945
Quote:
maybe it exists and we don't know of it
Maybe, but I don't think so.
You could add this as a suggestion, two propriety .message and .both, or something like .method, that would return the used method (nick, message or both).


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard