Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Nick Protection Script by Ford_Lawnmower irc.mindforge.org #USA-Chat
- menu channel,status {
- Nick Protection:dialogopen Nickprotection Nickprotection
- }
- dialog NickProtection {
- title "Nick Protection"
- size -1 -1 120 128
- option dbu
- text "Protection List:", 1, 8 6 105 8, center
- list 2, 7 16 106 74, sort size vsbar
- button "Add", 3, 8 96 29 12
- button "Edit", 4, 44 96 29 12
- button "Delete", 5, 81 96 29 12
- button "Set Up Unidentified Protection", 6, 8 112 101 12
- }
- On *:dialog:NickProtection:init:*:{
- var %records $hget(NickProtection,0).item
- while (%records) {
- did -a $dname 2 $gettok($hget(NickProtection,%records).data,2,32) $gettok($hget(NickProtection,%records).data,1,32)
- dec %records
- }
- }
- On *:dialog:NickProtection:Sclick:3-6:{
- if ($did == 6) { DialogOpen UProtect UProtect | return }
- if ($did == 5) {
- if ($did($dname,2).seltext) {
- var %Pnetwork $gettok($v1,1,32), %Pnick $gettok($v1,2,32), %Pnetworks $notify(%Pnick).network
- hdel NickProtection $+(%Pnick,%Pnetwork)
- if ($gettok(%Pnetworks,2,44)) {
- %Pnetworks = $deltok(%Pnetworks,$findtok(%Pnetworks,%Pnetwork,1,44),44)
- .notify -r %Pnick
- .notify -n %Pnick %Pnetworks Added by NickProtection Script
- }
- else { .notify -r %Pnick }
- if ($dialog($dname)) { did -d $dname 2 $didwm($dname,2,%Pnetwork %Pnick) }
- }
- return
- }
- if ($did == 4) {
- if ($did($dname,2).seltext) {
- dialogopen NP_Add_Edit Np_Add_Edit
- tokenize 32 $hget(NickProtection,$+($gettok($did($dname,2).seltext,2,32),$gettok($did($dname,2).seltext,1,32)))
- dialog -x NickProtection
- did -c NP_Add_Edit 1 $didwm(NP_Add_Edit,1,$2)
- did -ra NP_Add_Edit 2 $1
- did -a NP_Add_Edit 3 $3
- if ($4) { did -c NP_Add_Edit 4 }
- if ($5) { did -c NP_Add_Edit 5 }
- if ($6) { did -c NP_Add_Edit 13 }
- }
- return
- }
- dialogopen NP_Add_Edit Np_Add_Edit
- dialog -x NickProtection
- }
- dialog NP_Add_Edit {
- title "Nick Protection Add/Edit"
- size -1 -1 120 128
- option dbu
- combo 1, 40 8 72 10, drop
- edit "", 2, 40 32 72 10, autohs
- edit "", 3, 40 48 72 10, pass autohs
- check "Protect this Nickname", 4, 40 64 66 10
- check "Identify this Nickname", 5, 40 80 66 10
- button "Apply", 6, 8 112 37 12
- button "Close", 7, 75 112 37 12, cancel
- text "Network:", 8, 8 9 26 8, right
- text "Nickname:", 9, 8 33 26 8, right
- text "Password:", 10, 8 49 26 8
- text "GhostKill:", 11, 8 65 26 8, right
- text "Identify:", 12, 8 80 26 8, right
- check "Recover after Ghosting", 13, 40 96 74 10
- text "Recover:", 14, 8 96 25 8, right
- }
- On *:dialog:Np_Add_Edit:Close:*:{ dialogopen NickProtection NickProtection }
- On *:dialog:Np_Add_Edit:Sclick:6:{
- tokenize 32 $iif($did($dname,2).text,$v1,0) $iif($did($dname,1).seltext,$v1,0) $iif($did($dname,3).text,$v1,0) $did($dname,4).state $did($dname,5).state $did($dname,13).state
- if ($1) && ($2) && ($3) {
- dialog -x $dname
- hadd -m NickProtection $+($1,$2) $1-
- dialogopen NickProtection NickProtection
- var %message Added by NickProtection Script
- if ($2 == all) {
- $iif($notify($1),.notify -r $1)
- notify $1 %message
- return
- }
- if ($notify($1).network) {
- var %networks $v1
- .notify -r $1
- .notify -n $1 $iif($istok(%networks,$2,44),%networks,$addtok(%networks,$2,44)) %message
- return
- }
- $iif($notify($1),.notify -r $1)
- .notify -n $1-2 %message
- }
- }
- On *:dialog:NP_Add_Edit:init:*:{
- var %nets $scon(0)
- while (%nets) && ($dialog($dname)) {
- did -a $dname 1 $scon(%nets).network
- dec %nets
- }
- did -a $dname 1 ALL
- did -c $dname 1 $didwm($dname,1,$network)
- did -a $dname 2 $me
- did -f $dname 3
- Tokenize 32 $did(NickProtection,2).seltext
- $iif($gettok($hget(NickProtection,$+($2,$1)),4,32),did -c $dname 4)
- $iif($gettok($hget(NickProtection,$+($2,$1)),5,32),did -c $dname 5)
- $iif($gettok($hget(NickProtection,$+($2,$1)),6,32),did -c $dname 13)
- }
- dialog UProtect {
- title "Unidentified Protection"
- size -1 -1 120 136
- option dbu
- combo 1, 32 8 84 10, drop
- edit "", 2, 32 24 82 10, autohs
- check "Protect for this Network", 3, 32 40 74 10
- button "Apply", 5, 45 123 32 12
- button "Exit", 6, 82 123 32 12, cancel
- text "Network:", 7, 0 8 31 8, right
- text "Nick Prefix:", 8, 0 24 31 8, right
- box "Current list of Unidentified Protections", 10, 6 56 110 66
- list 4, 10 64 102 54, size vsbar
- }
- On *:dialog:UProtect:init:*: {
- var %nets $scon(0)
- while (%nets) {
- did -a $dname 1 $scon(%nets).network
- dec %nets
- }
- did -c $dname 1 $didwm($dname,1,$network)
- UProList
- if ($hget(UProtect,$did($dname,1).seltext)) {
- did -ra $dname 2 $v1
- did -c $dname 3
- }
- }
- On *:dialog:UProtect:Sclick:1,3-5: {
- if ($did == 1) {
- if ($hget(UProtect,$did($dname,1).seltext)) {
- did -ra $dname 2 $v1
- did -c $dname 3
- }
- else { did -r $dname 2 | did -u $dname 3 }
- }
- if ($did == 3) && ($did($dname,2).text) {
- var %net $did($dname,1).seltext
- if ($did($dname,3).state) {
- hadd -m UProtect %net $did($dname,2).text
- }
- else { $iif($hfind(UProtect,%net).item,hdel UProtect $v1) }
- UProList
- }
- if ($did == 4) {
- did -c $dname 1,3 $didwm($dname,1,$gettok($did($dname,4).seltext,1,32))
- did -ra $dname 2 $gettok($did($dname,4).seltext,2,32)
- }
- }
- alias -l UProList {
- did -r UProtect 4
- var %nets $hget(UProtect,0).item
- while (%nets) {
- did -a UProtect 4 $hget(Uprotect,%nets).item $hget(Uprotect,%nets).data
- dec %nets
- }
- }
- On *:Nick: {
- if ($regex($newnick,/\Q $+ $hget(UProtect,$network) $+ \E[0-9]{4}/i)) && ($nick == $me) && ($hfind(nickprotection,$+(*,$network),0,w).item) {
- nick $remove($hfind(nickprotection,$+(*,$network),$r(1,$v1),w).item,$network)
- }
- }
- On *:Notice:*NickServ IDENTIFY*:?: {
- if ($nick == Nickserv) {
- if ($gettok($hget(NickProtection,$+($me,$network)),5,32)) || ($gettok($hget(NickProtection,$+($me,ALL)),5,32)) {
- .msg nickserv identify $iif($gettok($hget(NickProtection,$+($me,$network)),3,32),$v1,$gettok($hget(NickProtection,$+($me,ALL)),3,32))
- }
- }
- }
- On $*:Notice:/\/ns recover\s(.*)\[password]/Si:?:{
- if ($nick == Nickserv) && ($gettok($server,-2-,46) == $gettok($wildsite,-2-,46)) {
- .msg nickserv recover $regml(1) $iif($gettok($hget(NickProtection,$+($nick,$network)),3,32),$v1,$gettok($hget(NickProtection,$+($nick,ALL)),3,32))
- }
- }
- On ^*:Notify:{
- if ($notify($nick).note == Added by NickProtection Script) { haltdef }
- if ($nick == $me) { return }
- if ($gettok($hget(NickProtection,$+($nick,$network)),4,32)) || ($gettok($hget(NickProtection,$+($nick,ALL)),4,32)) {
- echo -st 07NickProtection-GhostKill 04Killed $nick $notify($nick).addr 06@ $time On $adate
- .msg nickserv ghost $nick $iif($gettok($hget(NickProtection,$+($nick,$network)),3,32),$v1,$gettok($hget(NickProtection,$+($nick,ALL)),3,32))
- if ($gettok($hget(NickProtection,$+($nick,$network)),6,32)) || ($gettok($hget(NickProtection,$+($nick,ALL)),6,32)) { .timer 1 4 nick $nick }
- }
- }
- ;Raw 433:*: {
- ; if ($gettok($hget(NickProtection,$+($2,$network)),5,32)) || ($gettok($hget(NickProtection,$+($2,ALL)),5,32)) {
- ; .msg nickserv release $2 $iif($gettok($hget(NickProtection,$+($2,$network)),3,32),$v1,$gettok($hget(NickProtection,$+($2,ALL)),3,32))
- ; .timer 1 4 nick $2
- ; }
- ;}
- On *:Connect:{
- if (!$hget(NickProtection)) {
- hmake NickProtection 5
- if ($exists(NickProtection.hsh)) hload NickProtection NickProtection.hsh
- }
- if (!$hget(Uprotect)) {
- hmake Uprotect 5
- if ($exists(Uprotect.hsh)) hload Uprotect Uprotect.hsh
- }
- if ($gettok($hget(NickProtection,$+($me,$network)),5,32)) || ($gettok($hget(NickProtection,$+($me,ALL)),5,32)) {
- .msg nickserv identify $iif($gettok($hget(NickProtection,$+($me,$network)),3,32),$v1,$gettok($hget(NickProtection,$+($me,ALL)),3,32))
- }
- }
- On *:Start:{
- if ($exists(NickProtection.hsh)) { hmake NickProtection 5 | hload NickProtection NickProtection.hsh }
- if ($exists(Uprotect.hsh)) { hmake Uprotect 5 | hload Uprotect Uprotect.hsh }
- }
- On *:Disconnect:{
- if ($hget(NickProtection)) { hsave NickProtection NickProtection.hsh }
- if ($hget(Uprotect)) { hsave Uprotect Uprotect.hsh }
- }
- On *:Exit:{
- if ($hget(NickProtection)) {
- hsave NickProtection NickProtection.hsh
- hfree NickProtection
- }
- if ($hget(Uprotect)) {
- hsave Uprotect Uprotect.hsh
- hfree Uprotect
- }
- }
- alias -l DialogOpen { dialog $iif($dialog($1),-v,-m) $1- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement