on *:dialog:grazie:init:0: {
  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname
  if (%unome == 1) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,72,170)
    dll $mdx SetColor 138 background $rgb(0,0,0)
    dll $mdx SetColor 138 textbg $rgb(0,0,0)
    dll $mdx SetColor 138 text $rgb(255,255,255)
  }
  if (%unome == 2) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,0,95)
    dll $mdx SetColor 138 background $rgb(0,0,0)
    dll $mdx SetColor 138 textbg $rgb(0,0,0)
    dll $mdx SetColor 138 text $rgb(255,255,255)
  }
  loadbuf -o grazie 138 txt\grazie.txt
}
alias automess { /dialog -m stre.mess stre.mess |  if ( %cc181p == on ) { $tunder TDDialog $dialog(stre.mess).hwnd > 2 } }

dialog stre.mess {
  title "Automess by L]e[G"
  size -1 -1 490 350
  box "Auto mess", 2, 10 10 470 335
  text "Imposta parole on text e frasi di risposta", 3, 42 30 195 12
  text "a = Abilita", 4, 410 30 50 12
  edit "", 38, 380 25 20 20
  text "1.", 5, 15 58 10 12
  edit "", 6, 42 55 50 20, autohs
  edit "", 39, 100 55 300 20, autohs
  text "2.", 7, 15 78 10 12
  edit "", 8, 42 75 50 20, autohs
  edit "", 40, 100 75 300 20, autohs
  text "3.", 9, 15 98 10 12
  edit "", 10, 42 95 50 20, autohs
  edit "", 41, 100 95 300 20, autohs
  text "4.", 11, 15 118 10 12
  edit "", 12, 42 115 50 20, autohs
  edit "", 42, 100 115 300 20, autohs  
  text "5.", 13, 15 138 10 12
  edit "", 14, 42 135 50 20, autohs
  edit "", 43, 100 135 300 20, autohs
  text "6.", 15, 15 158 10 12
  edit "", 16, 42 155 50 20, autohs
  edit "", 44, 100 155 300 20, autohs
  text "7.", 17, 15 178 10 12
  edit "", 18, 42 175 50 20, autohs
  edit "", 45, 100 175 300 20, autohs
  text "8.", 19, 15 198 10 12
  edit "", 20, 42 195 50 20, autohs
  edit "", 46, 100 195 300 20, autohs
  text "9.", 21, 15 218 10 12
  edit "", 22, 42 215 50 20, autohs
  edit "", 47, 100 215 300 20, autohs
  text "10.", 23, 15 238 10 12
  edit "", 34, 42 235 50 20, autohs
  edit "", 48, 100 235 300 20, autohs
  text "Chan:", 52, 15 278 27 12
  edit "", 53, 50 276 100 20, autohs
  button "&OK", 49, 40 310 60 30, ok default
  button "&Cancella", 50, 110 310 65 30, cancel
  button "&Applica", 51, 185 310 60 30
}
on *:dialog:stre.mess:init:0: {
  dll dlls/mdx/mdx.dll SetMircVersion $version
  dll dlls/mdx/mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    /dll dlls\mdx\mdx.dll SetColor $dname 49,50,51 background $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname  3,4,5,7,9,11,13,15,17,19,21,23,52 background $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname  3,4,5,7,9,11,13,15,17,19,21,23,52 textbg $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname  38,39,6,8,40,10,41,12,42,14,43,16,44,18,45,20,46,22,47,34,48,53  background $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname  38,39,6,8,40,10,41,12,42,14,43,16,44,18,45,20,46,22,47,34,48,53 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 3,4,38,5,6,39,7,8,40,9,10,41,11,12,42,13,14,43,15,16,44,17,18,45,19,20,46,21,22,47,23,34,48,52,53 text $rgb(255,255,255)
    dll dlls/mdx/mdx.dll  SetColor $dname 2 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    /dll dlls\mdx\mdx.dll SetColor $dname 49,50,51 background $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname  3,4,5,7,9,11,13,15,17,19,21,23,52 background $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname  3,4,5,7,9,11,13,15,17,19,21,23,52 textbg $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname  38,39,6,8,40,10,41,12,42,14,43,16,44,18,45,20,46,22,47,34,48,53  background $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname  38,39,6,8,40,10,41,12,42,14,43,16,44,18,45,20,46,22,47,34,48,53 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname 3,4,5,7,9,11,13,15,17,19,21,23,52 textbg $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor 3,4,38,5,6,39,7,8,40,9,10,41,11,12,42,13,14,43,15,16,44,17,18,45,19,20,46,21,22,47,23,34,48,52,53 text $rgb(255,255,255)
    dll dlls/mdx/mdx.dll  SetColor $dname 2 background $rgb(196,196,196)
  }
  did -a stre.mess 6 %parola1 
  did -a stre.mess 8 %parola2
  did -a stre.mess 10 %parola3
  did -a stre.mess 12 %parola4
  did -a stre.mess 14 %parola5
  did -a stre.mess 16 %parola6
  did -a stre.mess 18 %parola7
  did -a stre.mess 20 %parola8
  did -a stre.mess 22 %parola9
  did -a stre.mess 34 %parola0 
  did -a stre.mess 39 %frase1 
  did -a stre.mess 40 %frase2
  did -a stre.mess 41 %frase3
  did -a stre.mess 42 %frase4
  did -a stre.mess 43 %frase5
  did -a stre.mess 44 %frase6
  did -a stre.mess 45 %frase7
  did -a stre.mess 46 %frase8
  did -a stre.mess 47 %frase9
  did -a stre.mess 48 %frase10 
  did -a stre.mess 53 %chanmess
  did -a stre.mess 38 %attivo999999999999  
}
on *:dialog:stre.mess:sclick:49:{
  set %parola1 $did(stre.mess,6)
  set %parola2 $did(stre.mess,8)
  set %parola3 $did(stre.mess,10)
  set %parola4 $did(stre.mess,12)
  set %parola5 $did(stre.mess,14)
  set %parola6 $did(stre.mess,16)
  set %parola7 $did(stre.mess,18)
  set %parola8 $did(stre.mess,20)
  set %parola9 $did(stre.mess,22)
  set %parola10 $did(stre.mess,34)
  set %frase1 $did(stre.mess,39)
  set %frase2 $did(stre.mess,40)
  set %frase3 $did(stre.mess,41)
  set %frase4 $did(stre.mess,42)
  set %frase5 $did(stre.mess,43)
  set %frase6 $did(stre.mess,44)
  set %frase7 $did(stre.mess,45)
  set %frase8 $did(stre.mess,46)
  set %frase9 $did(stre.mess,47)
  set %frase10 $did(stre.mess,48)
  set %chanmess $did(stre.mess,53)
  set %attivo999999999999 $did(stre.mess,38)
}
on *:dialog:stre.mess:sclick:50:{
  set %parola1 $did(stre.mess,6)
  set %parola2 $did(stre.mess,8)
  set %parola3 $did(stre.mess,10)
  set %parola4 $did(stre.mess,12)
  set %parola5 $did(stre.mess,14)
  set %parola6 $did(stre.mess,16)
  set %parola7 $did(stre.mess,18)
  set %parola8 $did(stre.mess,20)
  set %parola9 $did(stre.mess,22)
  set %parola10 $did(stre.mess,34)
  set %frase1 $did(stre.mess,39)
  set %frase2 $did(stre.mess,40)
  set %frase3 $did(stre.mess,41)
  set %frase4 $did(stre.mess,42)
  set %frase5 $did(stre.mess,43)
  set %frase6 $did(stre.mess,44)
  set %frase7 $did(stre.mess,45)
  set %frase8 $did(stre.mess,46)
  set %frase9 $did(stre.mess,47)
  set %frase10 $did(stre.mess,48)
  set %chanmess $did(stre.mess,53)
  set %attivo999999999999 $did(stre.mess,38)
}
dialog -l barza1 {
  title "Whois Flood By L]e[G"
  size -1 -1 146 110
  option dbu
  box "Protezione dal Whois Flood", 1, 4 6 140 94
  check "", 2, 48 17 6 6, flat
  text "Attiva", 22, 58 17 14 6
  button "Ok", 5, 57 85 32 12, ok
  Text "Se ti fanno whois  per", 3, 25 35 52 6
  edit "", 4, 90 32 10 10, autohs
  Text "volte in", 6, 15 50 20 6
  edit "", 9, 33 47 10 10, autohs
  Text "secondi mandi un notice d'avviso , al", 10, 45 50 87 6
  edit "", 7, 25 68 10 10, autohs 
  Text "Lo killi (il tutto se sei IRCOp)", 8, 40 71 67 6
}

Alias wprot { /dialog -m barza1 barza1 |  if ( %cc181p == on ) { $tunder TDDialog $dialog(barza1).hwnd > 2 } }


on *:DIALOG:barza1:sclick:2: { Set %cc181 $did(2) }
on *:dialog:barza1:edit:4:{ %wvoly = $did(4) }
on *:dialog:barza1:edit:7:{ %wert = $did(7) }
on *:dialog:barza1:edit:9:{ %timp = $did(9) }
on *:dialog:barza1:init:*: {
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(255,134,0)
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 2,22,3,4,6,7,8,9,10 background bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 2,3,6,8,10,22 textbg $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 4,9,7 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 2,22,3,4,6,7,8,9,10 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(255,255,255)
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 2,22,3,4,6,7,8,9,10 background bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 2,3,6,8,10,22 textbg $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 4,9,7 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 2,22,3,4,6,7,8,9,10 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,0,95)
  }
  if %cc181 = ON { did -c barza1 2 }  
  did -a $dname 4 %wvoly
  did -a $dname 7 %wert
  did -a $dname 9 %timp
}

on *:dialog:barza1:sclick:5: { 
  if ($did(barza1,2).state = 1) { %cc181 = on } | else { %cc181 = off }

}
on *:SNOTICE:*did a /whois on you*: {
  .inc -u $+ %timp $+(%,contatore.whois,$cid,$address($2,4))
  if ( $eval($+(%,contatore.whois,$cid,$address($2,4)),2) = %wvoly )  && ( %cc181 == on ) { .notice $2 Basta WhoiSSarMi -.- }
  if ( $eval($+(%,contatore.whois,$cid,$address($2,4)),2) = %wert ) && ( %cc181 == on ) { .kill $2 Whois Flooding | set $+ %timp $+(%,contatore.whois,$cid,$address($2,4)),2) 0 }
}
dialog -l barzał {
  title "Supporto ipv6 all'avvio Script"
  size -1 -1 146 50
  option dbu
  box "Abilita supporto ipv6", 1, 18 6 109 24
  check "", 2, 48 17 6 6, flat
  text "Attiva", 3, 58 17 14 6
  button "Ok", 5, 57 35 32 12, ok
}
Alias ipv6 { /dialog -m barzał barzał |  if ( %cc181p == on ) { $tunder TDDialog $dialog(barzał).hwnd > 10 } }


on *:DIALOG:barzał:sclick:2: { Set %mircv6load $did(2) }


on *:dialog:barzał:init:*: {
  dll dlls/mdx/mdx.dll SetMircVersion $version
  dll dlls/mdx/mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(255,134,0)
    dll dlls/mdx/mdx.dll SetColor 2,3 background $dname bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 2,3 textbg $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor 2,3 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(196,196,196)
    dll dlls/mdx/mdx.dll SetColor 2,3 background $dname bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 2,3 textbg $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor 2,3 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,0,95)
  }
  if %mircv6load = ON { did -c barzał 2 }  
}

on *:dialog:barzał:sclick:5: { 
  if ($did(barzał,2).state = 1) { %mircv6load = on } | else { %mircv6load = off }
}

alias raw-cmnds  { dialog -mo IRCoper IRCoper |  if ( %cc181p == on ) { $tunder TDDialog $dialog(ircoper).hwnd > 2 } }
alias serverhasher { dialog -mo serverhash serverhash | if ( %cc181p == on ) { $tunder TDDialog $dialog(serverhash).hwnd > 10 } }
alias serverconnecter { dialog -mo serverconnect serverconnect | if ( %cc181p == on ) { $tunder TDDialog $dialog(serverconnect).hwnd > 10 } }
alias serverakiller { gline $$?="Inserisci Nick" $$?="Inserire Reason" }
alias serversquiter { squit $$?="Inserisci Network" $$?="Inserire Reason" }

; Main Menu System
dialog IRCoper {
  icon $mircdir\tema\icona.ico, 0
  title "IRCop Helper"
  option dbu
  size 542 22 219 112

  box "User Action",1,1 3 55 42
  button "Kill User", 2,4 11 51 8
  button "KLine User", 3,4 19 51 8
  button "UnKLine User", 4,4 27 51 8
  button "ZLine", 5,4 35 51 8

  box "Message IRCop",6,1 45 55 42
  button "WallOps", 7,4 53 51 8
  button "LocOps", 8,4 61 51 8
  button "GlobOps", 9,4 69 51 8
  button "ChatOps", 10,4 77 51 8

  box "Server Related", 11,57 3 53 50
  button "Rehash", 12,58 11 51 8
  button "Connect", 13,58 19 51 8
  button "Squit", 14,58 27 51 8
  button "Restart", 15,58 35 51 8
  button "Stop Server",16,58 43 51 8

  box "Modes(Server/User)",17,57 53 53 34
  button "User Modes", 18,57 61 51 8
  button "Stats",19,57 69 51 8
  button "Set (Server)",20,57 77 51 8

  box "Chanserv Cmds", 21,111 3 53 42
  button "Getpass", 22,112 11 51 8
  button "Forbid", 23,112 19 51 8
  button "Suspend", 24,112 27 51 8
  button "Unsuspend", 25,112 35 51 8

  box "Operserv Cmds",26,111 45 53 42
  button "Global Message",27,112 53 51 8
  button "Chg Channel Mode",28,112 61 51 8
  button "Kick User",29,112 69 51 8
  button "Gline",30,112 77 51 8

  box "Nickserv Cmds",31,165 3 53 84
  button "Drop Nick",32,166 11 51 8
  button "Getpass",33,166 19 51 8
  button "Forbid",34,166 27 51 8
  button "Suspend",35,166 35 51 8
  button "UnSuspend",36,166 43 51 8
  button "SetAuth",37,166 53 51 8
  button "GetAuth",38,166 61 51 8
  button "ClearAuth",39,166 69 51 8
  button "Set", 40,166 77 51 8

  button "SA (JOIN)"41,10 89 51 8
  button "SA (MODE)"42,84 89 51 8
  button "EXIT"43,160 89 51 8
  text "Arcan]G[elo 2", 44, 78 102 70 8, disable
}
on *:dialog:ircoper:init:*: {
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 44 background $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor 44 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,3,4,5,7,8,9,10,12,13,14,15,16,18,19,20,22,23,24,25,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 1,6,11,17,21,26,31 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 44 background $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor 44 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,3,4,5,7,8,9,10,12,13,14,15,16,18,19,20,22,23,24,25,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 1,6,11,17,21,26,31 background $rgb(196,196,196)
  }
}

on *:dialog:IRCoper:sclick:*:{
  if ($did == 2) {  /kill $$?="Enter User" $$?="Enter Reason" }
  if ($did == 3) {  /kline $$?="Enter Kline Time" $$?="Enter Nick/User Host" : $+ $$?="Enter Reason" }
  if ($did == 4) { /unkline $$?="Enter user@host" }
  if ($did == 5) {  /zline $$?="Enter Nick/IP" $$?="Enter Reason" }
  if ($did == 7) {  /wallops $$?="Enter Message" }
  if ($did == 8) {  /locops $$?="Enter Message" }
  if ($did == 9) {  /globops $$?="Enter Message" }
  if ($did == 10) {  /chatops $$?="Enter Message" }
  if ($did == 12) {  /serverhasher }
  if ($did == 13) {  /serverconnecter }
  if ($did == 14) {  /serversquiter }
  if ($did == 15) {  /restart $?="Enter Password" }
  if ($did == 16) {  /die $?="Enter Password" }
  if ($did == 18) {   /mode $me $$?="Enter Modes (e.g +c)" }
  if ($did == 19) {   /stats $$?="Enter Mode" }
  if ($did == 20) {   /raw set $$?="Enter Command" }
  if ($did == 22) {  /chanserv getpass $?="Enter Channel (e.g #Chat)" }
  if ($did == 23) {  /chanserv FORBID $?="Enter Channel (e.g #Chat)" }
  if ($did == 24) {  /chanserv SUSPEND $?="Enter Channel (e.g #Chat)" $?="Reason" }
  if ($did == 25) {  /chanserv UNSUSPEND $?="Enter Channel (e.g #Chat)" }
  if ($did == 27) {  /.msg OperServ GLOBAL $?="Enter Message" }
  if ($did == 28) {  /.msg OperServ MODE $?="Enter Channel (e.g #Chat)" $$?="Enter Modes (e.g +tn)" }
  if ($did == 29) {  /.msg OperServ KICK $?="Enter Channel (e.g #Chat)" $$?="Enter User/Nick" $$?="Enter Reason" }
  if ($did == 30) {  /serverakiller }
  if ($did == 31) { /dialog -x IRCoper }
  if ($did == 32) {  /.msg Nickserv DROPNICK $$?="Enter Nick" }
  if ($did == 33) {  /.msg Nickserv GETPASS $$?="Enter Nick" }
  if ($did == 34) {  /.msg Nickserv FORBID $$?="Enter Nick" }
  if ($did == 35) {  /.msg Nickserv SUSPEND $$?="Enter Nick" $$?="Enter Reason" }
  if ($did == 36) {  /.msg Nickserv UNSUSPEND $$?="Enter Nick" }
  if ($did == 37) {  /.msg Nickserv SETAUTH $$?="Enter Nick" }
  if ($did == 38) {  /.msg Nickserv GETAUTH $$?="Enter Nick" }
  if ($did == 39) {  /.msg Nickserv CLEARAUTH $$?="Enter Nick" }
  if ($did == 40) {  /nickserv set $$?="Enter Nickname" $$?="Enter Options" | /nickservset }

  if ($did == 41) {  /sajoin $$?="Enter Channel" }
  if ($did == 42) { /samode $$?="Enter Channel" $$?="Enter Mode(s)" }
  if ($did == 43) { //dialog -x ircoper }
}

; Rehash Menu System
dialog serverhash {
  title "Rehasher"
  option dbu
  size -1 -1 58 70

  box "Server Rehasher",1,1 3 56 66
  button "Rehash IRCD", 2,4 11 51 8,default
  button "DNS", 3,4 19 51 8
  button "Temp KLines", 4,4 27 51 8
  button "Del Excess Memory", 5,4 35 51 8
  button "MOTD", 6,4 43 51 8
  button "Clears Throttles", 7,4 51 51 8
  button "- BACK -", 8,4 59 51 8,cancel
}
on *:dialog:serverhash:init:*: {
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor 1 textbg $dname bgcolor $rgb(0,72,170)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,3,4,5,6,7,8 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll  SetColor $dname 1 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor 1 textbg $dname bgcolor $rgb(0,0,95)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,3,4,5,6,7,8 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll  SetColor $dname 1 background $rgb(196,196,196)
  }
}
on *:dialog:serverhash:sclick:*:{
  if ($did == 2) { /rehash }
  if ($did == 3) { /rehash DNS  }
  if ($did == 4) { /rehash TKLINES  }
  if ($did == 5) { /rehash GC  }
  if ($did == 6) { /rehash MOTD  }
  if ($did == 7) { /rehash THROTTLES  }
  if ($did == 8) { /dialog -x serverhash }
}

; Connect Menu System
dialog serverconnect {
  title "IRCop SubMenu"
  option dbu
  size -1 -1 100 105

  box "Connect Split Servers",1,5 3 90 59
  text "Server [A]:",2,7 12 27 6
  edit $server,3,7 19 51 10,autohs
  text "Server  [B]:",4,7 30 28 6
  edit $network,5,7 38 51 10,autohs
  text "Port:                     (Default)",6,25 50 65 6
  edit "6667",7,38 50 20 9
  button "Connect",8,62 19 30 10,default
  button "BACK", 9,62 38 30 10,cancel

  box "Description:",10,5 63 90 40
  text "Server [A] is the server that tries to connect to Server [B]",11,6 69 99 20
  text "Server [B] is the server you wanna connect to.",12,6 84 99 20
}
on *:dialog:serverconnect:init:*: {
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 1,10 background $rgb(255,134,0)
    dll dlls/mdx/mdx.dll SetColor $dname 3,5,7,17 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname 2,4,6,11,12 textbg $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor 2,3,4,5,6,7,11,12 text $rgb(255,255,255) 
    /dll dlls\mdx\mdx.dll SetColor $dname 3,5,7,8,9 background $rgb(0,0,0)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,4,6,11,12 background $rgb(0,72,170)
  } 
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetMircVersion $version
    dll dlls/mdx/mdx.dll MarkDialog $dname
    dll dlls/mdx/mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls\mdx\mdx.dll  SetColor $dname 1,10 background $rgb(196,196,196)
    dll dlls/mdx/mdx.dll SetColor 2,3,4,5,6,7,11,12 textbg $dname bgcolor $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 2,3,4,5,6,7,11,12 text $rgb(255,255,0) 
    /dll dlls\mdx\mdx.dll SetColor $dname 3,5,7,8,9 background $rgb(0,0,0)
    /dll dlls\mdx\mdx.dll SetColor $dname 2,4,6,11,12 background $rgb(0,0,95)
  } 
}
on *:dialog:serverconnect:sclick:*:{
  if ($did == 8) { /connect $did(serverconnect,5) $did(serverconnect,7) $did(serverconnect,3) }
  if ($did == 9) { /dialog -x serverconnect }
}

; AKILL Menu System
dialog serverakill {
  title "IRCop SubMenu"
  option dbu
  size -1 -1 100 165

  box "AKill Menu",1,5 3 92 65
  text "AKill Mask:",2,9 11 51 10
  edit "",3,7 19 51 10,autohs
  text "Time (Expiry):",4,9 30 51 10
  edit "+30m",5,7 37 51 10,autohs
  text "Reason:",6,9 48 51 10
  edit $me Says So,7,7 54 51 10,autohs

  button "Add",8,62 19 30 10
  button "Delete",9,62 37 30 10
  button "BACK",10,62 54 30 10

  box "Other Commands",11,5 68 92 43
  text "AKill Mask:",12,9 76 51 10
  edit "",13,7 84 51 10,autohs
  button "List",14,62 79 30 10
  button "View",15,62 89 30 10
  button "Count",16,62 99 30 10
  text "Does not use Mask <--",17,6 99 55 10

  box "Hints: (Expiry)",18,5 115 92 45
  text "+d [days] e.g +2d = 2 days",19,6 122 99 20
  text "+h [hours] e.g +12h = 12 hours",20,6 129 99 20
  text "+m [minutes] e.g +30m = 30 minutes",21,6 136 99 20
  text "Note: Combinations do not work!",22,6 143 99 20
  text "(e.g +1h30m)",23,21 150 99 20
} 
on *:dialog:serverakill:sclick:*:{
  if ($did == 8) {  /.msg operserv akill add $did(serverakill,5) $did(serverakill,3) $did(serverakill,7) }
  if ($did == 9) {  /.msg operserv akill del $did(serverakill,3) }
  if ($did == 10) { /dialog -x serverakill }
  if ($did == 14) {  /.msg operserv akill list $did(serverakill,13) }
  if ($did == 15) {  /.msg operserv akill view $did(serverakill,13) }
  if ($did == 16) {  /.msg operserv akill count }
}

