Block pm's from unidentified users (freenode)


#1

Freenode is getting hammered with spambots. They’ve started spamming channels and pm-ing me and others as well.

Setting //mode $me +R takes care of business, at least until the chaos subsides!

I know some of you use custom made scripts with a whitelist and blacklist in order to (auto) accept or block pm’s… Care to share? —> Showcase it!


#2

As found here: https://mircscripts.net/0WvvJ

project%5B7075%5D

; Private Message Accept/Decline v1.0.5 - by entropy 2018

on ^*:open:?:*:{
  if (!$comchan($nick,1)) { echo -a * Closed PM to %pm_nick (no common channels) | haltdef | return }
  elseif (*http://* iswm $1- || *https://* iswm $1- || *www.* iswm $1-) { echo -a * Closed PM to %pm_nick (spamming) | haltdef | return }
  %pm_nick = $nick 
  %pm_addy = $address($nick,3)
  %net_work = $network
  .timer -om 1 1 window -h %pm_nick
  if ($dialog(pm)) { dialog -x pm pm }
  dialog -m pm pm
  %title = Incomming Private Message - $+($chr(40),%net_work,$chr(41))
}
dialog pm {
  title %title
  size -1 -1 214 62
  option dbu notheme
  text "", 1, 5 5 203 36
  button "Accept", 2, 134 45 37 12
  button "Decline", 3, 171 45 37 12, ok
}

on *:dialog:pm:init:0:{
  var %a = 1, %allchans
  while ($comchan(%pm_nick,%a)) {
    %allchans = %allchans $v1
    inc %a
  }
  did -ra pm 1 New Private Message from: $crlf $+ %pm_nick ( $+ %pm_addy $+ ) on %net_work $crlf $+ $crlf $+ Common channels: %allchans $crlf $+ Would you like to Accept or Decline?
}
on *:dialog:pm:sclick:2:{ .timer -om 1 1 window -arw3 %pm_nick | dialog -x pm }
on *:dialog:pm:sclick:3:{ window -c %pm_nick | dialog -x pm | echo -a * Closed PM to %pm_nick (declined) }