mIRC Home    About    Download    Register    News    Help

Print Thread
#204715 29/09/08 06:20 AM
Joined: Nov 2007
Posts: 50
Babel fish
OP Offline
Babel fish
Joined: Nov 2007
Posts: 50
I need a simple script that searches a channel or pm window for inputted text. So, that way I can find where my highlights were triggered without having to scroll up slowly enough to see the different colored text. Can anyone help me?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ctrl + F (aka Find)

RusselB #204918 05/10/08 11:01 PM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
russelb: that is not a valid solution in my oppinion. the OP requests a script/feature too look up any highlight in the current window.

this can well be a list of 20 or so different highlights. this can not be covered just by a simple Find (specially if the highlights contain some variable stuff like $me etc).

I think it would be a nice feature to have actually.

the way I solve it current is having a script that logs all highlights to a @window including a timestamp, and then I can look them up by using that timestamp. it's not ideal but shows the way a feature like this would come in handy.

examples of programs who can do this are for instance IDE's and some more advanced text editors. here you can have things highlighted/bookmarked and you can use some simple 'up/down' feature to browse through them.


though @ OP:

if you request this to be a feature in mIRC itself you are in the right forum section, but if you want a script you should check out the scripts section of the forum.


If it ain't broken, don't fix it!
Doqnach #204955 07/10/08 12:03 PM
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Code:
/help /findtext


A combination of /window -a and /findtext would be ideal, I assume.

Last edited by Kol; 07/10/08 12:04 PM.
Kol #204956 07/10/08 12:44 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
As Doqnach pointed out, highlights may well be triggered by e.g. regular expressions or "changing" identifiers like $me. We'd need:

• Either an event-bound identifier to track all occuring highlights with scripted means (in respective events, suggested more than once, and I'd prefer this one. Have e.g. a look here . )
mIRC "knows" when a highlight occurs, but atm you have no access to this "is a highlight/is not a highlight" assertion. You have to check on your own, which produces overhead - and is a pain, at least.

• And/or some kind of new, prefab "bookmarking" feature (for the more casual user, thinking of the "track urls" window. Maybe with some simple settings like prefix Network/Target/Timestamp...)

Horstl #204964 07/10/08 07:17 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
why is everyone ignoring /filter and $fline?

Code:
//window @test | /filter -ww $active @test * $+ $me $+ *


You could extend this to loop over $highlight(N) but I doubt thats necessarily needed


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #204966 07/10/08 10:44 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I didn't ignore those options. I also didn't think of them.

argv0 #204967 07/10/08 11:18 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
For my part, I am using an extended "filter from active window/all chans/all windows" script (popups), with options to find matches for multiple expressions, regex etc... this is handy if you know what expression you're exactly looking for.

In the case of "all highlights", it is not - for the reasons given above. Highlights are (or can be) more than $+(*,$me,*) and: this current $me has not to be identical to $me 3hrs ago smile

Horstl #204968 08/10/08 12:49 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quoting my use of $+(*,$me,*) shows you obviously did not finish reading the very next line of my post... I'm sure you've come to learn what an example is by now.

I should also point out that even in this case you know exactly what you're looking for-- again, repeating my initial post, you have the list of highlight matches ($highlight(N)) to search from. A one line script can do this just fine.

In any case-- I think you're feature creeping. The OP wasn't even necessarily talking about mIRC's highlight functionality. Rather than form a conclusion, you should probably ask him what specific lines he's looking to match. If he indeed knows what match he's looking for then this entire conversation is pointless -- both /findtext and /filter are highly sufficient and *are* the feature he's requesting. Another UI wouldn't make this any easier unless mIRC improved /findtext to support regex matching.



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #204983 08/10/08 05:25 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
First off, this post was started in the 'feature requests' board, thats why I'm not talking about scripts but features (and their impact on scripting possibilities). Call this creeping - so be it then. Moreover I picked that $me examle to show why - imho - you can hardly achieve the topic "find highlight" with the means given to scripters atm. At least, it's no simple scripting task, thus making up a valid feature reqest.

First assertion: You can not find all the highlights that occured in retrospective, if you did not track (= store in whatever way) highlights in the very moment they occur.
Refering to Doqnachs post, I was talking about a loop through a list of highlights already tracked/marked. Be it a built-in thingie (e.g. alike to the tracked urls window), or be it data (window, hash, file, whatever) you create on your own, with scripted means only.

A loop through highlight definitions ($highlight(N)) and applying them like a grid on a given window content, e.g. via filter or fline, is simply a different thing, producing completely different results. The simple $me example should make this point clear: $me in the moment you trigger a "find highlight" may well be different from *whatever nick you had* the moment a highlight *on your nick* occured.

A regex option for findtext would make up a nice feature indeed, but is utterly a different kettle of fish.


Second assertion: If you have to track first to find later, we're in need for better means to track.
Atm we don't have apposite means to easly track highlights in the moment they occur. Besides the overhead, building a custom $ishighlight may be possible but is extremely creepy (I picked an old post to illustrate this point), thus I'm "creeping" wholeheartedly for an improvement to this situation: Focusing either on the general user or the scripter (see above). Both suggestions have nothing to do with the highlight functionality itself.

-Regards-

Horstl #204996 08/10/08 10:34 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Horstl
I was talking about a loop through a list of highlights already tracked/marked. Be it a built-in thingie (e.g. alike to the tracked urls window), or be it data (window, hash, file, whatever) you create on your own, with scripted means only.


First assertion is false; it is indeed possible to find all highlights with relatively high (to complete) accuracy:

1. You can filter -a (or just loop manually) to an alias that tests if $line(window,N).color == $color(highlight) but this is all a subset of using /filter. This requires line colours to be used properly within mIRC but even mIRC would have no other means of retroactively finding this information given no marking inline-- so its irrelevant.

2. You can similarly make an on text event to test against $highlight($1-) and add the line it to a tracking window (or hash table) inline rather than retroactively. This is quite simple (one line) and cannot fail the way #1 can.

Second assertion: See above #2. We do indeed have the means to track highlights as they occur:

Code:
ON *:TEXT:*:*:if ($highlight($1-)) { add to list }


Basically, this is indeed easily scriptable.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #204998 08/10/08 11:20 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Quote:
2. You can similarly make an on text event to test against $highlight($1-) and add the line it to a tracking window (or hash table) inline rather than retroactively. This is quite simple (one line) and cannot fail the way #1 can.

It can, this is the central point we're goin round in circles.
Let someone say "1" and check for $highlight($1-)... A suggested workarround: checking for $highlight($nick $1-) instead works, but only the half way 'round (Again, please have a look at this old topic).
One may be able to escape the exemplary issue described there too, but the effort is far off an "easy n short" script.
It's only because of these flaws of $highlight(text) - It's not meant to compare text in this way - that I was suggesting a separate identifier (to use in text/action events only, returning plain $true/$false).

The call for a "track highlights" window was indeed a separate one, many users use a simple scripted sollution for this - there are countless "on text $me aline to some custom window" scripts, missing all the subtleties of the inbuild highlight feature - making me assume many would welcome and use an inbuild window (at least more than use the track urls list). Now that you appearantly agreee that you cannot /findtext for highlights, ain't this close to what the OP asked for?

Last edited by Horstl; 08/10/08 11:29 PM.
Horstl #205008 09/10/08 04:52 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Horstl
Now that you appearantly agreee that you cannot /findtext for highlights, ain't this close to what the OP asked for?


No, it's not. Why don't we recap what the OP *actually* asked for:

Originally Posted By: weedorcollege
I need a simple script that searches a channel or pm window for inputted text.


That's what he asked for. He did not ask what Dognach interpreted it as. He just wants to find something based on given (predictable) input-- that much is very clear.

Somehow you took the word "highlight" (which is a vague term defining a "visual cue" and nothing more) and connected it to mIRC's ADDRESS BOOK HIGHLIGHT FEATURE without asking the OP if that's what he was referring to. There is nothing in his post that implies he's necessarily referring to mIRC's address book highlight, nor is there anything in his post asking to find all highlights at once retroactively. This is called feature creep, plain and simple.

What he *actually* asked for is this: /findtext or /filter.

Frankly, the user probably already took RusselB's suggestion 2 days ago and is happily using it, which would explain why he doesn't care about this argument, making it completely moot.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #205009 09/10/08 06:47 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The OP didn't frame his issue in one phrase but two:
Quote:
I need a simple script that searches a channel or pm window for inputted text. So, that way I can find where my highlights were triggered without having to scroll up slowly enough to see the different colored text.

Yes, how can I dare to think it's about the address book. He's probably coloring the lines on his own. Further I presumed that there may be more than one highlight entry; mere speculation about the fact that he used the word in pluralis... You exposed it finally.

If it weren't for the sake of the feature request itself and the underlying popular problem, I wouldn't have taxed the patience of this boards other readers. I've done with this thread, indeed I hope /findtext will suffice for the OP and is all he'll ever dream of, as the thread became a nice example for how to make a farce out of it.

Regards


Link Copied to Clipboard