; Squit Menu System
dialog serversquit {
  title "IRCop SubMenu"
  option dbu
  size -1 -1 100 80

  box "Squit Server(s)",1,5 3 90 49
  text "Server:",2,7 11 51 10
  edit $network,3,7 19 51 10,autohs
  text "Reason:",4,7 30 51 10
  edit "Reconfiguration",5,7 38 51 10,autohs
  button "Squit",8,62 19 30 10,default
  button "BACK", 9,62 38 30 10,cancel

  box "Description:",10,5 53 90 22
  text "Splits <server> away from your side",11,6 59 99 20
  text "of the net with a <reason>",12,6 65 99 20
} 
on *:dialog:serversquit:sclick:*:{
  if ($did == 8) { /echo %info Squit server: $did(serversquit,3) with Reason: $did(serversquit,5) | /squit $did(serversquit,3) $did(serversquit,5) }
  if ($did == 9) { /dialog -x serversquit }
}
alias SfogliaAscii {
  .set %temp.sfogliaascii $shortfn($$dir="Scegli un File TXT:" [ $mircdirascii\ $+ *.txt ])
  .echo $active 3* 7[3Ascii7]3:Riproduzione di " $+ $nopath($longfn(%temp.sfogliaascii)) $+ "
  .play stop | .play $active %temp.sfogliaascii %asciidelay | unset %temp.sfogliaascii
}
alias -l aboutmsn.anim {
  if ((!$dialog(aboutmsn)) || (%.anim._i > 150)) { .timer_anim off | unset %.anim.tmp* %.anim._i | return }
  :1 | %.anim.tmpx = $calc(($window(-1).w / 2) - %.anim._i) | %.anim.tmpy = $calc(($window(-1).h / 2) - %.anim._i) | %.anim.tmpw = $calc(%.anim._i * 2) | %.anim.tmph = $calc(%.anim._i * 2)
  dialog -s aboutmsn %.anim.tmpx %.anim.tmpy %.anim.tmpw %.anim.tmph | inc %.anim._i 5
}
alias -l dccnick { 
  if ($status) {
    did -i notify 2 1 page event
    tokenize 32 $did(notify,2,1,1)
    if (!$5) halt
    else .dcc chat $notify($calc($5 - 1))
  }
}
alias -l n.whois { 
  if ($status) {
    did -i notify 2 1 page event
    tokenize 32 $did(notify,2,1,1)
    if (!$5) halt
    else .whois $notify($calc($5 - 1))
  }
}
alias -l n.query { 
  if ($status) {
    did -i notify 2 1 page event
    tokenize 32 $did(notify,2,1,1)
    if (!$5) halt
    else msg $notify($calc($5 - 1)) $$?="Scrivi messaggio"
  }
}
alias -l rem.contact2 { .notify -r $$?="Contatto da rimuovere?" | did -r notify 2 | .timermsn.notify 1 1 msn.notify }
alias -l rem.contact {
  did -i notify 2 1 page event
  tokenize 32 $did(notify,2,1,1)
  if (!$5) halt
  else {
    .notify -r $notify($calc($5 - 1))
    did -r notify 2
    .timermsn.notify 1 1 msn.notify
  }
}
alias -l msn.notify {
  did -r notify 2
  did -i notify 2 1 iconsize normal small
  did -i notify 2 1 seticon normal 0, $+ $scriptdiricons\Notify.ico
  did -i notify 2 1 seticon normal 0, $+ $scriptdiricons\online.ico
  did -i notify 2 1 seticon normal 0, $+ $scriptdiricons\offline.ico
  var %y = 1
  while (%y <= $scid(0)) {
    scon %y
    did -i notify 2 1 cb root
    did -a notify 2 +eb 1 1 $iif($status,$me $chr(40) Online $chr(41),$me $chr(40) Offline $chr(41) )
    did -i notify 2 1 cb last
    did -a notify 2 +eb 2 2 Online 
    did -i notify 2 1 cb last
    var %x = 1
    while (%x <= $notify(0)) { 
      if ($notify(%x).ison) did -a notify 2 + 2 2 $notify(%x)
      inc %x
    } 
    did -i notify 2 1 cb up
    did -a notify 2 +eb 3 3 Offline
    did -i notify 2 1 cb last
    var %x = 1
    while (%x <= $notify(0)) {
      if (!$notify(%x).ison) did -a notify 2 + 3 3 $notify(%x)
      inc %x
    }
    inc %y
  }
  did -i notify 2 1 cb up
}
alias -l baca.file { if ($isfile($+(",$scriptdirsettings.ini,"))) return $readini $+(",$scriptdirsettings.ini,") $1 $2- }
alias -l tulis.file { writeini $+(",$scriptdirsettings.ini,") $$1- }
alias pop tokenize 32 $dll($pdll.notify,Popup,$1-) | if ($isid) return $1- | $iif($4- != did not select a menu item,$4-)
alias popup return $shortfn($scriptdirdll\popups.dll)
alias -l aboutmsn if (!$dialog(aboutmsn)) dialog -m aboutmsn aboutmsn | if ( %cc181p == on ) { $tunder TDDialog $dialog(aboutmsn).hwnd > 10 } }
alias -l add.contact { .notify $$?="Contact to Add?" | did -r notify 2 | .timermsn.notify  1 1 msn.notify }
alias -l pdll.notify { return $+(",$scriptdirdll\popups.dll,") }
alias -l mdx.notify { return $+(",$scriptdirdll\mdx.dll,") }
alias -l views.notify { return Notify\dll\views.mdx }
alias -l ddll.notify { return Notify\dll\dialog.mdx }
alias nlist { if (!$dialog(notify)) dialog -m notify notify | if ( %cc181p == on ) { $tunder TDDialog $dialog(notify).hwnd > 2 }  }
dialog aboutmsn {
  title "Notify List v1.5"
  size -1 -1 300 300
  icon $scriptdiricons\about.ico
  text "", 1, 50 20 150 15 
  icon 71, 10 8 32 32, " $+ $mircdir\notify\icons\msn.ico $+ "
  button "Copyright© 2002 da^hype All rights reserved", 2, 10 60 280 50, center
  text "Website:", 3, 10 134 50 15
  edit "http://www.hirc.org", 4, 60 130 150 22, autohs read
  button "Visit!", 5, 220 130 50 22, center
  edit "", 6, 10 160 280 80, read multi return autohs autovs
  box "", 7, -10 40 320 210
  button "Close", 200, 120 260 60 30, ok
}

