Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dialog Protection {
- title "AV2 Protection Control"
- size 160 175 152 159
- option dbu
- tab "Ban Protection", 1, 3 0 215 155
- tab "Kick Protection", 2
- tab "Deop Protection", 3
- box "Action to take when banned", 4, 5 17 146 125, tab 1
- list 5, 9 25 135 50, tab 1
- button "Add", 6, 9 75 25 10, tab 1
- button "Exceptions",7, 76 143 35 10
- button "Clear", 8, 120 75 25 10, tab 1
- text "Kick Message:", 9, 10 90 47 10, tab 1
- edit %BKMessage, 10, 57 90 90 10, autohs, tab 1
- button "Close", 11,40 143 25 10, cancel
- text "Channel Message:", 12, 9 102 46 10, tab 1
- edit %BCMessage, 13, 57 102 90 10, autohs, tab 1
- text "Notice Message:", 14, 9 115 46 10, tab 1
- edit %BNMessage, 15, 57 114 90 10, autohs, tab 1
- box "Action to take when kicked", 16, 5 17 146 125, tab 2
- list 17, 9 25 135 50, tab 2
- text "Kick Message:", 18, 10 90 47 10, tab 2
- edit %KKMessage, 19, 57 90 90 10, autohs, tab 2
- button "Add", 20, 9 75 25 10, tab 2
- button "Clear", 22, 120 75 25 10, tab 2
- text "Channel Message:", 23, 9 102 46 10, tab 2
- edit %KCMessage, 24, 57 102 90 10, autohs, tab 2
- edit %KNMessage, 25, 57 114 90 10, autohs, tab 2
- text "Notice Message:", 26, 9 115 46 10, tab 2
- text "Query Message:", 27, 9 127 46 10, tab 1
- edit %BQMessage, 28, 57 125 90 10, autohs, tab 1
- text "Query Message:", 29, 9 127 46 10, tab 2
- edit %KQMessage, 30, 57 125 90 10, autohs, tab 2
- box "Action to take when kicked", 31, 5 17 146 125, tab 3
- list 32, 9 25 135 50, tab 3
- button "Add", 33, 9 75 25 10, tab 3
- text "Kick Message:", 34, 10 90 47 10, tab 3
- text "Channel Message:", 35, 9 102 46 10, tab 3
- text "Notice Message:", 36, 9 115 46 10, tab 3
- text "Query Message:", 37, 9 127 46 10, tab 3
- edit %DQMessage, 38, 57 125 90 10, autohs, tab 3
- edit %DNMessage, 39, 57 114 90 10, autohs, tab 3
- edit %DCMessage, 40, 57 102 90 10, autohs, tab 3
- edit %DKMessage, 41, 57 90 90 10, autohs, tab 3
- button "Clear", 43, 120 75 25 10, tab 3
- button "Enable", 44, 5 143 25 10
- button "Disable", 45, 123 143 25 10
- }
- on 1:dialog:Protection:init:0:{
- var %x 1, %y 1, %z 1, %a 1
- while (%x < 14) {
- if ($readini(Protection.ini,Ban,%x) == Y) { did -i $dname 5 %y %y $+ . $readini(Protection.ini,Instances,%x) | inc %y }
- if ($readini(Protection.ini,Kick,%x) == Y) { did -i $dname 17 %z %z $+ . $readini(Protection.ini,Instances,%x) | inc %z }
- if ($readini(Protection.ini,Deop,%x) == Y) { did -i $dname 32 %a %a $+ . $readini(Protection.ini,Instances,%x) | inc %a }
- inc %x
- }
- }
- on 1:dialog:Protection:sclick:*:{
- if ($did == 6) dialog -m ProtectionList ProtectionList
- if (($did == 7) && (!$dialog(ProtectionException))) .dialog -m ProtectionException ProtectionException
- if ($did == 20) { dialog -m ProtectionList ProtectionList | did -c ProtectionList 2 }
- if ($did == 33) { dialog -m ProtectionList ProtectionList | did -c ProtectionList 3 }
- if ($did == 8) {
- did -r $dname 5
- var %x 1
- while (%x < 14) {
- writeini Protection.ini Ban %x N
- inc %x
- }
- }
- if ($did == 22) {
- did -r $dname 17
- var %x 1
- while (%x < 14) {
- writeini Protection.ini Kick %x N
- inc %x
- }
- }
- if ($did == 43) {
- did -r $dname 32
- var %x 1
- while (%x < 14) {
- writeini Protection.ini Deop %x N
- inc %x
- }
- }
- if ($did == 11) {
- set %BKMessage $did(10)
- set %BCMessage $did(13)
- set %KKMessage $did(19)
- set %BNMessage $did(15)
- set %KCMessage $did(24)
- set %KNMessage $did(25)
- set %BQMessage $did(28)
- set %KQMessage $did(30)
- set %DQMessage $did(38)
- set %DNMessage $did(39)
- set %DCMessage $did(40)
- set %DKMessage $did(41)
- }
- if ($did == 44) set %Protection on
- if ($did == 45) set %Protection off
- }
- alias Protection dialog -m Protection Protection
- dialog ProtectionList {
- title "AV2 Protecting Actions"
- size -1 -1 162 106
- option dbu
- tab "On Ban Actions", 1, 1 0 158 102
- tab "On Kick Actions", 2
- tab "On Deop Actions", 3
- list 4, 8 22 143 73, tab 1
- box "List of Actions", 5, 5 14 150 85, tab 1
- list 6, 8 22 143 73, tab 2
- box "List of Actions", 7, 5 14 150 85, tab 2
- list 8, 8 22 143 73, tab 3
- box "List of Actions", 9, 5 14 150 85, tab 3
- button "Close", 10, 70 85 25 13, cancel
- }
- on 1:dialog:ProtectionList:init:0:{
- var %x 1
- while (%x < 14) {
- did -i $dname 4 %x %x $+ . $readini(Protection.ini,Instances,%x)
- did -i $dname 6 %x %x $+ . $readini(Protection.ini,Instances,%x)
- did -i $dname 8 %x %x $+ . $readini(Protection.ini,Instances,%x)
- inc %x
- }
- }
- on 1:dialog:ProtectionList:sclick:*:{
- if ($did == 4) {
- did -i Protection 5 $calc($did(Protection,5).lines + 1) $calc($did(Protection,5).lines + 1) $+ . $gettok($did(4).seltext,2-,32)
- writeini Protection.ini Ban $did(4).sel Y
- }
- if ($did == 6) {
- did -i Protection 17 $calc($did(Protection,17).lines + 1) $calc($did(Protection,17).lines + 1) $+ . $gettok($did(6).seltext,2-,32)
- writeini Protection.ini Kick $did(6).sel Y
- }
- if ($did == 8) {
- did -i Protection 32 $calc($did(Protection,32).lines + 1) $calc($did(Protection,32).lines + 1) $+ . $gettok($did(8).seltext,2-,32)
- writeini Protection.ini Deop $did(8).sel Y
- }
- }
- dialog ProtectionException {
- title "AV2 Protection Exception List"
- size -1 -1 196 75
- option dbu
- box "Nicks not to trigger on", 1, 1 1 96 75
- combo 2, 3 9 89 50, size
- button "Add", 3, 4 61 24 11
- button "Delete", 4, 35 61 24 11
- button "Clear", 5, 67 61 24 11
- box "Channels not to trigger on", 6, 100 1 96 75
- combo 7, 102 9 89 50, size
- button "Add", 8, 103 61 24 11
- button "Delete", 9, 134 61 24 11
- button "Clear", 10, 166 61 24 11
- }
- on 1:dialog:ProtectionException:sclick:*:{
- if ($did == 3) {
- if (!$did(2)) { set %AMSGError Please enter a nick to add to the exception list. | dialog -m AMSGError AMSGError | return }
- if ($readini(Protection.ini,Nicks,$did(2))) { set %AMSGError The specified nick already exists in the exception list. | dialog -m AMSGError AMSGError | return }
- writeini Protection.ini Nicks $did(2) $Fulldate
- dialog -x $dname
- dialog -m ProtectionException ProtectionException
- }
- if ($did == 4) {
- if (!$did(2)) { set %AMSGError Please enter a nick to delete from the exception list. | dialog -m AMSGError AMSGError | return }
- if (!$readini(Protection.ini,Nicks,$did(2))) { set %AMSGError The specified nick does not exists in the exception list. | dialog -m AMSGError AMSGError | return }
- remini Protection.ini Nicks $did(2)
- dialog -x $dname
- dialog -m ProtectionException ProtectionException
- }
- if ($did == 5) { remini Protection.ini Nicks | dialog -x $dname | dialog -m ProtectionException ProtectionException }
- if ($did == 8) {
- if (!$did(7)) { set %AMSGError Please enter a channel to add to the exception list. | dialog -m AMSGError AMSGError | return }
- if ($readini(Protection.ini,Channels,$iif($left($did(7),1) == $chr(35),$did(7),$chr(35) $+ $did(7)))) { set %AMSGError The specified channel already exists in the exception list. | dialog -m AMSGError AMSGError | return }
- writeini Protection.ini Channels $iif($left($did(7),1) == $chr(35),$did(7),$chr(35) $+ $did(7)) $Fulldate
- dialog -x $dname
- dialog -m ProtectionException ProtectionException
- }
- if ($did == 9) {
- if (!$did(7)) { set %AMSGError Please enter a channel to delete from the exception list. | dialog -m AMSGError AMSGError | return }
- if (!$readini(Protection.ini,Channels,$iif($left($did(7),1) == $chr(35),$did(7),$chr(35) $+ $did(7)))) { set %AMSGError The specified channel does not exists in the exception list. | dialog -m AMSGError AMSGError | return }
- remini Protection.ini Channels $iif($left($did(7),1) == $chr(35),$did(7),$chr(35) $+ $did(7))
- dialog -x $dname
- dialog -m ProtectionException ProtectionException
- }
- if ($did == 10) { remini Protection.ini Channels | dialog -x $dname | dialog -m ProtectionException ProtectionException }
- }
- on 1:dialog:ProtectionException:init:0:{
- var %x 1
- while ($ini(Protection.ini,Nicks,%x)) {
- did -i $dname 2 %x $ini(Protection.ini,Nicks,%x)
- inc %x
- }
- %x = 1
- while ($ini(Protection.ini,Channels,%x)) {
- did -i $dname 7 %x $ini(Protection.ini,Channels,%x)
- inc %x
- }
- }
- alias CreateProtectionIni {
- var %x 1
- writeini Protection.ini Instances 1 Have ChanServ unban you from the channel | writeini Protection.ini Instances 2 Rejoin the channel | writeini Protection.ini Instances 3 Have ChanServ ban the user
- writeini Protection.ini Instances 4 Have ChanServ kick the user | writeini Protection.ini Instances 5 Have ChanServ deop the user | writeini Protection.ini Instances 6 Deop the user yourself
- writeini Protection.ini Instances 7 Unban yourself manually | writeini Protection.ini Instances 8 Ban the user yourself | writeini Protection.ini Instances 9 Kick the user yourself
- writeini Protection.ini Instances 10 Message the channel | writeini Protection.ini Instances 11 Notice the user | writeini Protection.ini Instances 12 Message the user
- writeini Protection.ini Instances 13 Have ChanServ op you
- while (%x < 14) {
- writeini Protection.ini Ban %x N
- Writeini Protection.ini Kick %x N
- Writeini Protection.ini Deop %x N
- inc %x
- }
- }
- on 1:ban:*:{
- if ($nick == $me) return
- if ((%Protection == off) || ($readini(Protection.ini,Nicks,$nick)) || ($readini(Protection.ini,Channels,#))) return
- if ($bnick == $me) { ProtectionAction Ban # $nick | return }
- var %x -1
- while (%x < 10) {
- if ($banmask isin $address($me,%x)) { set %BannedToo 1 | ProtectionAction Ban # $nick | return }
- inc %x
- }
- }
- on 1:kick:#:{
- if ($nick == $me) return
- if ((%Protection == off) || ($readini(Protection.ini,Nicks,$nick)) || ($readini(Protection.ini,Channels,#))) return
- if (($knick == $me) && (%BannedToo != 1)) ProtectionAction Kick # $nick
- }
- on 1:deop:#:{
- if ($nick == $me) return
- if ((%Protection == off) || ($readini(Protection.ini,Nicks,$nick)) || ($readini(Protection.ini,Channels,#))) return
- if ($onick == $me) ProtectionAction Deop # $nick
- }
- alias ProtectionAction {
- unset %BannedToo
- mode $2 -eeee $3 $address($3,2) $address($3,3) $address($3,4)
- if ($readini(protection.ini,$1,1) == Y) cs unban $2
- if ($readini(protection.ini,$1,2) == Y) { set %ProtectionJoin $1- | join $2 }
- if ($readini(protection.ini,$1,3) == Y) cs ban $2 $3 $($+(%,$left($1,1),KMessage),2)
- if ($readini(protection.ini,$1,4) == Y) cs kick $2 $3 $($+(%,$left($1,1),KMessage),2)
- if ($readini(protection.ini,$1,5) == Y) cs deop $2 $3
- if ($1 != kick) ProtectionActionS $1-
- else set %ProtectionJoin $1-
- }
- alias ProtectionActionS {
- unset %BannedToo
- if ($readini(protection.ini,$1,13) == Y) cs op $2
- mode $2 -eeee $2 $address($3,5) $address($3,6) $address($3,7) $address($3,8)
- if ($readini(protection.ini,$1,6) == Y) mode $2 -o $3
- if ($readini(protection.ini,$1,7) == Y) mode $2 -bb $me $banmask
- if ($readini(protection.ini,$1,8) == Y) mode $2 +b $address($3,2)
- if ($readini(protection.ini,$1,9) == Y) kick $2 $3 %BKMessage
- if (($readini(protection.ini,$1,10) == Y) && (%BCMessage)) msg $2 $($+(%,$left($1,1),CMessage),2)
- if (($readini(protection.ini,$1,11) == Y) && (%BNMessage)) notice $3 $($+(%,$left($1,1),NMessage),2)
- if (($readini(protection.ini,$1,12) == Y) && (%BQMessage)) msg $3 $($+(%,$left($1,1),QMessage),2)
- }
- on 1:join:#:{
- if (($nick == $me) && (%Protection == on) && ($gettok(%ProtectionJoin,3,32)) && ($gettok(%ProtectionJoin,2,32) == #)) { .timer 1 1 ProtectionActionS %ProtectionJoin | unset %ProtectionJoin }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement