mIRC Home    About    Download    Register    News    Help

Print Thread
#160133 23/09/06 07:05 AM
Joined: Aug 2006
Posts: 23
W
wulf Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Aug 2006
Posts: 23
is there a remote for catching when a line of text is highlighted? say something like 'on 1:highlight:etc..' ?

#160134 23/09/06 08:54 AM
Joined: May 2003
Posts: 41
D
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
$cb


Highlight some text then type
Code:
//echo - $cb



Not an on highlight, but it's a start.


If At First You Don't Succeed, Ask Someone For Help......
#160135 23/09/06 09:05 AM
Joined: May 2003
Posts: 41
D
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
also look into these


$cb(N)
Returns $crlf delimited lines from text currently in the clipboard.


Properties: len

$cb(0) returns the number of lines in the clipboard
$cb(0).len return the total length of all lines in the clipboard
$cb(1) returns line 1 from the clipboard
$cb(1).len returns the length of line 1


If At First You Don't Succeed, Ask Someone For Help......
#160136 23/09/06 09:37 AM
Joined: Aug 2006
Posts: 23
W
wulf Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Aug 2006
Posts: 23
Guess I should have been more specific. What i ment was, when you set a text highlight filter in mirc options (Options>IRC>Highlight) is there a way to catch it via remotes when it triggered and what caused it to trigger?

#160137 23/09/06 10:31 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
$chr(22) is your key bud...

Code:
on *:TEXT:*:#:{
if ($chr(22) isin $1-) { echo -a Highlighted word has been detected in $+($nick,s) phrase. }
}


you can do a simple gettok to get the word but this is just to show quick and simply how you capture a highlight.

BTW here is a method sure proibably can look better but what i did for u is create a small script you can execute by typing /rodr

this will open a @rodra window and list the chars from 1 to 200 what they are, notice youll see a A appear beside some chars well thats me because it shows you what some chars do for in your example CHR 22 creates a highlight so by doing a IF statement on TEXT i can capture CHR 22


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160138 23/09/06 11:16 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
If the window is not active you could check $window().sbcolor in an on text event. If it returns highlight, then it's changed the colour you've set in the options dialog for highlighted text.

#160139 23/09/06 12:03 PM
Joined: Aug 2006
Posts: 23
W
wulf Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Aug 2006
Posts: 23
Tried the code, didn't work.

As for hixxy, that would work, but its possible the window that is active is the one with text being highlighted.

Looks like this is something a I could prolly submit as a featuer requestion.

on 1:highlight: { }
$1- would return the full text
$nick - would return person that said the line that caused the highlight
$chan - would return channel highlight happened in
$highlighttext - would return the specific match that caused the highlight.

I have several highlights set, ones for my nick ($me) ones for urls, was trying to make a script to display all highlights while i am gone in a seperate @window so i can easily find them instead of browsing into the buffer.

#160140 23/09/06 07:31 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
the only reason why the on text wouldnt be working is because you may have a conflict on text event trust me the code works. to detect highlight because you can use CTRL + R texthere to highlight manually your text the on TEXT event would capture that if someone else said it but if you highlight your own text you would have to make ON input event.


on *:TEXT:*:#:{

if ($chr(22) isin $1-) { echo -a Highlighted word has been detected in $+($nick,s) phrase. }

}

was the code to use i forgot to include the alias rodr

but here it is

Code:
alias rodr {
  var %x = 1
  window -dh @rodra -1 -1 150 500
  while (%x <= 200) {
    aline 8 @rodra $+(CHR,%x) = $chr(%x) A
    inc %x
  }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#160141 23/09/06 08:12 PM
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
I think what you want is the $highlight() identier
/help $highlight

An example
Code:
on *:text:*:*:{
  if $highlight($nick $1-)  {
    if !$window(@highlights) { window -n @highlights }
    linesep @highlights
    echo @highlights $timestamp $iif(#,$+($nick,:,#),$+($nick,:private)) $1-
    echo @highlights Matched: $highlight($nick $1-).text
    linesep @highlights
  }
}


Link Copied to Clipboard