mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2005
Posts: 3
F
Fusk Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2005
Posts: 3
okay iv'e tryed to search around here but didn't find much so here goes.

i'm using nnscript just so you know.

i'm looking for a script that highlights on 2 specific words, in nnscript a highligh when mirc is minimized will popup a little balloon with what was said etc, and a notice if mirc is active but in another channel.
i tryed to use the highlight option, but if i use one word ex test, it'll work fine but if i use 2 words ex test,tester it'll highlight on both words even if they arent in the same sentence.

i olso tryed,
on *:text:*:*:if (test isin $1-) && (tester isin $1-) { /window -g2 $iif($chan,$chan,$nick) }

but none of them are able to detect the words if there are [ | ] around them, ex bot says [test|tester] then nothing happends

dunno if this is a bit too much to ask for, so far iv'e been told that it's nearly impossible to get something like that working. something about not being native supported and other stuff i didn't understand.

Joined: Sep 2004
Posts: 237
Fjord artisan
Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Not so sure but would using wildcards in the matchtext work?
on *:text:*Matchtext1*Matchtext2*:*: { do whatever }

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
on *:text:*:*:if (test isin $1-) && (tester isin $1-) { /window -g2 $iif($chan,$chan,$nick) }


thers nothing wrong with that, you might wanna do this tho
on *:text:*:*:if (test isin $strip($1-)) && (tester isin $strip($1-)) { /window -g2 $iif($chan,$chan,$nick) }

I sure these are not the words but just in case TEST and TESTER dont need (test isin $strip($1-)) as test is in tester so well be found in the tester isin.

Actually i would use this
on *:text:*:*:if (*test*tester* iswm $strip($1-)) || (*tester*test* iswm $strip($1-)) { /window -g2 $iif($chan,$chan,$nick) }

Use just one of the iswm if the words should only appear in one order

Quote:
but none of them are able to detect the words if there are [ | ] around them, ex bot says [test|tester] then nothing happends


Dont know why that would be.

Quote:
dunno if this is a bit too much to ask for, so far iv'e been told that it's nearly impossible to get something like that working. something about not being native supported and other stuff i didn't understand.

Sounds like the person who told you that didnt have native support themselfs. Unless there refering dierectly to nnscript which i have never seen.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
That would work, only problem with doing text matching is if colors bolds etc are involved, the text match must have them in, I guess you could do a regex match of course.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
To use mIRCs highlight system (and presumably in turn nnscripts)

If its a phrase you're wanting such as you posted ("[test|tester]") then just add
  • [test|tester]
as an entry to the highlight dialog.

Or if you want those two words in any postion of the msg add
  • %highlight
as the highlight entry, with "Match on:" set to 'Nickname' and use this modified version of Daves line
Code:
on *:text:*test*:*:if *test*tester* iswm $strip($1-) || *tester*test* iswm $strip($1-) { set -u1 %highlight $nick }

Joined: Feb 2005
Posts: 3
F
Fusk Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2005
Posts: 3
thanks alot, all of you. both dave's and iori's script seems to work fine, and there is bold and colurs involved, so that rules out the matchtext..

oh btw dave, i don't think he was refering to nnscript, i'll try translate all he said
...
the problem is to call the highlight function through scripting
it's not native supporte as i can see
and the highlight function dosn't support regular expressions
that makes it hard.

i think hes reffering to mirc it self since nnscript is just a addon installed ontop of mirc.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You need the ^ event prefix in on TEXT for this to work with mirc's built-in highlight.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Sep 2004
Posts: 237
Fjord artisan
Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
LOL, Thanks DaveC, that explains some issues i had in the past with using matchtext that really had me scratching my head. I just assumed mIRC would see the text striped.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Thats how i learnt it, I was stripping everything from messages, and wrote some matchtexts that all worked, then later (6 months or more) I turned all the strips off, and didnt notice for a day the traps werent working, then wasted an hour looking through my code, when it just want matching up anymore.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
What does this actually do to mirc? set -u1 %highlight $nick I dont use the internal highlight system, is a nick in that variable automaticly highlighted? And if so be it becuase of the nick or text match on nick name?

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
oop yeah, I forgot to add it when I modded that lline blush
Thanks for pointing it out smile

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
... add
  • %highlight
as the highlight entry, with "Match on:" set to 'Nickname' and use this modified version of Daves line
Code:
on [color:red]^[/color]*:text:*test*:*:if *test*tester* iswm $strip($1-) || *tester*test* iswm $strip($1-) { set -u1 %highlight $nick }


What it does is set the var to the nick (but you knew that), The var is a highlight entry set to match on nicknames, so when the mirc parses the line it sees a match and highlight is triggered. smile

Joined: Feb 2005
Posts: 3
F
Fusk Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2005
Posts: 3
i'm not sure i get, where did you say you insert the nick that it should trigger on ?, because that would actually be nice...

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You can have nicks as entries in highlight.

That script just dynamically assigns whover posted the "Test tester"string to the "%highlight" entry

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
hey hey thats a clever system, just add %highlight as a highlight item, and you have a dynamicly assignable one. I like it. Although IM having troubles when i set it to the nick of the text sender, seems to only work if i set it to his striped text? Which comes to the same thing in the end.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Quote:
Although IM having troubles when i set it to the nick of the text sender, seems to only work if i set it to his striped text?

Did you assign "Match on:" ->> Nickname ("Nickname only" or "Nickname and message")?


Link Copied to Clipboard