SReject commented on a Page, Screen Blocker  -  Oct 28, 2011

Window based blocking system:

To use: /block

on *:START:if (%block:pass) block $?="Please enter the password:"
on *:INPUT:*:if (%block:pass) block $?="Please enter the password:"
on *:ACTIVE:*:{
  if ($active != @Block && %block:pass) {
    block $?="Please enter the password:"
  }
}

alias Block {
  if (%block:pass && $md5($encode($1-,mu)) == %block:pass)  {
    .treebar   %block:treebar
    .switchbar %block:switchbar
    .menubar   %block:menubar
    .toolbar   %block:toolbar
    unset %block:*
    close -@ @Block
    return
  }
  if (!%block:Pass) { 
    set %block:pass      $md5($encode($$iif($1-,$1-,$$?="Enter a password:"),mu))
    set %block:treebar   $iif($treebar,on,off)
    set %block:switchbar $iif($switchbar,on,off)
    set %block:menubar   $iif($menubar,on,off)
    set %block:toolbar   $iif($toolbar,on,off)
  }
  if (%block:Pass) {
    .treebar off
    .switchbar off
    .menubar off
    .toolbar off
    window -ax @Block  
    halt
  }
}
menu @Block {
  Unblock: block $?="Please enter the password:"
}

Edited: I fixed the code

 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.