gooshie commented on a Page, PM(query) Blocker  -  Sep 10, 2010

If you use the ^ then you can HALT the window BEFORE it opens instead of having it pop open and then close.

on ^*:open:?:{
  if (%PMBlock == ON) { 
    .msg $nick Your Custom Message.
    halt
  }
}

Also, For the switch you could have it appear as one entry which becomes more useful as your menu list gets longer.

menu menubar {
  PM Blocker is now $iif(%PMBlock,On,Off): $iif(%PMBlock,unset,inc) %PMBlock
}
_____________________________________________________________________________

There is no real need to set the variable to On/Off instead just inc it for a true and unset it to create a false. Then the above code could be:

on ^*:open:?:{
  if %PMBlock {
    .msg $nick Your Custom Message.
    halt
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.