mIRC Home    About    Download    Register    News    Help

Print Thread
#95998 29/08/04 12:17 AM
Joined: Apr 2004
Posts: 19
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Apr 2004
Posts: 19
I'm not sure if this is possible, but I'm a bit curious.
I use the highlight function a lot (/window -h/-w #....).
Is it possible, that when a highlighted word is typed into a hidden channel, that this channel is automaticaly maximized, and automaticaly is un-hidden?
How would I take care of this?

#95999 29/08/04 01:04 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You could use something that acts as a type of "check" to see if something has actually been highlighted, for example:

$highlight(0) - Returns the number of "items" in your highlight settings.
$highlight(N) - Returns the N'th item.

So, looping around that, and since words can be seperated by commas, we loop around the commas also and check if they are in the persons sentence, plus check if highlight is even turned on using $highlight (true/false) and if everything is okay, /window -s.

On *:Text:*:#:{
var %i = 1
while (($highlight(0) >= %i) && ($highlight)) {
var %n = $highlight(%i)
var %o = $numtok(%n,44)
while (%o) {
if (($gettok(%n,%o,44) isin $1-) && ($window($chan).state == hidden)) { window -w $chan }
dec %o
}
inc %i
}
}


Hope this helps,

Eamonn.

#96000 29/08/04 02:11 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You can also more simply use $highlight($nick $1-) to check for highlight entries in the message or the nick.
Code:
on *:text:*:#:{ 
  if $highlight($nick $1-) && ($window($chan).state == hidden)) { window -w # }  
}

#96001 29/08/04 03:19 AM
Joined: Apr 2004
Posts: 19
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Apr 2004
Posts: 19
Thanx, it works like a charm.... wink
Next time I'll see if I can arrange something like this on my own, but I guess I'd better start with something simpler blush


Link Copied to Clipboard