alias ChannelProtection { if (!$dialog(ChannelProtection)) { dialog -m ChannelProtection ChannelProtection } | else halt }
dialog ChannelProtection {
  title "Dreamer§ §cript - Impostazioni Canali"
  size -1 -1 297 162
  option dbu
  button "OK", 1, 35 137 50 13, default ok
  box "", 2, 0 1 296 160
  check "Text Flood Kick:", 4, 8 15 59 7
  edit "", 6, 70 14 11 10
  text "ripetizioni in", 7, 82 15 37 10
  edit "", 8, 121 14 11 10
  text "sec.", 9, 136 15 15 10
  check "Action Flood Kick:", 10, 8 25 60 7
  edit "", 12, 70 24 11 10
  text "ripetizioni in", 13, 82 25 37 10
  edit "", 14, 121 24 11 10
  text "sec.", 15, 136 25 15 10
  check "Notice Flood Kick:", 16, 8 35 60 7
  edit "", 18, 70 34 11 10
  text "ripetizioni in", 19, 82 35 37 10
  edit "", 20, 121 34 11 10
  text "sec.", 21, 136 35 15 10
  check "Ctcp Flood Kick:", 22, 8 45 60 7
  edit "", 24, 70 44 11 10
  text "ctcp in", 25, 87 45 20 10
  edit "", 26, 121 44 11 10
  text "sec.", 27, 136 45 15 10
  box "Flood Protection", 28, 3 5 290 52
  check "Topic Flood Kick:", 29, 155 15 58 7
  edit "", 31, 216 14 11 10
  text "cambi in", 32, 228 15 28 10
  edit "", 33, 258 14 11 10
  text "sec.", 34, 272 15 17 10
  check "Nick Flood Kick:", 35, 155 25 60 7
  edit "", 37, 216 24 11 10
  text "cambi in", 38, 228 25 28 10
  edit "", 39, 258 24 11 10
  text "sec.", 40, 272 25 17 10
  check "Mode Flood Kick:", 41, 155 35 59 7
  edit "", 43, 216 34 11 10
  text "cambi in", 44, 228 35 28 10
  edit "", 45, 258 34 11 10
  text "sec.", 46, 272 35 17 10
  check "Join Flood - Kick:", 47, 155 45 59 7
  edit "", 49, 216 44 11 10
  text "join in", 50, 228 45 24 10
  edit "", 51, 258 44 11 10
  text "sec.", 52, 272 45 17 10
  box "Max Action Protection", 53, 3 60 142 52
  check "Max Op - Kick:", 54, 8 70 53 7
  edit "", 56, 70 69 11 10
  text "op in", 57, 84 70 17 10
  edit "", 58, 110 69 11 10
  text "secondi)", 59, 122 70 23 10
  check "Max Deop - Kick:", 60, 8 80 59 7
  edit "", 62, 70 79 11 10
  text "deop in", 63, 84 80 21 10
  edit "", 64, 110 79 11 10
  text "secondi)", 65, 122 80 23 10
  check "Max Kick - Kick:", 66, 8 90 57 7
  edit "", 68, 70 89 11 10
  text "kick in", 69, 84 90 20 10
  edit "", 70, 110 89 11 10
  text "secondi)", 71, 122 90 23 10
  check "Max Ban - Kick:", 72, 8 100 59 7
  edit "", 74, 70 99 11 10
  text "ban in", 75, 84 100 20 10
  edit "", 76, 110 99 11 10
  text "secondi)", 77, 122 100 23 10
  box "Other Channel Protection", 78, 150 60 142 52
  check "Kill Watch", 79, 155 71 46 7
  check "Swear Kick", 80, 155 81 41 7
  check "Kick Offensive Nick", 81, 155 101 65 7
  check "Kick Pubblicità", 82, 155 91 55 7
  check "Server Op Protection", 83, 216 71 73 7
  check "Autocycle per Op", 84, 229 101 60 7
  check "Swear Kick anche contro OP", 86, 200 81 89 7
  button "Resetta Default", 100, 35 120 50 13
  box "Altre Opzioni", 101, 116 115 176 42
  button "CANCEL", 104, 1000 1000 0 0, cancel
  edit "", 89, 218 123 29 10
  check "Imposta nuovi canali on join:", 91, 121 123 93 10
}

