Jump to content
Countdown To Christmas!



Sign in to follow this  
Bobby

Mirc P2p block/Allow

Recommended Posts

Spike posted a simple remote script for a p2p block which was very great.

 

this is my version of a p2p block. Basically what i have is a dialog that lets you add users to a list of people who are allowed to p2p you. If the users are not on the list and they p2p you when the blocker is on they will get an auto message and it will count how many p2p's youve blocked since its been on

 

 

 

hopefully someone can find it useful

 

 

menu * {

p2p block:/dialog -m p2p p2p

}

 

alias p2p { dialog -m p2p p2p

}

 

dialog p2p {

title "P2P Blocker"

size -1 -1 160 70

option dbu

button "Block", 1, 86 8 33 13, flat

button "Allow", 2, 123 8 32 13, flat

box "Exception List Options", 3, 84 23 73 42

button "Add", 4, 88 33 32 12

button "Spam", 5, 122 33 32 12

button "Remove", 6, 88 49 32 12

button "Done", 7, 122 49 32 12, cancel

box "Exception List", 8, 5 5 75 60

list 9, 10 13 66 50, vsbar

}

 

 

on *:dialog:p2p:sclick:1: {

if (%p2p == on) { noop $input(P2P block is enabled,uwo,Error!) | halt }

set %p2p on

amsg P2P is now blocked for security purposes

}

 

on *:dialog:p2p:sclick:2: {

if (%p2p == off) { noop $input(P2P block is disabled,uwo,Error!) | halt }

set %p2p off

amsg P2P is now being accepted

}

 

on *:dialog:p2p:sclick:4: {

var %p2pallow $input(Enter a nickname to add,e)

if (%p2pallow == $null) { halt }

if (%p2pallow == $read(p2pallow.txt,w,%p2pallow)) { noop $input(%p2pallow is alread in the exception list,uwo,Error!) | halt }

write p2pallow.txt %p2pallow

did -a $dname 9 %p2pallow

}

 

on *:dialog:p2p:sclick:5: {

if (!%blocked) { amsg I have Blocked 0 | halt }

amsg I have blocked %blocked P2P's

}

 

on *:dialog:p2p:sclick:6: {

if (!$did(9).sel) { noop $input(You did not select a nick to remove,uwo,Error!) | halt }

write -dl $+ $did(9).sel p2pallow.txt

did -d $dname 9 $did(9).sel

}

 

on *:dialog:p2p:init:*: {

var %p2plist = 1

while (%p2plist <= $lines(p2pallow.txt)) {

did -a $dname 9 $read(p2pallow.txt,%p2plist))

inc %p2plist

}

}

 

 

on 1:open:?:*: {

var %p2pnick $nick

if (%p2pnick == $read(p2pallow.txt,w,%p2pnick)) { halt }

if (%p2p == on) {

if (%p2p != on) { halt }

inc -u30 $+(%,_p2p_lock,.,$nick)) 1

if ($($+(%,_p2p_lock,.,$nick),2) == 2) { close -m $nick | halt }

if ($($+(%,_p2p_lock,.,$nick),2) >= 6) { ignore -u30 $nick | close -m $nick | halt }

if (!$appactive) { flash }

inc %blocked

window @p2p Messages | echo -t @P2p $nick Messaged you on $server Saying: $1- at $time

write p2p.txt $nick Messaged you on $server saying $1- at $time

.msg $nick $nick This message is the %blocked Message to be blocked

beep 1 1

close -m $nick

}

}

 

on ^*:text:*:?:{

if (%p2pnick == $read(p2pallow.txt,w,%p2pnick)) && (!$appactive) {

beep 1 1 | flash

}

}

Share this post


Link to post
Share on other sites
 
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
  • Create New...