dialog notify {
  title "v1.5 [ /nlist ]"
  option dbu
  size -1 -1 164 160
  list 2, 1 2 160 158
  menu "&File", 20
  item "&Aggiorna", 12, 20
  item "&Suono Notify",14,20
  item "break", 13, 20
  item "&Chiudi", 11, 20
  menu "&Azione", 30
  item "&Invia un File...", 21, 30
  item "break", 22, 30
  item "Invia &E-mail...", 23, 30
  menu "&Tools", 40
  item "&Aggiungi un contatto...", 31, 40
  item "&Elimina Un Contatto...", 32, 40
  menu "&Help", 50
  item "&ReadMe", 41, 50
  item "&HomePage", 42, 50
  item "Break", 43, 50
  item "&Email", 44, 50
  item "&About", 45, 50
  button ok,1, 0 0 0 0,cancel
}
on *:dialog:aboutmsn:init:*: {
  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname $dialog($dname).hwnd
  if (%unome == 1) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,72,170)
    dll $mdx  SetColor 2,4 background $dname bgcolor $rgb(0,0,0)
    dll $mdx  SetColor $dname 4,6 textbg $rgb(0,0,0)
    dll $mdx  SetColor 1,3 background $dname bgcolor $rgb(0,0,0)
    dll $mdx  SetColor $dname 1,3 textbg $rgb(0,72,170)
    dll $mdx  SetColor $dname 1,3 background $rgb(0,72,170)
    dll $mdx  SetColor 1,2,3,4,6,7 text $rgb(255,255,255)
    dll $mdx  SetColor $dname 5,200 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,0,95)
    dll $mdx  SetColor 2,4 background $dname bgcolor $rgb(0,0,0)
    dll $mdx  SetColor $dname 4,6 textbg $rgb(0,0,0)
    dll $mdx  SetColor 1,3 background $dname bgcolor $rgb(0,0,0)
    dll $mdx  SetColor $dname 1,3 textbg $rgb(0,0,95)
    dll $mdx  SetColor $dname 1,3 background $rgb(0,0,95)
    dll $mdx  SetColor 1,2,3,4,6,7 text $rgb(255,255,255)
    dll $mdx  SetColor $dname 5,200 background $rgb(0,0,95)
  }
  did -o aboutmsn 6 1 Credits: | did -o aboutmsn 6 2 Thanks to #hirc.help idealers on WebChat
  did -o aboutmsn 6 3  Beta testers were Fury_G3, | did -o aboutmsn 6 4   Double[0]seveN and tyso
  did -a aboutmsn 1 Script By da^hype 
  %.anim._i = 0 | .timer_anim -m 0 1 aboutmsn.anim
}
on *:dialog:aboutmsn:sclick:2:.timerabout 1 0 echo -a 3* 7[3About7]3: Puoi Usare tutte le linee della notify purchč ringrazi i creatori della notify 
on *:dialog:aboutmsn:sclick:5:.url -n http://www.hirc.org