on *:dialog:ChannelProtection:sclick:*:{
  if ($did = 1) { sclose }
  if ($did = 4) { if ($did(ChannelProtection,4).state = 1) { .enable #TextFloodcanale | son } | else { .disable #TextFloodcanale | soff } }
  if ($did = 10) { if ($did(ChannelProtection,10).state = 1) { .enable #ActionFloodCanale | son } | else { .disable #ActionFloodCanale | soff } }
  if ($did = 16) { if ($did(ChannelProtection,16).state = 1) { .enable #NoticeFloodCanale | son } | else { .disable #NoticeFloodCanale | soff } }
  if ($did = 22) { if ($did(ChannelProtection,22).state = 1) { .enable #CtcpFloodCanale | son } | else { .disable #CtcpFloodCanale | soff } }
  if ($did = 29) { if ($did(ChannelProtection,29).state = 1) { .enable #TopicFloodCanale | son } | else { .disable #TopicFloodCanale | soff } }
  if ($did = 35) { if ($did(ChannelProtection,35).state = 1) { .enable #NickFloodCanale | son } | else { .disable #NickFloodCanale | soff } }
  if ($did = 41) { if ($did(ChannelProtection,41).state = 1) { .enable #ModeFloodCanale | son } | else { .disable #ModeFloodCanale | soff } }
  if ($did = 47) { if ($did(ChannelProtection,47).state = 1) { .enable #JoinFloodCanale | son } | else { .disable #JoinFloodCanale | soff } }
  if ($did = 54) { if ($did(ChannelProtection,54).state = 1) { .enable #MaxOp | son } | else { .disable #MaxOp | soff } }
  if ($did = 60) { if ($did(ChannelProtection,60).state = 1) { .enable #MaxDeop | son } | else { .disable #MaxDeop | soff } }
  if ($did = 66) { if ($did(ChannelProtection,66).state = 1) { .enable #MaxKick | son } | else { .disable #MaxKick | soff } }
  if ($did = 72) { if ($did(ChannelProtection,72).state = 1) { .enable #MaxBan | son } | else { .disable #MaxBan | soff } }
  if ($did = 79) { if ($did(ChannelProtection,79).state = 1) { .enable #KillWatch | son } | else { .disable #KillWatch | soff } } 
  if ($did = 80) { if ($did(ChannelProtection,80).state = 1) { .enable #SwearKick | son } | else { .disable #SwearKick | soff } }
  if ($did = 81) { if ($did(ChannelProtection,81).state = 1) { .enable #OffensiveNick | son } | else { .disable #OffensiveNick | soff } }
  if ($did = 82) { if ($did(ChannelProtection,82).state = 1) { .enable #Invit | son } | else { .disable #Invit | soff } }
  if ($did = 83) { if ($did(ChannelProtection,83).state = 1) { .enable #ServOp | son } | else { .disable #ServOp | soff } }
  if ($did = 84) { if ($did(ChannelProtection,84).state = 1) { .enable #OpCycle | son } | else { .disable #OpCycle | soff } }
  if ($did = 86) { if ($did(ChannelProtection,86).state = 1) { set %SwearKickOp ON | son } | else { set %SwearKickOp OFF | soff } }
  if ($did = 96) { if ($did(ChannelProtection,96).state = 1) { set %JoinInvite ON | son } | else { set %JoinInvite OFF | soff } }
  if ($did = 91) { if ($did(ChannelProtection,91).state = 1) { set %AutoSetOnJoin ON | son } | else { set %AutoSetOnJoin OFF | soff } }
  if ($did = 100) { ResettaCanale | sopen }
  if ($did = 104) { sclose }
}
on *:dialog:ChannelProtection:edit:*:{
  if ($did = 6) { set %TextFloodVar1 $did(ChannelProtection,6).text }
  if ($did = 8) { set %TextFloodVar2 $did(ChannelProtection,8).text }
  if ($did = 12) { set %ActionFloodVar1 $did(ChannelProtection,12).text }
  if ($did = 14) { set %ActionFloodVar2 $did(ChannelProtection,14).text }
  if ($did = 18) { set %NoticeFloodVar1 $did(ChannelProtection,18).text }
  if ($did = 20) { set %NoticeFloodVar2 $did(ChannelProtection,20).text }
  if ($did = 24) { set %CtcpFloodVar1 $did(ChannelProtection,24).text }
  if ($did = 26) { set %CtcpFloodVar2 $did(ChannelProtection,26).text }
  if ($did = 31) { set %TopicFloodVar1 $did(ChannelProtection,31).text }
  if ($did = 33) { set %TopicFloodVar2 $did(ChannelProtection,33).text }
  if ($did = 37) { set %NickFloodVar1 $did(ChannelProtection,37).text }
  if ($did = 39) { set %NickFloodVar2 $did(ChannelProtection,39).text }
  if ($did = 43) { set %ModeFloodVar1 $did(ChannelProtection,43).text }
  if ($did = 45) { set %ModeFloodVar2 $did(ChannelProtection,45).text }
  if ($did = 49) { set %JoinFloodVar1 $did(ChannelProtection,49).text }
  if ($did = 51) { set %JoinFloodVar2 $did(ChannelProtection,51).text }
  if ($did = 56) { set %MaxOpVar1 $did(ChannelProtection,56).text }
  if ($did = 58) { set %MaxOpVar2 $did(ChannelProtection,58).text }
  if ($did = 62) { set %MaxDeopVar1 $did(ChannelProtection,62).text }
  if ($did = 64) { set %MaxDeopVar2 $did(ChannelProtection,64).text }
  if ($did = 68) { set %MaxKickVar1 $did(ChannelProtection,68).text }
  if ($did = 70) { set %MaxKickVar2 $did(ChannelProtection,70).text }
  if ($did = 74) { set %MaxBanVar1 $did(ChannelProtection,74).text }
  if ($did = 76) { set %MaxBanVar2 $did(ChannelProtection,76).text }
  if ($did = 89) { set %AutoSetOnJoinMode $did(ChannelProtection,89).text }
}
on *:dialog:ChannelProtection:init:0:{
  dialog -t ChannelProtection Dreamer§ §cript =[ Impostazioni Canali ]=
  if ($group(#TextFloodcanale) = on) { did -c ChannelProtection 4 }
  if (!%TextFloodVar1) { set %TextFloodVar1 4 } | did -a ChannelProtection 6 %TextFloodVar1
  if (!%TextFloodVar2) { set %TextFloodVar2 5 } | did -a ChannelProtection 8 %TextFloodVar2
  if ($group(#actionfloodcanale) = on) { did -c ChannelProtection 10 }
  if (!%actionFloodVar1) { set %ActionFloodVar1 4 } | did -a ChannelProtection 12 %ActionFloodVar1
  if (!%actionFloodVar2) { set %ActionFloodVar2 5 } | did -a ChannelProtection 14 %ActionFloodVar2
  if ($group(#noticefloodcanale) = on) { did -c ChannelProtection 16 }
  if (!%noticeFloodVar1) { set %NoticeFloodVar1 4 } | did -a ChannelProtection 18 %NoticeFloodVar1
  if (!%noticeFloodVar2) { set %NoticeFloodVar2 5 } | did -a ChannelProtection 20 %NoticeFloodVar2
  if ($group(#ctcpfloodcanale) = on) { did -c ChannelProtection 22 }
  if (!%CtcpFloodVar1) { set %CtcpFloodVar1 4 } | did -a ChannelProtection 24 %CtcpFloodVar1
  if (!%CtcpFloodVar2) { set %CtcpFloodVar2 5 } | did -a ChannelProtection 26 %CtcpFloodVar2
  if ($group(#topicfloodcanale) = on) { did -c ChannelProtection 29 }
  if (!%topicFloodVar1) { set %topicFloodVar1 4 } | did -a ChannelProtection 31 %topicFloodVar1
  if (!%topicFloodVar2) { set %topicFloodVar2 5 } | did -a ChannelProtection 33 %topicFloodVar2
  if ($group(#nickfloodcanale) = on) { did -c ChannelProtection 35 }
  if (!%nickFloodVar1) { set %nickFloodVar1 4 } | did -a ChannelProtection 37 %nickFloodVar1
  if (!%nickFloodVar2) { set %nickFloodVar2 5 } | did -a ChannelProtection 39 %nickFloodVar2
  if ($group(#modefloodcanale) = on) { did -c ChannelProtection 41 }
  if (!%modeFloodVar1) { set %modeFloodVar1 4 } | did -a ChannelProtection 43 %modeFloodVar1
  if (!%modeFloodVar2) { set %modeFloodVar2 5 } | did -a ChannelProtection 45 %modeFloodVar2
  if ($group(#joinfloodcanale) = on) { did -c ChannelProtection 47 }
  if (!%joinFloodVar1) { set %JoinFloodVar1 4 } | did -a ChannelProtection 49 %JoinFloodVar1
  if (!%joinFloodVar2) { set %JoinFloodVar2 5 } | did -a ChannelProtection 51 %JoinFloodVar2
  if ($group(#maxop) = on) { did -c ChannelProtection 54 }
  if (!%MaxOpVar1) { set %MaxOpVar1 4 } | did -a ChannelProtection 56 %MaxOpVar1
  if (!%MaxOpVar2) { set %MaxOpVar2 5 } | did -a ChannelProtection 58 %MaxOpVar2
  if ($group(#maxdeop) = on) { did -c ChannelProtection 60 }
  if (!%MaxDeopVar1) { set %MaxDeopVar1 4 } | did -a ChannelProtection 62 %MaxDeopVar1
  if (!%MaxDeopVar2) { set %MaxDeopVar2 5 } | did -a ChannelProtection 64 %MaxDeopVar2
  if ($group(#maxkick) = on) { did -c ChannelProtection 66 }
  if (!%MaxKickVar1) { set %MaxKickVar1 4 } | did -a ChannelProtection 68 %MaxKickVar1
  if (!%MaxKickVar2) { set %MaxKickVar2 5 } | did -a ChannelProtection 70 %MaxkickVar2
  if ($group(#maxban) = on) { did -c ChannelProtection 72 }
  if (!%MaxBanVar1) { set %MaxbanVar1 4 } | did -a ChannelProtection 74 %MaxBanVar1
  if (!%MaxBanVar2) { set %MaxBanVar2 5 } | did -a ChannelProtection 76 %MaxBanVar2
  if ($group(#KillWatch) = on) { did -c ChannelProtection 79 }
  if ($group(#SwearKick) = on) { did -c ChannelProtection 80 }
  if ($group(#OffensiveNick) = on) { did -c ChannelProtection 81 }
  if ($group(#Invit) = on) { did -c ChannelProtection 82 }
  if ($group(#ServOp) = on) { did -c ChannelProtection 83 }
  if ($group(#OpCycle) = on) { did -c ChannelProtection 84 }
  if (%SwearKickOp = ON) { did -c ChannelProtection 86 }
  if (%JoinInvite = ON) { did -c ChannelProtection 96 }
  if (%AutoSetOnJoin = ON) { did -c ChannelProtection 91 }
  if (!%AutoSetOnJoinMode) { set %%AutoSetOnJoinMode +nst } | did -a ChannelProtection 89 %AutoSetOnJoinMode
}

alias SetupFrasi { if (!$dialog(SetupFrasi)) { dialog -m SetupFrasi SetupFrasi } | else halt }
dialog SetupFrasi {
  title "Setup Frasi e Messaggi"
  size -1 -1 295 142
  option dbu
  tab "Frasi di Kick", 1, 0 0 293 140
  text "Text Flood:", 3, 3 17 40 10, tab 1
  text "Action Flood:", 5, 3 27 40 10, tab 1
  text "Notice Flood:", 7, 3 38 40 9, tab 1
  text "Ctcp Flood:", 9, 3 47 40 10, tab 1
  text "Topic Flood:", 11, 3 57 40 10, tab 1
  text "Nick Flood:", 13, 3 67 40 10, tab 1
  text "Mode Flood:", 15, 3 77 40 10, tab 1
  text "Join Flood:", 17, 3 87 40 10, tab 1
  text "Max Op:", 19, 151 17 40 10, tab 1
  text "Max Deop:", 21, 151 27 40 10, tab 1
  text "Max Kick:", 23, 151 37 40 10, tab 1
  text "Max Ban:", 25, 151 47 40 10, tab 1
  text "Swear Kick:", 27, 151 57 40 10, tab 1
  text "Pubblicita':", 29, 151 67 40 10, tab 1
  text "Offensive:", 31, 151 77 40 10, tab 1
  text "Server Op:", 33, 151 87 40 10, tab 1
  edit "", 4, 45 17 95 10, tab 1 autohs
  edit "", 6, 45 27 95 10, tab 1 autohs
  edit "", 8, 45 37 95 10, tab 1 autohs
  edit "", 10, 45 47 95 10, tab 1 autohs
  edit "", 12, 45 57 95 10, tab 1 autohs
  edit "", 16, 45 77 95 10, tab 1 autohs
  edit "", 18, 45 87 95 10, tab 1 autohs
  edit "", 14, 45 67 95 10, tab 1 autohs
  edit "", 20, 193 17 95 10, tab 1 autohs
  edit "", 22, 193 27 95 10, tab 1 autohs
  edit "", 24, 193 37 95 10, tab 1 autohs
  edit "", 26, 193 47 95 10, tab 1 autohs
  edit "", 28, 193 57 95 10, tab 1 autohs
  edit "", 30, 193 67 95 10, tab 1 autohs
  edit "", 32, 193 77 95 10, tab 1 autohs
  edit "", 34, 193 87 95 10, tab 1 autohs
  tab "Mesaggi automatici", 2
  check "Grazie per Op", 35, 3 17 60 10, tab 2
  check "Grazie per HalfOp", 37, 3 27 60 10, tab 2
  check "Grazie per Voice", 39, 3 37 60 10, tab 2
  check "Saluto al canale", 44, 3 47 60 10, tab 2
  check "Saluto a chi entra", 46, 3 57 60 10, tab 2
  check "Saluto a chi esce", 48, 3 67 60 10, tab 2
  edit "", 36, 65 17 108 10, tab 2 autohs
  edit "", 38, 65 27 108 10, tab 2 autohs
  edit "", 40, 65 37 108 10, tab 2 autohs
  edit "", 45, 65 47 108 10, tab 2 autohs
  edit "", 47, 65 57 108 10, tab 2 autohs
  edit "", 49, 65 67 108 10, tab 2 autohs
  button "Resetta Default", 41, 7 121 50 15
  button "Lista Msg Quit", 43, 60 121 50 15
  button "OK", 50, 166 121 35 15, default ok
  button "Version Reply", 51, 113 121 50 15
}

on *:dialog:SetupFrasi:sclick:*:{
  if ($did = 1) || ($did = 2) { sopen }
  if ($did = 42) { if ($did(42).state = 1) { set %QuitMsgSpam ON | son } | else { set %QuitMsgSpam OFF | soff } }
  if ($did = 50) { sclose } 
  if ($did = 41) { ResettaFrasi | sopen }
  if ($did = 43) { run Dati\QuitMsg.txt }
  if ($did = 35) { if ($did(SetupFrasi,35).state = 1) { set %RingrOp ON | son } | else { set %RingrOp OFF | soff } }
  if ($did = 37) { if ($did(SetupFrasi,37).state = 1) { set %RingrHalfOp ON | son } | else { set %RingrHalfOp OFF | soff } }
  if ($did = 39) { if ($did(SetupFrasi,39).state = 1) { set %RingrVoice ON | son } | else { set %RingrVoice OFF | soff } }
  if ($did = 44) { if ($did(SetupFrasi,44).state = 1) { set %SalutoChan ON | son } | else { set %SalutoChan OFF | soff } }
  if ($did = 46) { if ($did(SetupFrasi,46).state = 1) { set %SalutoJoin ON | son } | else { set %SalutoJoin OFF | soff } }
  if ($did = 48) { if ($did(SetupFrasi,48).state = 1) { set %SalutoPart ON | son } | else { set %SalutoPart OFF | soff } }
  if ($did = 51) { sopen | VersionReply }
}
on *:dialog:SetupFrasi:edit:*:{
  if ($did = 4) { set %TextFloodMsg $did(SetupFrasi,4).text }
  if ($did = 6) { set %actionFloodMsg $did(SetupFrasi,6).text }
  if ($did = 8) { set %noticeFloodMsg $did(SetupFrasi,8).text }
  if ($did = 10) { set %CtcpFloodMsg $did(SetupFrasi,10).text }
  if ($did = 12) { set %topicFloodMsg $did(SetupFrasi,12).text }
  if ($did = 14) { set %nickFloodMsg $did(SetupFrasi,14).text }
  if ($did = 16) { set %modeFloodMsg $did(SetupFrasi,16).text }
  if ($did = 18) { set %joinFloodMsg $did(SetupFrasi,18).text }
  if ($did = 20) { set %MaxOpMsg $did(SetupFrasi,20).text }
  if ($did = 22) { set %MaxDeopMsg $did(SetupFrasi,22).text }
  if ($did = 24) { set %MaxKickMsg $did(SetupFrasi,24).text }
  if ($did = 26) { set %MaxBanMsg $did(SetupFrasi,26).text }
  if ($did = 28) { set %SwearKickMsg $did(SetupFrasi,28).text }
  if ($did = 30) { set %InvitMsg $did(SetupFrasi,30).text }
  if ($did = 32) { set %OffensiveNickMsg $did(SetupFrasi,32).text }
  if ($did = 34) { set %ServOpMsg $did(SetupFrasi,34).text }
  if ($did = 36) { set %RingrOpMsg $did(SetupFrasi,36).text }
  if ($did = 38) { set %RingrHalfOpMsg $did(SetupFrasi,38).text }
  if ($did = 40) { set %RingrVoiceMsg $did(SetupFrasi,40).text }
  if ($did = 45) { set %SalutoChanMsg $did(SetupFrasi,45).text }
  if ($did = 47) { set %SalutoJoinMsg $did(SetupFrasi,47).text }
  if ($did = 49) { set %SalutoPartMsg $did(SetupFrasi,49).text }
}
on *:dialog:SetupFrasi:init:0:{
  dialog -t SetupFrasi  Setup Frasi e Messaggi
  if (!%TextFloodMsg) { set %TextFloodMsg 9,1RiLevATo TexT FLooD } | did -a SetupFrasi 4 %TextFloodMsg
  if (!%ActionFloodMsg) { set %ActionFloodMsg 9,1RiLevATo AcTioN FLooD } | did -a SetupFrasi 6 %actionFloodMsg
  if (!%NoticeFloodMsg) { set %noticeFloodMsg 9,1RiLevATo NoTicE FLooD } | did -a SetupFrasi 8 %noticeFloodMsg
  if (!%CtcpFloodMsg) { set %CtcpFloodMsg 9,1RiLevATo CTcP FLooD } | did -a SetupFrasi 10 %CtcpFloodMsg
  if (!%TopicFloodMsg) { set %topicFloodMsg 9,1RiLevATo ToPiC FLooD } | did -a SetupFrasi 12 %topicFloodMsg
  if (!%NickFloodMsg) { set %NickFloodMsg 9,1RiLevATo NicK FLooD } | did -a SetupFrasi 14 %nickFloodMsg
  if (!%ModeFloodMsg) { set %ModeFloodMsg 9,1RiLevATo MoDE FLooD } | did -a SetupFrasi 16 %modeFloodMsg
  if (!%JoinFloodMsg) { set %JoinFloodMsg 9,1RiLevATo JoiN FLooD } | did -a SetupFrasi 18 %joinFloodMsg
  if (!%MaxOpMsg) { set %MaxOpMsg 9,1Max Op PRoTecTioN } | did -a SetupFrasi 20 %maxopmsg
  if (!%MaxDeopMsg) { set %MaxDeopMsg 9,1Max Deop PRoTecTioN } | did -a SetupFrasi 22 %maxdeopmsg
  if (!%MaxKickMsg) { set %MaxKickMsg 9,1Max KicK PRoTecTioN } | did -a SetupFrasi 24 %maxkickmsg
  if (!%MaxBanMsg) { set %MaxBanMsg 9,1Max BaN PRoTecTioN } | did -a SetupFrasi 26 %maxbanmsg
  if (!%SwearKickMsg) { set %SwearKickMsg 9,1LinGuaGGio non ToLLeRaTo } | did -a SetupFrasi 28 %swearkickmsg
  if (!%invitmsg) { set %invitmsg 9,1No PuBBLiciTA' } | did -a SetupFrasi 30 %invitmsg
  if (!%OffensiveNickMsg) { set %OffensiveNickMsg 9,1NicKNaMe OffeNsiVo } | did -a SetupFrasi 32 %OffensiveNickMsg
  if (!%ServOpMsg) { set %ServOpMsg 9,1SeRveR Op PRoTecTioN } | did -a SetupFrasi 34 %ServOpMsg
  if (!%RingrOpMsg) { set %RingrOpMsg GraZie x l'op8 $ $+ nick !! } | did -a SetupFrasi 36 %RingrOpMsg
  if (!%RingrHalfOpMsg) { set %RingrHalfOpMsg 9Grazie x il +h !! } | did -a SetupFrasi 38 %RingrHalfOpMsg
  if (!%RingrVoiceMsg) { set %RingrVoiceMsg TnX x il +v8 $ $+ nick !! } | did -a SetupFrasi 40 %RingrVoiceMsg
  if (!%RingrOp) { set %RingrOp ON } | if (!%RingrHalfOp) { set %RingrHalfOp ON } | if (!%RingrVoice) { set %RingrVoice ON }
  if (%RingrOp = ON) { did -c SetupFrasi 35 } | if (%RingrHalfOp = ON) { did -c SetupFrasi 37 } | if (%RingrVoice = ON) { did -c SetupFrasi 39 }
  if (!%QuitMsgSpam) { set %QuitMsgSpam ON } | if (%QuitMsgSpam = ON) { did -c SetupFrasi 42 }
  if (%SalutoChan = on) { did -c SetupFrasi 44 } | if (%SalutoJoin = on) { did -c SetupFrasi 46 } | if (%SalutoPart = on) { did -c SetupFrasi 48 }
  if (!%SalutoChanMsg) { set %SalutoChanMsg 9,1Cyao, un saluto a tutto il canale! } | did -a SetupFrasi 45 %SalutoChanMsg
  if (!%SalutoJoinMsg) { set %SalutoJoinMsg 9,1Ciao, Sei il benvenuto... } | did -a SetupFrasi 47 %SalutoJoinMsg
  if (!%SalutoPartMsg) { set %SalutoPartMsg 9,1Ciao, Torna a trovarci presto... } | did -a SetupFrasi 49 %SalutoPartMsg
}

alias RegistraChan { cs register $chan $$?="Inserisci la password del canale:" $$?="inserisci una descrizione per il canale:"
  cs set $chan PROTECT ON | cs set $chan mlock +nt | cs set $chan keeptopic ON
  cs set $chan opguard ON
}

;@@@@@@@@@@ Femmine Scan @@@@@@@@@
alias FemmineScan { .disable #Who | .enable #FemmineScan | .who #IrcNapoli }
#FemmineScan off
raw 352:*:{
  var %id $remove( $3 , ~, -, +, ^, _ )
  if ($6 = $me) || ($6 isnotify) halt
  if (%id isnum) && ($10 = F,) { cline 13 #IrcNapoli $6 }
  if (%id isnum) && ($10 = M,) { cline 12 #IrcNapoli $6 }
  haltdef
}
raw 315:*: { .disable #FemmineScan | .enable #Who | haltdef }
#FemmineScan end

#TextFloodCanale off
on ^*@!:TEXT:*:#:{
  inc %TextFlood [ $+ [ $nick ] ] | .timer 1 %TextFloodVar2 unset %TextFlood [ $+ [ $nick ] ]
  if %TextFlood [ $+ [ $nick ] ] == %TextFloodVar1 { goto TextFlood }
  else goto end
  :TextFlood | unset %TextFlood [ $+ [ $nick ] ]
  kick $chan $nick %TextFloodMsg %kick
  :end
}
#TextFloodCanale end
;
#ActionFloodCanale off
on ^*@!:ACTION:*:#:{
  inc %actionflood [ $+ [ $nick ] ] | .timer 1 %actionFloodVar2 unset %actionflood [ $+ [ $nick ] ]
  if %actionflood [ $+ [ $nick ] ] == %actionFloodVar1 { goto actionflood }
  else goto end
  :actionflood | unset %actionflood [ $+ [ $nick ] ]
  kick $chan $nick %actionFloodMsg %kick
  :end
}
#ActionFloodCanale end
;
#NoticeFloodCanale off
on ^*@!:NOTICE:*:#:{
  inc %NoticeFlood [ $+ [ $nick ] ] | .timer 1 %noticeFloodVar2 unset %noticeflood [ $+ [ $nick ] ]
  if %NoticeFlood [ $+ [ $nick ] ] == %NoticeFloodVar1 { goto noticeflood }
  else goto end
  :noticeflood | unset %NoticeFlood [ $+ [ $nick ] ]
  kick $chan $nick %NoticeFloodMsg %kick
  :end
}
#NoticeFloodCanale end
;
#CtcpFloodCanale off
CTCP *@!:*:#:{
  inc %CtcpFlood [ $+ [ $nick ] ] | .timer 1 %CtcpFloodVar2 unset %CtcpFlood [ $+ [ $nick ] ]
  if %CtcpFlood [ $+ [ $nick ] ] == %CtcpFloodVar1 { goto ctcpflood }
  else goto end
  :CtcpFlood | unset %CtcpFlood [ $+ [ $nick ] ]
  kick $chan $nick %CtcpFloodMsg %kick
  :end
}
#CtcpFloodCanale end

#TopicFloodCanale off
on @1!:TOPIC:#:{
  inc %topicflood [ $+ [ $nick ] ] | .timer 1 %TopicFloodVar2 unset %topicflood [ $+ [ $nick ] ]
  if %topicflood [ $+ [ $nick ] ] == %TopicFloodVar1 { goto topicflood }
  else goto end
  :topicflood | unset %topicflood [ $+ [ $nick ] ]
  kick $chan $nick %topicFloodMsg %kick
  :end
}
#TopicFloodCanale end
;
#NickFloodCanale off
on *!:NICK:{
  if ( !%nickflood [ $+ [ $site ] ] ) { set %nickflood $+ $site 1 }
  if (%nickflood [ $+ [ $site ] ] >= %nickFloodVar1) {
    :next
    inc %nickflood.tmp 1
    if (!$comchan($newnick,%nickflood.tmp)) goto end
    if (($me isop $comchan($newnick,%nickflood.tmp)) && ($newnick ison $comchan($newnick,%nickflood.tmp))) { kick $comchan($newnick,%nickflood.tmp) $newnick %nickFloodMsg %kick }
    goto next
    :end | unset %nickflood.tmp | unset %nickflood $+ $site
  }
  else { inc %nickflood $+ $site 1 | .timer 1 %nickFloodVar2 unset %nickflood $+ $site }
}
#NickFloodCanale end
;
#ModeFloodCanale off
on @1!:MODE:#:{
  inc %modeflood [ $+ [ $nick ] ] | .timer 1 %modeFloodVar2 unset %modeflood [ $+ [ $nick ] ] 
  if %modeflood [ $+ [ $nick ] ] == %modeFloodVar1 { goto modeflood }
  else goto end
  :modeflood | unset %ModeFlood [ $+ [ $nick ] ]
  kick $chan $nick %ModeFloodMsg %kick
  :end
}
#ModeFloodCanale end
;
#JoinFloodCanale off
on @!*:JOIN:#:{
  inc %JoinFlood.tmp [ $+ [ $chan [ $+ [ $site ] ] ] ] | .timer 1 %JoinFloodVar2 unset %joinflood.tmp [ $+ [ $chan [ $+ [ $site ] ] ] ]
  if %JoinFlood.tmp [ $+ [ $chan [ $+ [ $site ] ] ] ] == %JoinFloodVar1 { goto joinflood }
  else goto end
  :JoinFlood | unset %JoinFlood.tmp [ $+ [ $chan [ $+ [ $site ] ] ] ]
  ban $chan $nick 2 | kick $chan $nick %JoinFloodMsg %kick
  :end
}
#JoinFloodCanale end
#MaxOp off
on @1!:OP:#:{
  inc %maxop [ $+ [ $nick ] ] | .timer 1 %maxopvar2 unset %maxop [ $+ [ $nick ] ]
  if %maxop [ $+ [ $nick ] ] == %maxopvar1 { goto maxop }
  else goto end
  :maxop | unset %maxop [ $+ [ $nick ] ]
  kick $chan $nick %MaxOpMsg %Kick | DGMsg -c Warning Tentativo di Max Op su $chan da parte di $nick (4 $+ $address $+ 9) | .ghplay alert.wav
  :end
}
#MaxOp end
;
#MaxDeop off
on @1!:DEOP:#:{
  inc %MaxDeop [ $+ [ $nick ] ] | .timer 1 %MaxDeopVar2 unset %MaxDeop [ $+ [ $nick ] ]
  if %MaxDeop [ $+ [ $nick ] ] == %MaxDeopVar1 { goto MaxDeop }
  else goto end
  :MaxDeop | unset %MaxDeop [ $+ [ $nick ] ]
  kick $chan $nick %MaxDeopMsg %kick | DGMsg -c Warning Tentativo di Max Deop su $chan da parte di $nick (4 $+ $address $+ 9) | .ghplay alert.wav
  :end
}
#MaxDeop end
;
#maxkick off
on @1!:KICK:#:{
  inc %maxkick [ $+ [ $nick ] ] | .timer 1 %maxkickvar2 unset %maxkick [ $+ [ $nick ] ]
  if %maxkick [ $+ [ $nick ] ] == %maxkickvar1 { goto maxkick }
  else goto end
  :maxkick | unset %maxkick [ $+ [ $nick ] ]
  kick $chan $nick %maxkickmsg %kick | DGMsg -c Warning Tentativo di Max Kick su $chan da parte di $nick (4 $+ $address $+ 9) | .ghplay alert.wav
  :end
}
#maxkick end
;
#MaxBan off
on @1!:BAN:#:{
  inc %maxban [ $+ [ $nick ] ] | .timer 1 %maxbanvar2 unset %maxban [ $+ [ $nick ] ]
  if %maxban [ $+ [ $nick ] ] == %maxbanvar1 { goto maxban }
  else goto end
  :maxban | unset %maxban [ $+ [ $nick ] ]
  kick $chan $nick %maxbanmsg %kick | DGMsg -c Warning Tentativo di Max Ban su $chan da parte di $nick (4 $+ $address $+ 9) | .splay alert.wav
  :end
}
#MaxBan end

#OpCycle on
on *!:PART:*:{ if ($nick($chan,0) = 2) && ($me !isop $chan) && (r !isin $gettok($chan($chan).mode,1,32)) { hop -cn $chan † | DGMsg -c Cycle Cycle per Op su $chan ...  } }

on *!:QUIT:{
  var %cc0 = 0 | while (%cc0 < $comchan($nick,0)) { inc %cc0
    if ($nick($comchan($nick,%cc0),0) = 2) && ($me !isop $comchan($nick,%cc0)) && (r !isin $gettok($chan($comchan($nick,%cc0)).mode,1,32)) {
      hop -cn $comchan($nick,%cc0) | DGMsg -c Cycle Cycle per Op su $comchan($nick,%cc0) ...
    }
  }
}
#OpCycle end

#AntiCollide off
on ^1:QUIT:{
  if ( Killed isin $1- ) {
    if (K-Line isin $1-) { halt }
    rnick2 | .disable #AntiCollide | .timerAntiCollide 2 12 rnick2 | .timerCollisore 1 60 .enable #AntiCollide
    DGMsg -n Collide Probabile collide di4 $nick 13( $+ $1- $+ )
  }
}
#AntiCollide end

#SwearKick off
on @!1:text:*:#:{
  if (( stronz isin $1- ) || ( cazz isin $1- ) || ( puttan isin $1- ) || ( troia isin $1- )) { goto azione } 
  if (( mignott isin $1- ) || ( vaffancul isin $1- ) || ( bastard isin $1- ) || ( porcodi isin $1- ) || ( strunz isin $1- )) { goto azione }
  if (( fotti isin $1- ) || ( pompin isin $1- ) || ( sgualdrin isin $1- ) || ( merd isin $1- ) || ( sborr isin $1- )) { goto azione }
  else goto end
  :azione
  if ( $nick isop # ) && (%swearkickop = on) { kick $chan $nick %swearkickmsg %kick }
  :end
}
on @!1:notice:*:#:{
  if (( stronz isin $1- ) || ( cazz isin $1- ) || ( puttan isin $1- ) || ( troia isin $1- )) { goto azione }
  if (( mignott isin $1- ) || ( vaffancul isin $1- ) || ( bastard isin $1- ) || ( porcodi isin $1- ) || ( strunz isin $1- )) { goto azione }
  if (( fotti isin $1- ) || ( pompin isin $1- ) || ( sgualdrin isin $1- ) || ( merd isin $1- ) || ( sborr isin $1- )) { goto azione }
  else goto end
  :azione
  if ( $nick isop # ) && (%SwearKickOp = on) { kick $chan $nick %SwearKickMsg %kick }
  :end
}
on @!1:action:*:#:{
  if (( stronz isin $1- ) || ( cazz isin $1- ) || ( puttan isin $1- ) || ( troia isin $1- )) { goto azione }
  if (( mignott isin $1- ) || ( vaffancul isin $1- ) || ( bastard isin $1- ) || ( porcodi isin $1- ) || ( strunz isin $1- )) { goto azione }
  if (( fotti isin $1- ) || ( pompin isin $1- ) || ( sgualdrin isin $1- ) || ( merd isin $1- ) || ( sborr isin $1- )) { goto azione }
  else goto end
  :azione
  if ( $nick isop # ) && (%SwearKickOp = on) { kick $chan $nick %SwearKickMsg %kick }
  :end
}
#SwearKick end

#KillWatch off
on *:QUIT: { if (Killed isin $1) { DGMsg -n Kill_Info $nick ha ricevuto un kill con Messaggio: $1- | sinfo } }
#KillWatch end

#invit off
on @!1:TEXT:*#*:#: {
  if (( join isin $1- ) || ( come to isin $1- ) || ( tutti isin $1- ) || ( venite isin $1- )) { goto fuck }
  if (( invit isin $1- ) || ( vieni isin $1- ) || ( aspett isin $1- ) || ( entr isin $1- )) { goto fuck }
  else goto end
  :fuck | if (($nick !isop $chan) && ($chan !isin $1-)) kick $chan $nick %invitmsg %kick
  :end
}
on @!1:ACTION:*#*:#: {
  if (( join isin $1- ) || ( come to isin $1- ) || ( tutti isin $1- ) || ( venite isin $1- )) { goto fuck }
  if (( invit isin $1- ) || ( vieni isin $1- ) || ( aspett isin $1- ) || ( entr isin $1- )) { goto fuck }
  else goto end
  :fuck | if (($nick !isop $chan) && ($chan !isin $1-)) kick $chan $nick %invitmsg %kick
  :end
}
on @!1:NOTICE:*#*:#: {
  if (( join isin $1- ) || ( come to isin $1- ) || ( tutti isin $1- ) || ( venite isin $1- )) { goto fuck }
  if (( invit isin $1- ) || ( vieni isin $1- ) || ( aspett isin $1- ) || ( entr isin $1- )) { goto fuck }
  else goto end
  :fuck | if (($nick !isop $chan) && ($chan !isin $1-)) kick $chan $nick %invitmsg %kick
  :end
}
#invit end
#OffensiveNick off
on @!1:join:#:{
  if (( cazz isin $nick ) ||  ( vulva isin $nick ) || ( porc isin $nick ) || ( culo isin $nick )) { goto cambia }
  if (( merda isin $nick ) ||  ( stronz isin $nick ) || ( coglion isin $nick ) || ( minchia isin $nick )) { goto cambia }
  if (( puttana isin $nick ) || ( troia isin $nick ) || ( bastard isin $nick ) || ( fuck isin $nick )) { goto cambia }
  if (( pompin isin $nick ) || ( mignotta isin $nick ) || ( bitch isin isin $nick ) || ( fottiti isin $nick )) { goto cambia }
  if (( fottetevi isin $nick ) || ( segaiol isin $nick )) { goto cambia }
  else goto end
  :cambia | kick $chan $nick %OffensiveNickMsg %kick
  :end
}
#OffensiveNick end

#ServOp off
on @1:SERVEROP:#: {
  if ((%splitchan == $chan) && (%splitnicks == $1-)) { halt }
  if ($opnick == $me) || ($opnick isprotect) { goto end }
  if (+ooo isin $1-) { raw -q mode $chan -ooo $2 $3 $4 | goto end }
  if (+oo isin $1-) { raw -q mode $chan -oo $2 $3 | goto end }
  if (+o isin $1-) {
    if (!$4) { raw -q mode $chan -o $2 }
    else { raw -q mode $chan -oo $2 $4 }
    goto end
  }
  if (o isin $1-) { raw -q mode $chan -ooo $2 $3 $4 | goto end }
  if (i isin $1) || (l isin $1) { raw -q mode $chan -o $opnick | goto end }
  :end | set %splitchan $chan | set %splitnicks $1- |  .timersplitz 1 10 set %splitnicks ?? | .timersplitx 1 10 set %splitchan ?? | halt
}
#ServOp end
