p2p blocker

By blackvenomm666 on Dec 09, 2010

simple p2p blocker with an allow list. turn it on and it will block p2p's if you add a person to your allow list they will be able to p2p you while its on it stores the p2p's you get that are blocked in a txt doc then you just hit read p2p to read it within the dialog and del p2p to delete it. there is a clear all function for both the allow list and the saved p2p's so you don't have to delete em one by one if you don't want to add to a new remotes. auto creates the needed txt files on load slight updated if the p2p blocker is on it will also block any notices from anyone not in the p2p allow list and save their messages to a text file for you to read at a later date. updated the p2p blocker can now seperately block notices. just turn on notice blocker and you won't receive notices can also set it so the alert doesnt go off. the alert is for when the p2p blocker is closed it auto opens if you get a p2p or notice if you have them blocked turn it off and it won't open

^^^old p2p blocker


^^^new p2p blocker

Menu Menubar {
  Venom p2pblocker
  .Venomp2pblockSys: dialog $iif($dialog(p2pblock.System),-v,-md p2pblock.System) p2pblock.System 
}
Dialog p2pblock.System {
  Title "Venomp2pblocker"
  Size -1 -1 142 105
  Option dbu
  edit "Allow Who ", 1, 02 02 56 10, autohs
  Button "Allow nick" 4, 02 17 27 15, flat 
  Button "Block nick" 5, 31 17 27 15, flat
  Button "Read p2p" 6, 02 54 27 15, flat 
  Button "Del p2p" 7, 31 54 27 15, flat
  list 9, 61 02 79 50, hsbar vsbar 
  list 10, 61 54 79 56, hsbar vsbar 
  Button "clear allow" 11, 02 34 56 15, flat 
  Button "clear p2p" 12, 31 88 27 15, flat
  Button "clear ntce" 40, 02 88 27 15, flat
  Button "readntice" 13, 02 71 28 15, flat 
  Button "del notice" 14, 31 71 27 15, flat
  menu "Options", 21
  menu "P2P Blocker" 22 ,21
  item "&On", 2
  item break, 102
  item "&Off", 3
  menu "Alert" 18 ,21
  item break, 111
  item "Popup alert control", 105
  item break, 103
  item "&On", 19
  item "&Off", 20
  item break, 108
  item "sound alert control", 101
  item break, 109
  item "&On", 24
  item "&Off", 25
  item break, 110
  item "Tip alert control", 126
  item break, 127
  item "&On", 30
  item "&Off", 31
  item break, 128

  menu "&Notice Blocker", 17, 21
  item "&On", 15
  item break, 100
  item "&Off", 16

}
on *:LOAD: {
  write myp2p.txt
  write p2pallow.txt
  write blckednotce.txt
}
on *:dialog:p2pblock.System:init:*: {
  p2pallownicks
  readp2p
  if ( %p2pblocker == on ) { did -c p2pblock.System 2
    echo -a 12,1 p2p blocker is on
  }
  if ( %p2pblocker == off ) { did -c p2pblock.System 3
    echo -a 12,1 p2p blocker is off
  }
  if (%noticeblocker == on ) {
    did -c p2pblock.System 15
  }
  elseif (%noticeblocker == off ) { did -c p2pblock.System 16
  }
  if ( %p2palert == on ) { did -c p2pblock.System 19
  }
  if ( %p2palert == off ) { did -c p2pblock.System 20
  }
  if ( %p2psound == on ) { did -c p2pblock.System 24
  }
  if ( %p2psound == off ) { did -c p2pblock.System 25
  }
  if ( %p2ptip == on ) { did -c p2pblock.System 30
  }
  if ( %p2ptip == off ) { did -c p2pblock.System 31
  }

}

on 1:open:?:*: {  
  var %p2p'ednick $nick 
  if (%p2p'ednick == $read(p2pallow.txt,w,%p2p'ednick)) { halt }
  if (%p2pblocker == on) { close -m $nick 
    write myp2p.txt $nick messaged you on $server saying $strip($1-) at $time(ddd mmm d h:nn::ss:tt)
    beep 1 1 | flash 
    .msg $nick 4,1This is an automated message your p2p has been blocked
    .ignore -pu30 $wildsite
    if (%p2psound == on) { p2psound
    }
    if (%p2ptip == on)  { 
      .set %tipnick $nick
      .set %tipserver $server
      .set %p2psaid $$1-
      p2ptip
    }

    if ($dialog(p2pblock.System)) { did -r p2pblock.System 10 
      did -az p2pblock.System 10 you have a new p2p
      if (%p2psound == on) { p2psound
      }
    }
    else { if (%p2palert == on) { .dialog -v,-md p2pblock.System p2pblock.System
        did -r p2pblock.system 10
        did -az p2pblock.System 10 you have a new p2p
        if (%p2psound == on) { p2psound
        }
      }
    }
  }
}

on ^1:NOTICE:*:*: {
  var %noticenick $nick 
  if (%noticenick !== $read(p2pallow.txt,w,%noticenick)) {  
    if (%noticeblocker == on) {
      write blckednotce.txt $nick noticed you on $server saying $1- at $time
      beep 1 1 | flash
      .notice $nick 4,1This is an automated message your notice has been blocked
      .ignore -nu30 $wildsite
      if (%p2psound == on) { p2psound
      }
      if (%p2ptip == on) { 
        .set %tipnick $nick
        .set %tipserver $server
        .set %p2psaid $$1-
        ntctip
      }

      if ($dialog(p2pblock.System)) { did -r p2pblock.System 10 
        did -az p2pblock.System 10 you have a new notice
        if (%p2psound == on) { p2psound

          haltdef
        }     
      }
      else { if (%p2palert == on) { .dialog -v,-md p2pblock.System p2pblock.System
          did -r p2pblock.system 10
          did -az p2pblock.System 10 you have a new notice
          if (%p2psound == on) { p2psound

            haltdef
          } 
        }
      }
    }
  }
}
on *:DIALOG:p2pblock.System:sclick:*:{
  if ($did == 4) {
    .set %p2pallownick $did(1).text
    var %na $read(p2pallow.txt,w,%p2pallownick)
    if (%na = %p2pallownick) noop $input(You have already added this nick to your p2p allow list,uwo,Error!)  halt
    else { write p2pallow.txt %p2pallownick
      did -r p2pblock.System 9
      p2pallownicks
    }
  }
  if ($did == 5) {
    if (!$did(9).sel) { noop $input(Please select a nick from the list to delete from allow list,uwo,Error!) }
    else { write -dl $+ $did(9).sel p2pallow.txt
      did -r p2pblock.System 9
      p2pallownicks
    }
  }
  if ($did == 6) {
    did -r p2pblock.System 10
    readp2p
  }
  if ($did == 7) {
    if (!$did(10).sel) { noop $input(Please select a message from the list to delete from p2p list,uwo,Error!) }
    else { write -dl $+ $did(10).sel myp2p.txt
      did -r p2pblock.System 10
      readp2p
    }
  }
  if ($did == 11) {
    write -c p2pallow.txt
    did -r p2pblock.System 9
  }
  if ($did == 12) {
    write -c myp2p.txt
    did -r p2pblock.System 10
  }
  if ($did == 13) {
    did -r p2pblock.System 10
    readnotice
  }
  if ($did == 40) {
    write -c blckednotce.txt
    did -r p2pblock.System 10

  }
  if ($did == 14) {
    if (!$did(10).sel) { noop $input(Please select a message from the list to delete from notice list,uwo,Error!) }
    else { write -dl $+ $did(10).sel blckednotce.txt
      did -r p2pblock.System 10
      readnotice
    }
  }
}

on *:DIALOG:p2pblock.System:dclick:10:{ 
  write p2pallow.txt $gettok($did(10).seltext ,1,32)
  query $gettok($did(10).seltext ,1,32)
  .timer 1 1 echo -a 12,1 $did(10).seltext
  did -r p2pblock.System 9
  p2pallownicks
}
on *:dialog:p2pblock.System:menu:19: {
  set %p2palert on
  did -u p2pblock.System 20
  did -c p2pblock.System 19

}
on *:dialog:p2pblock.System:menu:20: {
  set %p2palert off
  did -u p2pblock.System 19
  did -c p2pblock.System 20

}
on *:dialog:p2pblock.System:menu:15: {
  set %noticeblocker on
  did -u p2pblock.System 16
  did -c p2pblock.System 15

}
on *:dialog:p2pblock.System:menu:16: {
  set %noticeblocker off
  did -u p2pblock.System 15
  did -c p2pblock.System 16

}
on *:dialog:p2pblock.System:menu:2: {
  set %p2pblocker on
  did -u p2pblock.System 3
  did -c p2pblock.System 2

}

on *:dialog:p2pblock.System:menu:3: {
  set %p2pblocker off
  did -u p2pblock.System 2
  did -c p2pblock.System 3
}
on *:dialog:p2pblock.System:menu:24: {
  set %p2psound on
  did -u p2pblock.System 25
  did -c p2pblock.System 24
}
on *:dialog:p2pblock.System:menu:25: {
  set %p2psound off
  did -u p2pblock.System 24
  did -c p2pblock.System 25
}
on *:dialog:p2pblock.System:menu:30: {
  set %p2ptip on
  did -u p2pblock.System 31
  did -c p2pblock.System 30
}
on *:dialog:p2pblock.System:menu:31: {
  set %p2ptip off
  did -u p2pblock.System 30
  did -c p2pblock.System 31
}

