mIRC Homepage
Posted By: lrietveld Highlight hidden channel - 29/08/04 12:17 AM
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?
Posted By: Coolkill Re: Highlight hidden channel - 29/08/04 01:04 AM
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.
Posted By: Iori Re: Highlight hidden channel - 29/08/04 02:11 AM
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 # }  
}
Posted By: lrietveld Re: Highlight hidden channel - 29/08/04 03:19 AM
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
© mIRC Discussion Forums