Query/Pm Blocker

By Yoinx on Feb 24, 2005

Here's a pretty simple Query Blocker. It uses hash tables to store the info. You can add pm to be allowed to pm you via the nicklist. People are added by ident@host not by nick. Also, a few notes. This halts the query window from opening, so you will not know whne someone messages you. It will only respond to someone from a specific ident@host once every 60 seconds. Right now, Im using /userhost to get the address if they arent in your ial, so if your server doesnt support that, this would have to be changed to use whois. Echoes the result to the active window.

menu nicklist {
  Pm Control
  .Allow PMs From $1:PmControl add $$1
  .Disallow PMs From $1:PmControl Del $$1
}
alias PmControl {
  if ( $1 == add ) {
    if ( $address($2,0) != $null ) {
      hadd -m PmControl $right($address($2,0),-2)
      echo 3 -a Added $right($address($2,0),-2) to PmAccept List
    }
    else {
      .enable #userhostadd
      userhost $2
    }
  }
  if ( $1 == del ) {
    if ( $address($2,0) != $null ) {
      hdel PmControl $right($address($2,0),-2)
      echo 3 -a Removed $right($address($2,0),-2) From the PmAccept List
    }
    else {
      .enable #userhostdel
      userhost $2
    }
  }
}
#userhostadd off
raw 302:*: {
  hadd -m PmControl $right($gettok($1-,2,61),-1)
  echo 3 -a Added $right($address($2,0),-2) to PmAccept List
  .disable #userhostadd
  halt
}
#userhostadd end
#userhostdel off
raw 302:*: {
  hdel PmControl $right($gettok($1-,2,61),-1)
  echo 3 -a Removed $right($address($2,0),-2) From the PmAccept List
  .disable #userhostdel
  halt
}
#userhostdel end
on ^*:open:?:*: {
  if ( !$hfind(PmControl,$address) ) {
    hinc -mu60 PmControl $+(Flood.,$address)
    if ( $hget(PmControl,$+(Flood.,$address)) == 1 ) {
      .msg $nick Sorry this PM Has been automatically rejected as you are not on my accept list. Please Contact me through a Known Channel.
    }
    halt
  }
}
On *:start: {
  hmake PmControl 20
  $iif( $isfile(PmControl.hsh) , hload PmControl PmControl.hsh )
}
on *:Exit: {
  hsave -o PmControl PmControl.hsh
  hfree PmControl
} 

Comments

Sign in to comment.
Ghost-writer   -  Feb 12, 2010

Very Nice. Great idea tbh, but maybe you could make it notify you, youv been queried bla bla bla??

 Respond  
TonyRockz   -  Dec 31, 2009

Where Does this go on Scripts Editor?

 Respond  
Yoinx   -  Feb 25, 2005

Thanks, Obviously you could tell I just copied the group ;p also, mirc doesnt really care that much what the end of the group is called as long as there is an end. Its weird like that (or so Ive noticed)

 Respond  
StonedStoner   -  Feb 24, 2005

on ur groupvvvv

 Respond  
StonedStoner   -  Feb 24, 2005

on ur userhostdel the end is userhostadd instead of delete other wise looks good

 Respond  
Yoinx   -  Feb 24, 2005

Yeah the only defect would be if the server doesnt support userhost. I dont know of any that dont. Thanks for the info though. ;)

 Respond  
Dabomb   -  Feb 24, 2005

Well...I\'m new to this site but i tested that script and it apears to have no obvious defects.

 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.