mIRC Homepage
Posted By: Clyde_The_Glide loop prob :( - 18/07/05 09:53 AM
O hope someone can fix it
cause I'm newbie
Code:
 

on *:open:?: { var %i 5 
 while ($query(0) > %i ) 
 ignore -pu500 $address($nick,2) 
 close -m 
 inc %i 
} 
} 
 
 


I want that if there be more then 5 query windows opened
all the querys that will be pened after that
will be closed and ignore
Posted By: NeoN Re: loop prob :( - 18/07/05 11:14 AM
Try this:

Code:
on ^*:open:?: {
  var %i = 5 
  if ($query(0) >= %i) {
    ignore -pu500 $mask($fulladdress,2)
    [color:red]while ($query(0) > %i) {
      close -m $query($v1)
    }[/color]
    halt
  } 
} 


This will prevent new query windows from opening once there are 5 of more opened already. It will also close the query windows until there are only 5 left.

But... since the only way to get more than 5 query windows is opening new queries yourself, you may want to omit the red part. For example: there are 5 queries open and you open a new query window yourself. While you are typing in this window, someone else sends you a private message, which gets ignored but also causes the window you're typing in to be closed.

I hope this helps in what you're trying to do.
Posted By: DaveC Re: loop prob :( - 19/07/05 03:45 AM
ON ^*:OPEN:?:*:{ if ($query(0) > 5) { halt } }

That works just as well, since it blocks the window opening, the user is ignored, and instantly there is not 5 windows the next pm'er isnt.

It also allows you to open greater than 5 pm windows without the chance of them being closed by a unreleated PM comming in, which i would find highly annoying. (you did mention this tho)

PS: I bet this is for search replies!
Posted By: Clyde_The_Glide Re: loop prob :( - 19/07/05 11:11 AM
thank u all! smile
© mIRC Discussion Forums