alias p2pallownicks {
  var %a = 1, %b = $lines(p2pallow.txt)
  while (%a <= %b) {
    did -az p2pblock.System 9 $read(p2pallow.txt, %a)
    inc %a
  }
}
alias readp2p {
  var %a = 1, %b = $lines(myp2p.txt)
  while (%a <= %b) {
    did -az p2pblock.System 10 $read(myp2p.txt, %a)
    inc %a
  }
}
alias readnotice {
  var %a = 1, %b = $lines(blckednotce.txt)
  while (%a <= %b) {
    did -az p2pblock.System 10 $read(blckednotce.txt, %a)
    inc %a
  }
}
alias p2ptip {
  $tip(p2ptip,p2ptip,%tipnick p2p'ed you saying %p2psaid on %tipserver,60,)
}
alias ntctip {
  $tip(ntctip,ntctip,%ntcnick noticed you saying %ntcsaid on %ntcserver,60,)
}

Menu nicklist { 
  -
  p2pblocker
  .Turn On:{ set %p2pblocker on
    amsg 12,1p2pblocker now on
  }
  .Turn off:{  set %p2pblocker off
    amsg 12,1p2pblocker now off
  }
  .Add Nick:{ .set %p2pallownick $$1
    var %na $read(p2pallow.txt,w,%p2pallownick)
    if (%na = %p2pallownick) noop $input(You have already added this nick to your p2p allow list,uwo,Error!)  halt
    else { write p2pallow.txt %p2pallownick
      echo -a 12,1 $$1 added to p2p allow list
    }
  }
  .Del Nick:{  write -d p2pallow.txt $$1
    echo -a 12,1 $$1 deleted from p2p allow list
  }
  .View Allowlist:{ echo -a 4,1 nicks in your p2p allow list
    .timer 1 1 p2pallownicks2
    .timer 1 2 echo -a 4,1 end of list
  }
  .Read Savedp2p:{ readp2p2
  }
  .Read Savednotice:{ readnotice2
  }
  .Clear Savedp2p's:{ write -c myp2p.txt
  }
  .Clear Savednotice's:{ write -c blckednotce.txt
  }
}

alias p2pallownicks2 {
  var %a = 1, %b = $lines(p2pallow.txt)
  while (%a <= %b) {
    echo -a 12,1 $read(p2pallow.txt, %a) 
    inc %a
  } 
}
alias readp2p2 {
  var %a = 1, %b = $lines(myp2p.txt)
  while (%a <= %b) {
    echo -a 12,1 $read(myp2p.txt, %a)
    inc %a
  }
}
alias readnotice2 {
  var %a = 1, %b = $lines(blckednotce.txt)
  while (%a <= %b) {
    echo -a 12,1 $read(blckednotce.txt, %a)
    inc %a
  }
}
Sign in to comment.
blackvenomm666   -  May 02, 2011

updated again now all the diff alert types work for notices as well

 Respond  
D34th   -  May 01, 2011

Looks good :D

 Respond  
blackvenomm666   -  May 01, 2011

major updates/changes. the whole face as you can see is completely different now and its a little more compact. i added an option menu which controls the on/off functions of the various features of the alert system like the auto open alert if you get a p2p/notice i also added a tip window for when you get a p2p also added a sound feature. move a sound file to your sounds section in your mirc directory then set the alias p2p sound to the sound you want. ex

alias p2psound {
  splay p2psound.wav <<<
}

the alias is on the last three lines of the snippet

 Respond  
blackvenomm666   -  Apr 20, 2011

updated

 Respond  
Sharky_Dude   -  Feb 24, 2011

Nice Work :)

 Respond  
blackvenomm666   -  Feb 24, 2011

another update. ok i got annoyed with when the p2p blocker was on i would have to either A. add nicks to the list or B. turn the p2p blocker off now all you have to do is double click on the message they sent you and it will add them to the p2p allow list and open a p2p with them

 Respond  
blackvenomm666   -  Feb 19, 2011

updated. i made a nicklist function so you can turn it on/off from the nicklist right click on nicks to add/delte them and view saved p2p's/notices via echos and delete them more updates to come

 Respond  
blackvenomm666   -  Dec 10, 2010

updated

 Respond  
napa182   -  Dec 09, 2010

*napa182 sings "I wear my sunglasses at night....."

 Respond  
blackvenomm666   -  Dec 09, 2010

haha your weird

 Respond  
napa182   -  Dec 09, 2010

*napa182 sings "I talk to my self cuz there is no one else to talk to.."

 Respond  
Tidum   -  Dec 09, 2010

oh, lol. Nice job on the snippet.

 Respond  
blackvenomm666   -  Dec 09, 2010

teen left comments and i deleted em haha

 Respond  
Tidum   -  Dec 09, 2010

um, lol who are you talking to?

 Respond  
blackvenomm666   -  Dec 09, 2010

the read error messages should go away after the text documents have been created

 Respond  
blackvenomm666   -  Dec 09, 2010

i've already address both of those things you have said so bug off

 Respond  
blackvenomm666   -  Dec 09, 2010

i wanted it to msg everyone that the p2p blocker is on or off. and im not worried bout the error messages it still works

 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.