PM Blocker

By Andyhighton on Feb 08, 2009

This blocks any unwanted PM's from people you may not know, or may not want to speak to while allowing anyone on the accept list to PM you.

If you want to allow somebody, just type:
/addnick [NICK]

To delete somebody, it's:
/delnick [NICK]

To view the list in an @window its:
/shownicks

I had help with the shownicks alias, thanks Shawn <3

EDIT: Had a bit of a bug when being pm'd. The search wasn't working so all pm's were blocked. Fixed that now.

Alias AddNick {
  if ($1 isin $read(acceptednicks.txt, s, $1)) { 
  echo -a 7 $+ $1 is already on Accepted Nicks | halt }
  else { write AcceptedNicks.txt $1 $1
    echo -a 7 $+ $1 added to Accepted Nicks
  }
}
Alias DelNick {
  if ($1 isin $read(acceptednicks.txt, s, $1)) {
    write -ds $1 AcceptedNicks.txt 
  echo -a 7 $+ $1 deleted from Accepted Nicks | halt }
  else { echo -a 7 $+ $1 is not in Accepted Nicks
  }
}
Alias ShowNicks {
  if (!$window(@AcceptedNicks)) { window -znkg1 @AcceptedNicks }
  var %x $Lines(acceptednicks.txt)
  while (%x) { //echo @AcceptedNicks $gettok($read(acceptednicks.txt,%x),1,32) | dec %x }
}
on ^1:OPEN:?:*: {
    if ($read(AcceptedNicks.txt, s, $nick)) { msg $nick 7Please wait, i will read this sooner or later :p }
  else { msg $nick 7This is a PM Blocker. I'm sure you can guess what it does.. | /halt
  }
}

Comments

Sign in to comment.
dashh   -  Feb 19, 2009

if the user changue nick, u lost everything. make with gate/address
($address or $ial)

in irc servers that's works fine with only nickname, but some servers dont use your hostname or gate "nick!randgate@bla.server and make a random gate or something when you register.

And u can use the ignore identify (see help for usage)

;- if ( !$ignore( gate here.. or nick or something ) ) { .. }

xD

 Respond  
Aucun50   -  Feb 08, 2009

I like the idea

 Respond  
Kirby   -  Feb 08, 2009

Great job for your first snippet. Keep up the good work.

 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.