on *:dialog:notify:menu:*:{
  if ($did == 11) dialog -x notify
  if ($did == 12) msn.notify
  if ($did == 14) { 
    $iif($baca.file(sound,on),tulis.file sound on 0,tulis.file sound on 1) 
    if ($baca.file(sound,on)) did -c notify 14
    if (!$baca.file(sound,on)) did -u notify 14
  }
  if ($did == 21) { dccnick | dcc send %dccnick $sfile($mircdir) | unset %dccnick }
  ; if ($did == 22) list $$?="Canale in cui cercare?"
  if ($did == 23) run mailto:
  if ($did == 31) add.contact
  if ($did == 32) rem.contact2
  if ($did == 41) run $+(",$scriptdirreadme.txt,")
  if ($did == 42) url -n http://www.hirc.org
  if ($did == 44) run mailto:da-hype@hirc.org?subject=Notify List v1.5.
  if ($did == 45) aboutmsn
}
on *:dialog:notify:sclick:*:{
  if ($did == 10) {
    var %action = $gettok($did($dname,10),1,32)
    if (%action == size) {
      var %w = $dialog($dname).cw,%h = $dialog($dname).ch
      dll $mdx.notify MoveControl $dname 2 * * $calc(%w -6) $calc(%h -2)
    }
  }
  if ($did == 2) {
    if ($gettok($did($dname,2,1),1,32) != rclick) halt
    dll $popup New MSNnotify 16 16
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/add.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/del.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/whois.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/query.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/chat.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/refresh.ico
    dll $popup LoadImg MSNnotify icon small $scriptdir/icons/about.ico
    dll $popup AddItem MSNnotify end 1 1 &Add $cr add.contact
    dll $popup AddItem MSNnotify end $iif($status,+,+d) 2 2 &Remove $cr rem.contact
    dll $popup AddItem MSNnotify end 
    dll $popup AddItem MSNnotify end $iif($status,+,+d) 3 3 &Whois $cr n.whois
    dll $popup AddItem MSNnotify end $iif($status,+,+d) 4 4 &Query $cr n.query
    dll $popup AddItem MSNnotify end $iif($status,+,+d) 5 5 &Chat $cr dccnick
    dll $popup AddItem MSNnotify end 
    dll $popup AddItem MSNnotify end 6 6 R&efresh $cr msn.notify
    dll $popup AddItem MSNnotify end 7 7 A&bout $cr aboutmsn
    pop MSNnotify $mouse.dx $mouse.dy
  }
}
on *:dialog:notify:init:*:{


  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname
  if (%unome == 1) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,72,170)
    dll $mdx  SetColor $dname 1,10 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,0,95)
    dll $mdx  SetColor $dname 1,10 background $rgb(0,0,95)
  }
  dll $mdx SetDialog $dname style border title sysmenu minbox
  dll $mdx SetControlMDX $dname 10 positioner size minbox maxbox > $ddll.notify
  dll $mdx SetControlMDX $dname 2 treeview hasbuttons showsel rowselect insertdroptarget > $views.notify
  if ($baca.file(sound,on)) did -c notify 14
  msn.notify
}
on *:NOTIFY:{
  if ($dialog(notify)) msn.notify
  echo -a %sign %info ( $+ $nick $+ ) č in IRC 
  if ($baca.file(sound,on)) splay -w $scriptdirsounds\online.wav
  halt 
}

on *:CONNECT:{ if ($dialog(notify)) msn.notify }
on *:DISCONNECT:{ if ($dialog(notify)) msn.notify }
on *:UNOTIFY:{ if ($dialog(notify)) msn.notify } 
