alias risol1 { dialog -m risol risol }
dialog risol {
  title "Risoluzione"
  size -1 -1 326 91
  option pixels
  radio "", 1, 30 24 21 17
  radio "", 2, 172 24 21 17
  text "1024 x 768", 3, 57 24 100 17
  text "1280 x 1024", 4, 201 24 100 17
  button "Ok", 5, 129 55 65 25, ok
}
on *:dialog:risol:init:*:{
  /dll dlls\mdx\mdx.dll SetMircVersion $version
  /dll dlls\mdx\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 1,2,3,4 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 1,2,3,4 textbg $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
  }
  if (%unome == 2) {
    /dll dlls\mdx\mdx.dll SetColor $dname 5 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 1,2,3,4 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 1,2,3,4 textbg $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
  }
  if ( %cc181p == on ) { $tunder TDDialog $dialog(risol).hwnd > 2 }
  if (%risol == 1) { did -c $dname 1 }
  if (%risol == 2) { did -c $dname 2 }
}
on *:dialog:risol:sclick:*:{
  if ($did == 1) { set %risol 1 }
  if ($did == 2) { set %risol 2 }
  if ($did == 5) { toolspentoh | toolspento1h |  toolattivo | toolattivo1 } 
}
dialog Spam {
  title "AntiSpam by L]e[G"
  size -1 -1 108 120
  option dbu
  box "Impostazioni", 1, 6 6 95 85
  check "", 9, 15 77 10 10
  text "Ban", 91, 27 77 23 10
  edit "", 18, 49 15 50 10, autohs
  text "Attivo su Chan:", 5, 8 16 41 8
  text "Punizione:", 6, 9 64 32 8
  text "Punito Per Spam di:", 7, 8 35 63 8
  check "", 15, 15 47 10 10
  text "Canali", 151, 27 47 28 10
  check "", 16, 63 47 10 10
  text "Siti", 161, 75 47 23 10
  button "Ok", 90, 32 96 37 12, ok
  check "", 8, 63 77 10 10
  text "Kick", 81, 75 77 28 10
}

alias spam { .dialog -m spam spam |  if ( %cc181p == on ) { $tunder TDDialog $dialog(spam).hwnd > 2 } }


on *:dialog:spam:init:*:{
  /dll dlls\mdx\mdx.dll SetMircVersion $version
  /dll dlls\mdx\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(255,134,0)
    /dll dlls\mdx\mdx.dll SetColor $dname 90 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 9,91,5,6,7,15,151,16,161,90,8,81 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 9,91,5,6,7,15,151,16,161,90,8,81 textbg $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 18 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 18 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor 9,91,18,5,6,7,15,151,16,161,90,8,81 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 90 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll dlls/mdx/mdx.dll SetColor $dname 1 background $rgb(196,196,196)
    /dll dlls\mdx\mdx.dll SetColor $dname 90 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 9,91,5,6,7,15,151,16,161,90,8,81 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 9,91,5,6,7,15,151,16,161,90,8,81 textbg $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 18 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 18 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor 9,91,18,5,6,7,15,151,16,161,90,8,81 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 90 background $rgb(0,0,95)
  }
  if (%kiket1) { .did -c $dname 8 }
  if (%banet1) { .did -c $dname 9  }
  if (%cana1) { .did -c $dname 18 }
  if (%ca11) { .did -c $dname 15 }
  if (%ww11) { .did -c $dname 16 }
  did -a $dname 18 %cana1
}

on *:dialog:spam:sclick:*:{
  if ($did == 8) { if ($did(8).state == 1) { .set %kiket1 on } | else { .unset %kiket1 } }
  if ($did == 9) { if ($did(9).state == 1) { .set %banet1 on  } | else { .unset %banet1 } }
  if ($did == 15) { if ($did(15).state == 1) { .set %ca11 on  } | else { .unset %ca11 } }
  if ($did == 16) { if ($did(16).state == 1) { .set %ww11 on  } | else { .unset %ww11 } }
}
on *:dialog:spam:edit:*:{
  %cana1 = $did(18)
}
alias new_table { if (!$dialog(new_table)) { dialog -m new_table new_table |  if ( %cc181p == on ) { $tunder TDDialog $dialog(new_table).hwnd > 2 } } | else halt }
dialog new_table {
  title "Droppa nick"
  size -1 -1 89 34
  option dbu
  button "Droppa", 1, 25 12 37 12
}
on *:dialog:new_table:sclick:*:{
  if ($did == 1) { /msg NickServ  DROP $me }
}
on *:dialog:new_table: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(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(0,0,95)
  }
}
dialog -l anti {
  title "aNtISlap bY Serpe"
  size -1 -1 169 152
  option dbu
  box "Imposta Antislap", 1, 5 33 158 113
  text "Allo slap schiva slap", 9, 12 43 50 8
  text "Allo Slap rispondi con slap", 12, 12 53 73 8
  text "Allo Slap rispondi con:", 15, 12 71 145 8
  edit %msgslap, 16, 37 80 120 10, autohs autovs return
  edit %botsayslap, 17, 37 90 120 10, autohs autovs return
  text "MSG", 18, 12 81 20 8
  text "Botsay", 19, 12 91 24 8
  button "Ok", 20, 54 12 32 12, ok
  text "Allo slap Attiva kick al secondo slap", 21, 12 105 85 8
  text "Allo Slap Kick-Ban diretto", 24, 12 118 83 8
  text "Allo Slap aggiungi l'utente in ignore", 27, 12 132 88 8
  check "", 10, 70 43 8 8
  text "Attiva", 100, 80 43 50 8
  check "", 11, 90 53 8 8
  text "Attiva", 110, 100 53 50 8
  check "", 13, 100 105 8 8
  text "Attiva", 130, 110 105 40 8
  check "", 14, 100 118 8 8
  text "Attiva", 140, 110 118 50 8
  check "", 28, 100 132 8 8
  text "Attiva", 280, 110 132 50 8
  check "", 29, 83 71 8 8
  text "Attiva", 290, 93 71 50 8
}

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




on *:DIALOG:anti:edit:16: { Set %msgslap $did(16) }
on *:DIALOG:anti:edit:17: { Set %botsayslap $did(17) }
on *:DIALOG:anti:sclick:10: { Set %ch1 $did(10) }
on *:DIALOG:anti:sclick:11: { Set %ch2 $did(11) }
on *:DIALOG:anti:sclick:13: { Set %ch3 $did(13) }
on *:DIALOG:anti:sclick:14: { Set %ch4 $did(14) }
on *:DIALOG:anti:sclick:28: { Set %ch5 $did(28) }
on *:DIALOG:anti:sclick:29: { Set %ch6 $did(29) }

on *:dialog:anti: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 $dname 9,12,15,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 9,12,15,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 textbg $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 16,17 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 16,17 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor 9,12,15,16,17,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 20 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 $dname 9,12,15,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 9,12,15,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 textbg $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 16,17 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 16,17 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor 9,12,15,16,17,18,19,21,24,27,10,100,11,110,13,130,14,140,28,280,29,290 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 20 background $rgb(0,0,95)
  }
  if %ch1 = ON { did -c anti  10 }  
  if %ch2 = ON { did -c anti 11 }
  if %ch3 = ON { did -c anti 13 }
  if %ch4 = ON { did -c anti 14 }
  if %ch5 = ON { did -c anti 28 }
  if %ch6 = ON { did -c anti 29 }
}

on *:dialog:anti:sclick:20: { 
  if ($did(anti,10).state = 1) { %ch1 = on } | else { %ch1 = off }
  if ($did(anti,11).state = 1) { %ch2 = on } | else { %ch2 = off }
  if ($did(anti,13).state = 1) { %ch3 = on } | else { %ch3 = off }
  if ($did(anti,14).state = 1) { %ch4 = on } | else { %ch4 = off }
  if ($did(anti,28).state = 1) { %ch5 = on } | else { %ch5 = off }
  if ($did(anti,29).state = 1) { %ch6 = on } | else { %ch6 = off }
}

on *:dialog:anti:sclick:30: {
  if ($did(anti,10).state == 1) { echo -a 3* 7[3Schiva slap7]3: Attivato! } 
  if ($did(anti,11).state == 1) { echo -a 3* 7[3Rispondi allo slap7]3: Attivato! }  
  if ($did(anti,13).state == 1) { echo -a 3* 7[3Kicka allo slap7]3:9 Attivato! } 
  if ($did(anti,14).state == 1) { echo -a 3* 7[3Ban allo slap7]3: Attivato! }  
  if ($did(anti,28).state == 1) { echo -a 3* 7[3Ignora allo slap7]3: Attivato! } 
  if ($did(anti,29).state == 1) { echo -a 3* 7[3Risposte personali allo slap7]3: Attivato! }
}

on ^1:ACTION:*slaps*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] } 
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}


on ^1:ACTION:*slap*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | if (%unome == 1) /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] | else /kick # $nick }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe]
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*colpisce*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] } 
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*schiaffeggia*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe]  }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*spara*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*skiaffeggia*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe]  }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*uccide*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*s lap*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe]
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*sl4p*:#: {
  if (%ch1 == on) && ($me isin $1-) { if (%unome == 1) describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { if (%unome == 1) describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { if (%unome == 1) /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { if (%unome == 1) /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | if (%unome == 1) /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] | else /kick # $nick }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*skiaffo*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | if (%unome == 1) /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] | else /kick # $nick }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe]
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*schiaffo*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | if (%unome == 1) /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe] | else /kick # $nick }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

on ^1:ACTION:*massacra*:#: {
  if (%ch1 == on) && ($me isin $1-) { describe # 8COn un rIFleSSo fELinO sCHiva iL cOLpo... | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch2 == on) && ($me isin $1-) { describe $chan 4cOlpisce fUrIosamENte $nick lAscianDolo CaDErE EsAnime al sUolo | .ignore -u5 $mask($fulladdress,3) | else .ignore -u5 $mask($fulladdress,3) }
  if (%ch6 == on) && ($me isin $1-) { /msg $chan $nick %msgslap }
  if (%ch6 == on) && ($me isin $1-) { /bs say $chan $nick %botsayslap } 
  if (%ch5 == on) && ($me isin $1-) { /ignore $nick } 
  if ($me isop $chan) && (%ch4 == on) && ($me isin $1-) { /ban # $nick | /kick # $nick Qui non si Colpisce nessuno 4[Antislap protection by Serpe]  }
  if ($me isop $chan) && (%ch3 == on) && ($me isin $1-) {
    /inc -u360 $+(%,contatore,$cid,$chan,$nick)
    if ( $eval($+(%,contatore,$cid,$chan,$nick),2) == 2 ) {
      /set -u360 $+(%,contatore,$cid,$chan,$nick) 0
      mode $chan -Q | mode $chan -Q | /kick # $nick Qui non si Colpisce nessuno.Eri stato Avvertito!!! 4[Antislap protection by Serpe] 
    }
    else {
      /msg $chan 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe] | /notice $nick 4[Messaggio Automatico]:8 $nick  Qui non si colpisce nessuno, tantomeno me. Al prossimo slap ti Kicko!!! 4[Antislap protection by Serpe]
    }
  }
}

dialog -l protection {
  title "pROteZioni bY Serpe updated by L]e[G"
  size -1 -1 209 174
  option dbu
  tab "Degrado", 31, 2 31 205 122
  tab "On Kick", 32
  tab "On Ban", 33
  tab "Eccezioni", 34
  tab "On Akick", 35
  tab "Esclusioni", 37
  box "On Akick", 23, 12 48 150 50, tab 35
  box "Eccezioni Automatiche", 11, 12 48 150 60, tab 34
  box "On Ban", 7, 12 48 150 100, tab 33
  box "On kick", 2, 12 48 150 100, tab 32
  box "On deop", 1, 12 48 150 100, tab 31
  check "", 3, 20 60 8 8, tab 31
  text "Rimettiti Grado", 300, 30 60 60 8, tab 31
  check "", 4, 20 70 8 8, tab 31
  text "Degrada l'aggressore", 400, 30 70 60 8, tab 31
  check "", 5, 20 80 8 8, tab 31
  text "Kicka l'aggressore", 500, 30 80 60 8, tab 31
  check "", 6, 20 90 8 8, tab 31
  text "Banna l'aggressore", 600, 30 90 60 8, tab 31
  check "", 8, 20 60 8 8, tab 32
  text "Degrada l'aggressore", 800, 30 60 60 8, tab 32
  check "", 9, 20 70 8 8, tab 32
  text "Kicka l'aggressore", 900, 30 70 60 8, tab 32
  check "", 10, 20 80 8 8, tab 32
  text "Banna l'aggressore", 101, 30 80 60 8, tab 32
  check "", 12, 20 60 8 8, tab 33
  text "Degrada l'aggressore", 121, 30 60 60 8, tab 33
  check "", 13, 20 70 8 8, tab 33
  text "Kicka l'aggressore", 131, 30 70 60 8, tab 33
  check "", 14, 20 80 8 8, tab 33
  text "Banna l'aggressore", 141, 30 80 60 8, tab 33
  check "", 15, 20 100 8 8, tab 33
  text "Togli tuo ban", 151, 30 100 60 8, tab 33
  check "", 16, 20 90 8 8, tab 33
  text "Akicka l'agressore", 161, 30 90 60 8, tab 33
  check "", 18, 20 60 8 8, tab 34
  text "Attiva su Host", 181, 30 60 50 8, tab 34
  button "Ok", 17, 76 157 56 12, ok
  check "", 19, 76 11 8 8, left
  text "Attiva Protezioni", 191, 86 11 56 8, left
  check "", 20, 20 100 8 8, tab 31
  text "Toglilo dall'Access", 201, 30 100 60 8, tab 31
  check "", 21, 20 90 8 8, tab 32
  text "Toglilo dall'Access", 211, 30 90 60 8, tab 32
  check "", 22, 20 110 8 8, tab 33
  text "Toglilo dall'Access", 221, 30 110 60 8, tab 33
  check "", 24, 20 60 8 8, tab 35
  text "Attiva Protezione da Akick", 241, 30 60 79 8, tab 35
  check "", 25, 20 70 8 8, tab 35
  text "Togli mass Akick", 251, 30 70 50 8, tab 35
  box "Togli eccezioni e inviti all'aggressore ", 26, 12 110 150 35, tab 34
  check "", 27, 20 125 8 8, tab 34
  text "Togli Eccezioni", 271, 30 125 50 8, tab 34
  check "", 28, 20 70 8 8, tab 34
  text "Attiva su Nick", 281, 30 70 50 8, tab 34
  check "", 29, 20 80 8 8, tab 34
  text "Attiva su Mask", 291, 30 80 65 8, tab 34
  check "", 30, 80 125 8 8, tab 34
  text "Togli Inviti", 301, 90 125 50 8, tab 34
  check "", 36, 20 90 8 8, tab 34
  text "Rimetti eccezioni se tolte", 361, 30 90 70 8, tab 34
  box "Inserisci i chan che vuoi escludere dalle protezioni  preceduti dal #", 38, 7 49 193 99, tab 37
  check "", 46, 154 138 8 8, tab 37 left
  check "Check", 39, 10 60 8 8, tab 37
  check "Check", 40, 10 70 8 8, tab 37
  check "Check", 41, 10 80 8 8, tab 37
  check "Check", 42, 10 90 8 8, tab 37
  check "Check", 43, 10 100 8 8, tab 37
  check "Check", 44, 10 110 8 8, tab 37
  check "Check", 45, 10 120 8 8, tab 37
  text "Attiva", 461, 164 138 40 8, tab 37 
  edit %ca1, 47, 20 60 175 10, tab 37
  edit %ca2, 48, 20 70 175 10, tab 37
  edit %ca3, 49, 20 80 175 10, tab 37
  edit %ca4, 50, 20 90 175 10, tab 37
  edit %ca5, 51, 20 100 175 10, tab 37
  edit %ca6, 52, 20 110 175 10, tab 37
  edit %ca7, 53, 20 120 175 10, tab 37
}

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


on *:DIALOG:protection:sclick:3: { Set %ck1 $did(3) }
on *:DIALOG:protection:sclick:4: { Set %ck2 $did(4) }
on *:DIALOG:protection:sclick:5: { Set %ck3 $did(5) }
on *:DIALOG:protection:sclick:6: { Set %ck4 $did(6) }
on *:DIALOG:protection:sclick:8: { Set %ck5 $did(8) }
on *:DIALOG:protection:sclick:9: { Set %ck6 $did(9) }
on *:DIALOG:protection:sclick:10: { Set %ck7 $did(10) }
on *:DIALOG:protection:sclick:12: { Set %ck8 $did(12) }
on *:DIALOG:protection:sclick:13: { Set %ck9 $did(13) }
on *:DIALOG:protection:sclick:14: { Set %ck10 $did(14) }
on *:DIALOG:protection:sclick:15: { Set %ck11 $did(15) }
on *:DIALOG:protection:sclick:16: { Set %ck12 $did(16) }
on *:DIALOG:protection:sclick:18: { Set %ck13 $did(18) }
on *:DIALOG:protection:sclick:19: { Set %ck14 $did(19) }
on *:DIALOG:protection:sclick:20: { Set %ck15 $did(20) }
on *:DIALOG:protection:sclick:21: { Set %ck16 $did(21) }
on *:DIALOG:protection:sclick:22: { Set %ck17 $did(22) }
on *:DIALOG:protection:sclick:24: { Set %ck18 $did(24) }
on *:DIALOG:protection:sclick:25: { Set %ck19 $did(25) }
on *:DIALOG:protection:sclick:27: { Set %ck20 $did(27) }
on *:DIALOG:protection:sclick:28: { Set %ck21 $did(28) }
on *:DIALOG:protection:sclick:29: { Set %ck22 $did(29) }
on *:DIALOG:protection:sclick:30: { Set %ck23 $did(30) }
on *:DIALOG:protection:sclick:36: { Set %ck24 $did(36) }
on *:DIALOG:protection:sclick:39: { Set %f1 $did(39) }
on *:DIALOG:protection:sclick:40: { Set %f2 $did(40) }
on *:DIALOG:protection:sclick:41: { Set %f3 $did(41) }
on *:DIALOG:protection:sclick:42: { Set %f4 $did(42) }
on *:DIALOG:protection:sclick:43: { Set %f5 $did(43) }
on *:DIALOG:protection:sclick:44: { Set %f6 $did(44) }
on *:DIALOG:protection:sclick:45: { Set %f7 $did(45) }
on *:DIALOG:protection:edit:47: { Set %ca1 $did(47) }
on *:DIALOG:protection:edit:48: { Set %ca2 $did(48) }
on *:DIALOG:protection:edit:49: { Set %ca3 $did(49) }
on *:DIALOG:protection:edit:50: { Set %ca4 $did(50) }
on *:DIALOG:protection:edit:51: { Set %ca5 $did(51) }
on *:DIALOG:protection:edit:52: { Set %ca6 $did(52) }
on *:DIALOG:protection:edit:53: { Set %ca7 $did(53) }
on *:DIALOG:protection:sclick:46: { Set %fatt $did(45) }

ON *:RAWMODE:#:{ 
  if ($chan == %ca1) && (%f1 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca2) && (%f2 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca3) && (%f3 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca4) && (%f4 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca5) && (%f5 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca6) && (%f6 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca7) && (%f7 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if (%ck13 == on) && (%ck14 == on) && (+a isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),2) | mode $chan +I $mask($ial($me,1),2) }
  if (%ck13 == on) && (%ck14 == on) && (+o isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),2) | mode $chan +I $mask($ial($me,1),2) }
  if (%ck13 == on) && (%ck14 == on) && (+h isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),2) | mode $chan +I $mask($ial($me,1),2) }
  if (%ck13 == on) && (%ck14 == on) && (+q isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),2) | mode $chan +I $mask($ial($me,1),2) }
  if (%ck21 == on) && (%ck14 == on) && (+a isin $1) && ($2 == $me) { /mode # +e $me | /mode # +I $me }
  if (%ck21 == on) && (%ck14 == on) && (+o isin $1) && ($2 == $me) { /mode # +e $me | /mode # +I $me }
  if (%ck21 == on) && (%ck14 == on) && (+h isin $1) && ($2 == $me) { /mode # +e $me | /mode # +I $me }
  if (%ck21 == on) && (%ck14 == on) && (+q isin $1) && ($2 == $me) { /mode # +e $me | /mode # +I $me }
  if (%ck22 == on) && (%ck14 == on) && (+a isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),3) | /mode $chan +I $mask($ial($me,1),3) }
  if (%ck22 == on) && (%ck14 == on) && (+o isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),3) | /mode $chan +I $mask($ial($me,1),3) }
  if (%ck22 == on) && (%ck14 == on) && (+h isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),3) | /mode $chan +I $mask($ial($me,1),3) }
  if (%ck22 == on) && (%ck14 == on) && (+q isin $1) && ($2 == $me) { /mode $chan +e $mask($ial($me,1),3) | /mode $chan +I $mask($ial($me,1),3) }
}
on *:dialog:protection:init:*: {

  /dll dlls\mdx\mdx.dll SetMircVersion $version
  /dll dlls\mdx\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    /dll dlls\mdx\mdx.dll SetColor $dname 17 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 background $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $sname 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 textbg $rgb(0,72,170)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll SetColor 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 17 background $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 23,11,7,2,1,26,38 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    /dll dlls\mdx\mdx.dll SetColor $dname 17 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 background $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $sname 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 textbg $rgb(0,0,95)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 background $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 textbg $rgb(0,0,0)
    dll dlls\mdx\mdx.dll SetColor $dname 47,48,49,50,51,52,53 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll SetColor 19,31,32,33,34,35,37,3,300,4,400,5,500,6,600,8,800,9,900,10,101,12,121,13,131,14,141,15,151,16,161,18,181,191,20,201,21,211,22,221,24,241,25,251,27,271,28,281,29,291,30,301,36,361,39,40,41,42,43,44,45,461,46 text $rgb(255,255,255)
    dll dlls\mdx\mdx.dll  SetColor $dname 17 background $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 23,11,7,2,1,26,38 background $rgb(196,196,196)
  }
  if %ck1 = ON { did -c protection 3 }  
  if %ck2 = ON { did -c protection 4 }  
  if %ck3 = ON { did -c protection 5 }  
  if %ck4 = ON { did -c protection 6 }  
  if %ck5 = ON { did -c protection 8 }  
  if %ck6 = ON { did -c protection 9 }  
  if %ck7 = ON { did -c protection 10 }  
  if %ck8 = ON { did -c protection 12 }  
  if %ck9 = ON { did -c protection 13 }  
  if %ck10 = ON { did -c protection 14 }  
  if %ck11 = ON { did -c protection 15 }  
  if %ck12 = ON { did -c protection 16 }  
  if %ck13 = ON { did -c protection 18 }  
  if %ck14 = ON { did -c protection 19 }  
  if %ck15 = ON { did -c protection 20 }  
  if %ck16 = ON { did -c protection 21 }  
  if %ck17 = ON { did -c protection 22 }
  if %ck18 = ON { did -c protection 24 } 
  if %ck19 = ON { did -c protection 25 }
  if %ck20 = ON { did -c protection 27 }       
  if %ck21 = ON { did -c protection 28 } 
  if %ck22 = ON { did -c protection 29 } 
  if %ck23 = ON { did -c protection 30 } 
  if %ck24 = ON { did -c protection 36 } 
  if %f1 = ON { did -c protection 39 }
  if %f2 = ON { did -c protection 40 }
  if %f3 = ON { did -c protection 41 }
  if %f4 = ON { did -c protection 42 }
  if %f5 = ON { did -c protection 43 }
  if %f6 = ON { did -c protection 44 }
  if %f7 = ON { did -c protection 45 }
  if %fatt = ON { did -c protection 46 }
}

on *:dialog:protection:sclick:17: { 
  if ($did(protection,3).state = 1) { %ck1 = on } | else { %ck1 = off }
  if ($did(protection,4).state = 1) { %ck2 = on } | else { %ck2 = off }
  if ($did(protection,5).state = 1) { %ck3 = on } | else { %ck3 = off }
  if ($did(protection,6).state = 1) { %ck4 = on } | else { %ck4 = off }
  if ($did(protection,8).state = 1) { %ck5 = on } | else { %ck5 = off }
  if ($did(protection,9).state = 1) { %ck6 = on } | else { %ck6 = off }
  if ($did(protection,10).state = 1) { %ck7 = on } | else { %ck7 = off }
  if ($did(protection,12).state = 1) { %ck8 = on } | else { %ck8 = off }
  if ($did(protection,13).state = 1) { %ck9 = on } | else { %ck9 = off }
  if ($did(protection,14).state = 1) { %ck10 = on } | else { %ck10 = off }
  if ($did(protection,15).state = 1) { %ck11 = on } | else { %ck11 = off }
  if ($did(protection,16).state = 1) { %ck12 = on } | else { %ck12 = off }
  if ($did(protection,18).state = 1) { %ck13 = on } | else { %ck13 = off }
  if ($did(protection,19).state = 1) { %ck14 = on } | else { %ck14 = off }
  if ($did(protection,20).state = 1) { %ck15 = on } | else { %ck15 = off }
  if ($did(protection,21).state = 1) { %ck16 = on } | else { %ck16 = off }
  if ($did(protection,22).state = 1) { %ck17 = on } | else { %ck17 = off }
  if ($did(protection,24).state = 1) { %ck18 = on } | else { %ck18 = off }
  if ($did(protection,25).state = 1) { %ck19 = on } | else { %ck19 = off }
  if ($did(protection,27).state = 1) { %ck20 = on } | else { %ck20 = off }
  if ($did(protection,28).state = 1) { %ck21 = on } | else { %ck21 = off }
  if ($did(protection,29).state = 1) { %ck22 = on } | else { %ck22 = off }
  if ($did(protection,30).state = 1) { %ck23 = on } | else { %ck23 = off }
  if ($did(protection,36).state = 1) { %ck24 = on } | else { %ck24 = off }
  if ($did(protection,39).state = 1) { %f1 = on } | else { %f1 = off }
  if ($did(protection,40).state = 1) { %f2 = on } | else { %f2 = off }
  if ($did(protection,41).state = 1) { %f3 = on } | else { %f3 = off }
  if ($did(protection,42).state = 1) { %f4 = on } | else { %f4 = off }
  if ($did(protection,43).state = 1) { %f5 = on } | else { %f5 = off }
  if ($did(protection,44).state = 1) { %f6 = on } | else { %f6 = off }
  if ($did(protection,45).state = 1) { %f7 = on } | else { %f7 = off }
  if ($did(protection,46).state = 1) { %fatt = on } | else { %fatt = off }
}
on 1:KICK:#:{ 
  if ($chan == %ca1) && (%f1 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca2) && (%f2 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca3) && (%f3 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca4) && (%f4 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca5) && (%f5 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca6) && (%f6 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($chan == %ca7) && (%f7 == on) && (%fatt == on) && (%ck14 == on) { halt }
  if ($knick == $me) && (%ck5 == on) && (%ck14 == on) && ($nick != ChanServ) && ($nick !== $me) { /cs dehalfop # $nick | /cs deop # $nick | /cs DEPROTECT # $nick | /cs DeOwner # $nick | /cs Devoice # $nick } 
  if ($knick == $me) && (%ck6 == on) && (%ck14 == on) && ($nick != ChanServ) && ($nick !== $me) {  if (%unome == 1) { mode $chan -Q | mode $chan -Q | kick # $nick ¦kIcK protection By Serpe®¦ } | else { mode $chan -Q | mode $chan -Q | kick # $nick ¦kIcK protection By Serpe®¦ } }
  if ($knick == $me) && (%ck7 == on) && (%ck14 == on) && ($nick != ChanServ) && ($nick !== $me) { /ban # $nick  } 
  if ($knick == $me) && (%ck16 == on) && (%ck14 == on) && ($nick != ChanServ) && ($nick !== $me) { /cs access # del $nick } 
  if ($knick == $me) && (%ck14 == on) && ($nick != ChanServ) && ($nick !== $me) { echo 9 -a $timestamp - $nick -  con mask - $address - ti ha Kickato su - $chan - 4¦kIcK pROtectIOn By Serpe®¦ }
  if ( $knick == $me ) && (%ck18 == on) && (%ck14 == on) && ($nick ison $chan) && ($nick !== $me) { /cs akick # del $address($me,2) | /cs akick # del $me | /cs unban # me | .timer 1 7 .join # }
  if ( $knick == $me ) && (%ck19 == on) && (%ck14 == on) && ($nick ison $chan) && ($nick !== $me) { /cs akick # del *!*@* | mode # -b *!*@* | .timer 1 7 .join # }
  if ( $knick == $me ) && (%ck20 == on) && (%ck14 == on) && ($nick ison $chan) && ($nick !== $me) { /mode # -e $nick | /mode $chan -e $mask($ial($nick,1),2) | /mode $chan -e $mask($ial($nick,1),3) | /mode $chan -e $address($nick,1) }
  if ( $knick == $me ) && (%ck23 == on) && (%ck14 == on) && ($nick ison $chan) && ($nick !== $me) { /mode $chan -I $mask($ial($nick,1),3) | /mode # -I $nick | mode $chan -I $mask($ial($nick,1),2) | /mode $chan -I $address($nick,1) }
}
dialog emilsecaps {
  title "Arcan]G[elo Anti-CaPs"
  size -1 -1 273 116
  option dbu
  box "PuNiZiOni", 1, 2 2 83 55
  check "", 2, 7 12 10 10
  text "Avvisa", 200, 17 12 31 10
  edit "", 3, 39 12 14 10, autohs
  text "volte", 4, 59 13 17 8
  radio "", 5, 7 26 10 10, group
  radio "", 6, 7 40 10 10
  text "Kick", 50, 17 26 23 10
  text "Kickban", 60, 17 40 34 10
  box "MeSSaGGi", 7, 91 2 110 55
  edit "", 8, 96 12 54 10, autohs
  edit "", 9, 96 26 54 10, autohs
  edit "", 10, 96 40 54 10, autohs
  text "Avviso", 11, 157 13 25 8
  text "Último avviso", 12, 157 27 60 10
  text "Motivo kick", 13, 157 41 60 10
  button "APPLICA", 100, 97 101 39 12, flat ok
  check "", 99, 172 102 10 10
  text "ATTIVA", 990, 182 102 30 10
  icon 22, 97 74 15 15, Graphic\SITH_icons\2\sithteam.ico
  link "Skipper.SITHteam@gmail.com", 20, 127 74 74 8
  box "Autore", 23, 91 62 110 34ai
  text "irc.MindForge.org #thai", 24, 127 85 66 8
  edit "", 25, 141 102 13 10
  text "%", 26, 156 104 8 8
  combo 98, 209 9 60 50, size
  box "Canali", 19, 206 2 65 99
  button "+", 27, 222 60 15 12
  button "-", 28, 241 60 15 12
  radio "", 21, 210 78 10 10,group
  radio "", 29, 210 90 10 10 
  text "Tutti i canali", 210, 220 78 55 10
  text "Canali della lista", 290, 220 90 57 10
  edit "", 30, 41 40 15 10
  text "sec.", 31, 60 41 13 8
}
ON *:UNLOAD:{ unset %§emilse.* }

ON *:QUIT:{
  if ($nick == $me) { unset %§emilse.caps* }
}

ON *:DIALOG:emilsecaps:init:0:{
  emilse.combo
  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 $dname 2,200,4,5,6,50,60,11,12,13,99,990,20,24,26,98,21,29,210,290,31 background $rgb(0,72,170)
    dll $mdx  SetColor $dname 2,200,4,5,6,50,60,11,12,13,99,990,20,24,26,98,21,29,210,290,31 textbg $rgb(0,72,170)
    dll $mdx  SetColor $dname 3,8,9,10,25,30 background $rgb(0,0,0)
    dll $mdx  SetColor $dname 3,8,9,10,25,30 textbg $rgb(0,0,0)
    dll $mdx  SetColor 2,200,3,4,5,6,50,60,8,9,10,11,12,13,99,990,20,24,25,26,98,21,29,210,290,30,31 text $rgb(255,255,255)
    dll $mdx  SetColor $dname 100,27,28 background $rgb(255,134,0)
    dll $mdx SetColor $dname 1,7,23,19 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    dll $mdx SetDialog $dname bgcolor $rgb(0,0,95)
    dll $mdx  SetColor $dname 2,200,4,5,6,50,60,11,12,13,99,990,20,24,26,98,21,29,210,290,31 background $rgb(0,0,95)
    dll $mdx  SetColor $dname 2,200,4,5,6,50,60,11,12,13,99,990,20,24,26,98,21,29,210,290,31 textbg $rgb(0,0,95)
    dll $mdx  SetColor $dname 3,8,9,10,25,30 background $rgb(0,0,0)
    dll $mdx  SetColor $dname 3,8,9,10,25,30 textbg $rgb(0,0,0)
    dll $mdx  SetColor 2,200,3,4,5,6,50,60,8,9,10,11,12,13,99,990,20,24,25,26,98,21,29,210,290,30,31 text $rgb(255,255,255)
    dll $mdx  SetColor $dname 100,27,28 background $rgb(196,196,196)
    dll $mdx SetColor $dname 1,7,23,19 background $rgb(196,196,196)
  }
  set %§emilse.radio 15
  did -a $dname 3 %§emilse.edit3
  did -a $dname 8 %§emilse.edit8
  did -a $dname 9 %§emilse.edit9
  did -a $dname 10 %§emilse.edit10
  did -a $dname 25 %§emilse.edit25
  did -a $dname 30 %§emilse.edit30
  if (%§emilse.radio3 == 21) { did -b $dname 98,27,28 | did -c $dname 21 }
  elseif (%§emilse.radio3 == 29) { did -b $dname 27,28 | did -c $dname 29 }

  if (%§emilse.radio2 == 5) { did -c $dname 6 }
  elseif (%§emilse.radio2 == 6) { did -c $dname 5 }

  if (%§emilse.check2 == 1) { did -c $dname 2 }
  if (%§emilse.radio2 == 6) { did -b $dname 30 }
  if (%§emilse.check99 == 1) { did -c $dname 99 }
  if ($did(2).state == 0) { did -b $dname 3,8,9 }
}

ON *:DIALOG:emilsecaps:sclick:*:{
  if ($did == 2) {
    if ($did(2).state == 1) { did -e $dname 3,8,9 }
    else { did -b $dname 3,8,9 }
  }
  if ($did == 5) { did -b $dname 30 }
  if ($did == 6) { did -e $dname 30 }
  if ($did == 20) { run mailto:Skipper.SITHteam@gmail.com?subject=Anti-Caps }
  if ($did == 21) { did -b $dname 98,27,28 }
  if ($did == 27) { 
    did -a $dname 98 $did(98).text
    did -d $dname 98 $did(98).text 
  }
  if ($did == 28) {
    if ($did(98).sel) { 
      did -d $dname 98 $did(98).text
      did -d $dname 98 $did(98).sel 
    }
  }
  if ($did == 29) { did -e $dname 98 }
  if ($did == 98) { did -e $dname 28 }
  else { did -b $dname 28 }
  if ($did == 100) {
    emilse.canales
    if ($did(2).state == 1) { set %§emilse.check2 1 }
    else { set %§emilse.check2 0 }
    if ($did(3).text isnum) { set %§emilse.edit3 $did(3).text }
    if ($did(5).state == 1) { set %§emilse.radio2 6 } 
    else { set %§emilse.radio2 5 }
    if ($did(8).text) { set %§emilse.edit8 $did(8).text }
    if ($did(9).text) { set %§emilse.edit9 $did(9).text }
    if ($did(10).text) { set %§emilse.edit10 $did(10).text }
    if ($did(25) isnum) && ($did(25).text > 10) && ($did(25).text < 100) { set %§emilse.edit25 $did(25).text }
    if ($did(21).state == 1) { set %§emilse.radio3 21 }
    else { set %§emilse.radio3 29 }
    if ($did(30).text isnum) { set %§emilse.edit30 $did(30).text }
    if ($did(99).state == 1) { set %§emilse.check99 1 | .enable #emilsecaps }
    else { set %§emilse.check99 0 | .disable #emilsecaps }
  }
}

ON *:DIALOG:emilsecaps:edit:*:{
  if ($did == 98) { 
    if ($did(98).text) { did -e $dname 27 }
    else { did -b $dname 27 }
  }
  %§emilse.edit25 = $did(25)
}

#emilsecaps off
ON @*:TEXT:*:#:{
  if ($nick !isop $chan) && ($len($1-) > 4) {
    if (%§emilse.radio3 == 29) { 
      if ($emilse.chan($chan) == 1) { goto emilsecaps }
      else { return }
    }
    else { 
      :emilsecaps
      if ($emilsecaps($1-,$chan) == $true) { 
        inc -u360 $+(%,§emilse.caps.,$chan,.,$nick)
        if (%§emilse.check2 == 1) { 
          if ($eval($+(%,§emilse.caps.,$chan,.,$nick),2) < %§emilse.edit3) {
            if (%§emilse.radio == 15) { if (%unome == 1) msg $chan $replace(%§emilse.edit8,<nick>,$nick) }
          }
          if ($eval($+(%,§emilse.caps.,$chan,.,$nick),2) == %§emilse.edit3) {
            if (%§emilse.radio == 15) { if (%unome == 1)  msg $chan $replace(%§emilse.edit9,<nick>,$nick) }
          }
          if ($eval($+(%,§emilse.caps.,$chan,.,$nick),2) > %§emilse.edit3) {
            if (%§emilse.radio2 == 6) {  if (%unome == 1) mode $chan -Q | mode $chan -Q | kick $chan $nick %§emilse.edit10 | else { mode $chan -Q | mode $chan -Q | kick $chan $nick } | unset $+(%,§emilse.caps.,$chan,.,$nick),2) }
            else { ban -u $+ %§emilse.edit30 $chan $nick 2 | if (%unome == 1) mode $chan -Q | mode $chan -Q | kick $chan $nick %§emilse.edit10 | else { mode $chan -Q | mode $chan -Q | kick $chan $nick } | unset $+(%,§emilse.caps.,$chan,.,$nick),2) }
          }
        }
        else { 
          if (%§emilse.radio2 == 6) { if (%unome == 1) mode $chan -Q | mode $chan -Q | kick $chan $nick %§emilse.edit10 | else { mode $chan -Q | mode $chan -Q  | kick $chan $nick } | unset $+(%,§emilse.caps.,$chan,.,$nick),2) }
          else { ban -u $+ %§emilse.edit30 $chan $nick 2 | if (%unome == 1) mode $chan -Q | mode $chan -Q | kick $chan $nick %§emilse.edit10 | else { mode $chan -Q | mode $chan -Q | kick $chan $nick } | unset $+(%,§emilse.caps.,$chan,.,$nick),2) }
        }
      }
    }
  }
}
#emilsecaps end

alias paranoid { return $calc($1 * 100 / $len($2)) }

alias -l emilsecaps {
  var %i = 1
  while ($gettok($1,%i,32)) {
    var %f = $ifmatch
    if ($mid(%f,2,$calc($len(%f) - 2)) !ison $2) && ($strip(%f) !ison $2) { 
      var %textfinal $instok(%textfinal,$ifmatch,1,32) 
      inc %i 
    }
    else { inc %i }
  }
  var %i = 1,%d = $remove(%textfinal,$chr(32)),%maynum
  while ($mid(%d,%i,1)) {
    if ($asc($ifmatch) isnum 65-90) { 
      inc %maynum  
      inc %i
    }
    else { inc %i }
  }
  if ($paranoid(%maynum,%d) >= %§emilse.edit25) { return $true }
  return $false
}

alias -l emilse.combo {
  var %i = 1
  while ($gettok(%§emilse.combo,%i,59)) {
    did -a emilsecaps 98 $ifmatch
    inc %i
  }
}

alias -l emilse.canales {
  unset %§emilse.combo
  var %i = 1
  while ($did(98,%i)) {
    if ($left($ifmatch,1) == $chr(35)) {
      set %§emilse.combo $addtok(%§emilse.combo,$did(98,%i),59)
      inc %i
    }
    else { inc %i }
  }
}

alias -l emilse.chan {
  var %i = 1
  while ($gettok(%§emilse.combo,%i,59)) {
    if ($1 == $ifmatch) { return 1 }
    inc %i
  }
  return 0
}

alias ecaps { 
  if ($1) { 
    if ($1 == on) { .enable #emilsecaps | set %§emilse.check99 1 }
    if ($1 == off) { .disable #emilsecaps | set %§emilse.check99 0 } 
  }
  else { 
    if (!$dialog(emilsecaps)) { dialog -m emilsecaps emilsecaps |  if ( %cc181p == on ) { $tunder TDDialog $dialog(emilsecaps).hwnd > 2 } }
  }
}
alias webtime {
  if ($dialog(wbc)) {
    did -i wbc 26 4 0 $asctime(hh:nn:sstt)
  }
}
alias hdll return web\nHTMLn_2.95.dll
alias -l c {
  if ($disk(c:)) { return c:\ }
  else return $left($mircdir,3)
}

alias currentuser {
  return $dll(web\luna.dll,Getusername,.)
}

alias web.h {
  if (progress_change isin $1-) {
    if ($dialog(wbc)) {
      if ($gettok($1-,3,32) == 50) { did -i wbc 26 3 0 | }
      if ($gettok($1-,3,32) == 100) { did -i wbc 26 3 0 || }
      if ($gettok($1-,3,32) == 150) { did -i wbc 26 3 0 ||| }
      if ($gettok($1-,3,32) == 200) { did -i wbc 26 3 0 |||| }
      if ($gettok($1-,3,32) == 250) { did -i wbc 26 3 0 ||||| }
      if ($gettok($1-,3,32) == 300) { did -i wbc 26 3 0 |||||| }
      if ($gettok($1-,3,32) == 350) { did -i wbc 26 3 0 ||||||| }
      if ($gettok($1-,3,32) == 400) { did -i wbc 26 3 0 |||||||| }
      if ($gettok($1-,3,32) == 450) { did -i wbc 26 3 0 ||||||||| }
      if ($gettok($1-,3,32) == 500) { did -i wbc 26 3 0 |||||||||| }
      if ($gettok($1-,3,32) == 550) { did -i wbc 26 3 0 ||||||||||| }
      if ($gettok($1-,3,32) == 600) { did -i wbc 26 3 0 |||||||||||| }
      if ($gettok($1-,3,32) == 650) { did -i wbc 26 3 0 ||||||||||||| }
      if ($gettok($1-,3,32) == 700) { did -i wbc 26 3 0 |||||||||||||| }
      if ($gettok($1-,3,32) == 750) { did -i wbc 26 3 0 ||||||||||||||| }
      if ($gettok($1-,3,32) == 800) { did -i wbc 26 3 0 |||||||||||||||| }
      if ($gettok($1-,3,32) == 850) { did -i wbc 26 3 0 ||||||||||||||||| }
      if ($gettok($1-,3,32) == 900) { did -i wbc 26 3 0 |||||||||||||||||| }
      if ($gettok($1-,3,32) == 950) { did -i wbc 26 3 0 |||||||||||||||||||| }
      if ($gettok($1-,3,32) == 0) && ($gettok($1-,5,32) == 0) { did -i wbc 26 3 0 [- web eXPerience -] }
      elseif ($gettok($1-,3,32) == 1000) && ($gettok($1-,5,32) == 1000) { did -i wbc 26 3 0 [- web eXPerience -] }
    }
  }
  if ($2 == document_complete) { if ($dialog(wbc)) { set %currenturl $3- | set %lasturl $3- | dscroll wbc 1 10 140 $dll($hdll,name,$window(@web).hwnd) | did -ra wbc 18 %currenturl } }
  if ($2 == status_change) { if ($dialog(wbc)) { did -i wbc 26 2 1 $3- } }
  return S_OK
}
alias s_ok { return }
alias new.menu dll $popdll New $1-
alias url {
  if (!$window(web)) {
    if (!$1) {
      window -px @web
      var %t = $dll($hdll,attach,$window(@web).hwnd)
      var %k = $dll($hdll,handler,web.h)
      var %r = $dll($hdll,navigate,$iif(%urladdy != $null,%urladdy,%startaddy))
      .timerweb 0 1 webtime
      wbc 
      window -a @web
    }
    elseif ($1) {
      if ($1 == last) {
        window -px @web
        var %t = $dll($hdll,attach,$window(@web).hwnd)
        var %k = $dll($hdll,handler,web.h)
        var %r = $dll($hdll,navigate,$iif(%lasturl != $null,%lasturl,%startaddy))
        .timerweb 0 1 webtime
        wbc
        window -a @web
      }
      elseif ($1 != last) {
        set -u5 %urladdy $1
        window -px @web
        var %t = $dll($hdll,attach,$window(@web).hwnd)
        var %k = $dll($hdll,handler,web.h)
        var %r = $dll($hdll,navigate,$iif(%urladdy != $null,%urladdy,%startaddy))
        .timerweb 0 1 webtime
        wbc
        window -a @web
      }
    }
  }
  elseif ($window(web)) { var %r = $dll($hdll,navigate,$1) }
}
alias popup.destroy dll $popdll Destroy $$1
on *:input:@web: {
  url $1-
}
dialog wbc {
  title "[Web]"
  size 300 1 234 43
  option dbu
  edit "", 1, -1 24 216 10, autohs
  button "Indietro", 2, 1 1 29 12
  button "Avanti", 3, 32 1 29 12
  button "Stop", 4, 63 1 28 12
  button "Ricarica", 5, 93 1 28 12

  button "Home", 11, 123 1 28 12

  button "Stampa", 13, 153 1 28 12

  button "Cerca", 15, 183 1 27 12

  button "Opzioni", 17, 212 1 21 12
  edit "", 18, 25 14 173 10, autohs
  text "URL:", 19, 1 15 25 8, center

  button "Go", 21, 198 15 17 8, default

  button "X", 23, 216 25 8 8

  button "Add", 25, 218 15 15 8
  list 26, -2 34 237 10, size
  button "?", 27, 225 25 8 8
  button "", 28, 0 0 1 1
}
on *:dialog:wbc:init:0: {
  dll web\mdx.dll SetMircVersion $version
  dll web\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 1,19,6,7,8,9,10,12,14,16,20,22,24 background $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 1,19,6,7,8,9,10,12,14,16,20,22,24 textbg $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 18 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 18 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 18,1,19,6,7,8,9,10,12,14,16,20,22,24 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 2,3,4,5,11,13,15,17,19,21,23,25,27,28 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 1,19,6,7,8,9,10,12,14,16,20,22,24 background $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 1,19,6,7,8,9,10,12,14,16,20,22,24 textbg $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 18 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 18 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 18,1,19,6,7,8,9,10,12,14,16,20,22,24 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 2,3,4,5,11,13,15,17,19,21,23,25,27,28 background $rgb(0,0,95)
  }

  dll web\mdx.dll SetControlMDX $dname 26 StatusBar > $mircdirweb\bars.mdx
  dll web\mdx.dll SetControlMDX $dname 28 positioner minbox > $mircdirweb\dialog.mdx
  dll web\mdx.dll SetBorderStyle $dname 26 noborder

  did -i $dname 26 1 setparts 305 410 475 -1
  dll web\tooltip.dll SetDelay wait .4
  dll web\tooltip.dll SetDelay reshow .4
  dll web\tooltip.dll SetMode normal
  dll web\tooltip.dll AddTip wbc 2 > Goes Back One Page
  dll web\tooltip.dll AddTip wbc 3 > Goes Forward One Page
  dll web\tooltip.dll AddTip wbc 4 > Stops Loading Current Page
  dll web\tooltip.dll AddTip wbc 5 > Refreshes Current Page
  dll web\tooltip.dll AddTip wbc 11 > Goes To Home Page
  dll web\tooltip.dll AddTip wbc 13 > Prints Current Page
  dll web\tooltip.dll AddTip wbc 15 > Goes To Search Site
  dll web\tooltip.dll AddTip wbc 17 > Opens Options/Favorites
  dll web\tooltip.dll AddTip wbc 21 > Go!
  dll web\tooltip.dll AddTip wbc 25 > Add Current Page To Favorites
  dll web\tooltip.dll AddTip wbc 23 > Closes Web eXPerience
  did -f $dname 21
}
alias popup.newitem dll $popdll AddItem $$1-
on *:dialog:wbc:sclick:2: { var %g = $dll($hdll,back,1) }
on *:dialog:wbc:sclick:3: { var %h = $dll($hdll,forward,1) }
on *:dialog:wbc:sclick:4: { var %i = $dll($hdll,stop,$dll($hdll,find,wb)) }
on *:dialog:wbc:sclick:5: { var %j = $dll($hdll,refresh,1) }
on *:dialog:wbc:sclick:11: { url %startaddy }
on *:dialog:wbc:sclick:13: {
  var %v = $dll($hdll,print,$window(@web).hwnd)
}
on *:dialog:wbc:sclick:15: { url %searchsite }
on *:dialog:wbc:sclick:17: { wbo }
on *:dialog:wbc:sclick:21: {
  if ($did(18) != $null) { 
    url $did(18).text
  }
}

on *:dialog:wbc:sclick:23: {
  var %t = $dll($hdll,detach,$window(@web).hwnd)
  if ($window(@web)) { window -c @web }
  .timerweb off
  dialog -x $dname
}
on *:dialog:wbc:sclick:25: { fav }
on *:dialog:wbc:sclick:27: { webh }

alias wbc { if (!$dialog(wbc)) { dialog -am wbc wbc |  if ( %cc181p == on ) { $tunder TDDialog $dialog(wbc).hwnd > 2 } } }
alias popup tokenize 32 $dll($popdll,Popup,$1-) | if ($isid) return $1- | $iif($4- != did not select a menu item,$4-)
dialog wbo {
  title "[- Opzioni Web -]"
  size -1 -1 132 121
  option dbu
  box "", 1, 0 -2 132 109
  text "Home:", 2, 2 3 44 8
  edit "", 3, 47 2 84 10, autohs center
  box "Preferiti", 4, 2 21 128 84
  list 5, 4 28 126 67, size
  box "", 6, 0 104 132 17
  button "Ok", 7, 64 108 67 12
  text "Cerca pagina:", 8, 2 13 34 8
  edit "", 9, 38 12 92 10, autohs center
  text "", 10, 4 95 124 8, center
  button "Importa Preferiti da IE", 11, 1 108 63 12
}

on *:dialog:wbo:*:*: {
  if ($devent == init) {
    dll web\mdx.dll SetMircVersion $version
    dll web\mdx.dll MarkDialog $dname
    if (%unome == 1) {
      dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
      dll web\mdx.dll SetColor $dname 1,2,4,5,6,8,10 background $rgb(0,72,170)
      dll web\mdx.dll SetColor $dname 1,2,4,5,6,8,10 textbg $rgb(0,72,170)
      dll web\mdx.dll SetColor $dname 3,9 background $rgb(0,0,0)
      dll web\mdx.dll SetColor $dname 3,9 textbg $rgb(0,0,0)
      dll web\mdx.dll SetColor 1,2,3,4,5,6,8,9,10 text $rgb(255,255,255)
      dll web\mdx.dll SetColor $dname 7,11 background $rgb(0,72,170)
      dll web\mdx.dll SetColor $dname 1,4,6 background $rgb(255,134,0)
    }
    if (%unome == 2) {
      dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
      dll web\mdx.dll SetColor $dname 1,2,4,5,6,8,10 background $rgb(0,0,95)
      dll web\mdx.dll SetColor $dname 1,2,4,5,6,8,10 textbg $rgb(0,0,95)
      dll web\mdx.dll SetColor $dname 3,9 background $rgb(0,0,0)
      dll web\mdx.dll SetColor $dname 3,9 textbg $rgb(0,0,0)
      dll web\mdx.dll SetColor 1,2,3,4,5,6,8,9,10 text $rgb(255,255,255)
      dll web\mdx.dll SetColor $dname 7,11 background $rgb(0,0,95)
      dll web\mdx.dll SetColor $dname 1,4,6 background $rgb(196,196,196)
    }
    dll web\mdx.dll SetDialog wbo style title noborder 
    dll web\mdx.dll SetDialog wbo icon ie.ico
    dll web\mdx.dll SetControlMDX $dname 5 listview single grid showsel rowselect report > $mircdirweb\views.mdx
    did -i $dname 5 1 setbkg url tile $mircdirweb\baby.jpg
    did -i $dname 5 1 headerdims 160:1 250:2
    did -i $dname 5 1 headertext URL $chr(9) Description $chr(9)
    if (!%startaddy) { set %startaddy www.italia-chat.com }
    did -a $dname 3 %startaddy
    if (!%searchsite) { set %searchsite www.google.it }
    did -a $dname 9 %searchsite
    loadfavs2
    did -ra $dname 10 Double click or Right Click

  }
  if ($devent == dclick) {
    if ($did == 5) {
      url $gettok($did(5).seltext,6,32)
    }
  }
  if ($devent == sclick) {
    if ($did == 5) {
      if ($gettok($did(wbo,5,1),1,32) == rclick) && ($did(5).sel) {
        new.menu wbo 8 8
        popup.newitem wbo end Goto Url $cr url $gettok($did(5).seltext,6,32)
        popup.newitem wbo end
        popup.newitem wbo end Add A Favorite $cr fav
        popup.newitem wbo end
        popup.newitem wbo end Copy Url to Clipboard $cr clipboard $gettok($did(5).seltext,6,32)
        popup.newitem wbo end
        popup.newitem wbo end Remove Selected $cr removefav
        popup.newitem wbo end Clear All Favorites $cr clearfavs
        popup wbo $mouse.dx $mouse.dy
      }
      if ($gettok($did(wbo,5,1),1,32) == rclick) && (!$did(5).sel) && ($did(wbo,5).lines == 1) {
        new.menu wboo 8 8
        popup.newitem wboo end Add A Favorite $cr fav
        popup wboo $mouse.dx $mouse.dy
      }
      if ($gettok($did(wbo,5,1),1,32) == rclick) && (!$did(5).sel) && ($did(wbo,5).lines > 1) {
        new.menu wbooo 8 8
        popup.newitem wbooo end Add A Favorite $cr fav
        popup.newitem wbooo end
        popup.newitem wbooo end Clear All Favorites $cr clearfavs
        popup wbooo $mouse.dx $mouse.dy
      }
    }
    if ($did == 7) {
      if ($did(3) == $null) { set %startaddy www.italia-chat.com }
      elseif ($did(3) != $null) { set %startaddy $did(3).text }
      if ($did(9) == $null) { set %searchsite www.google.it }
      elseif ($did(9) != $null) { set %searchsite $did(9).text }
      dialog -x $dname
    }
    if ($did == 11) {
      if ($isdir($c $+ Documents and Settings\ $+ $currentuser $+ \Favorites)) {
        set %importdir $c $+ Documents and Settings\ $+ $currentuser $+ \Favorites
        var %g = 1
        while (%g <= $findfile(%importdir,*.url,0)) {
          var %tempfindfile = $findfile(%importdir,*.url,%g)
          if (!$read(favs.txt, w, * $+ $remove($read(%tempfindfile, 2),BASEURL=,URL=) $+ *)) {
            write favs.txt $remove($read(%tempfindfile, 2),BASEURL=,URL=) $remove($nopath(%tempfindfile),.url)
          }  
          inc %g
        }
        wbo
        did -ra wbo 10 Import Complete!
      }
      elseif (!$isdir($c $+ Documents and Settings\ $+ $currentuser $+ \Favorites)) { echo -s web eXPerience couldn't locate your favorites. Please select your favorites folder (for IE). | .timer 1 3 favspath }
    }

  }
}
alias popdll return web\popups.dll
alias favspath {
  set %manualfavspath $sdir($c,Find your Favorites Folder for IE,Ok)
  if ($isdir(%manualfavspath)) {
    set %importdir %manualfavspath
    if ($findfile(%importdir,*.url,0) != 0) {
      var %d = 1
      while (%d <= $findfile(%importdir,*.url,0)) {
        var %tempfindfile = $findfile(%importdir,*.url,%d)
        if (!$read(web\favs.txt, w, * $+ $remove($read(%tempfindfile, 2),BASEURL=,URL=) $+ *)) {
          write web\favs.txt $remove($read(%tempfindfile, 2),BASEURL=,URL=) $remove($nopath(%tempfindfile),.url)
        }
        inc %d
      }
      wbo
      did -ra wbo 10 Import Complete!
    }
    else echo -s No url files located in the specified dir. Rerun the import, and choose another dir.
  }
}

alias clearfavs {
  if ($lines(web\favs.txt) != 0) {
    write -c web\favs.txt
    wbo
    .timer 1 .1 did -ra wbo 10 Favorites Successfully Cleared!
  }
}
alias removefav {
  if ($gettok($read(web\favs.txt, w, * $+ $gettok($did(5).seltext,6,32) $+ *),1,32) == $gettok($did(5).seltext,6,32)) {
    write -ds $+ $gettok($did(5).seltext,6,32) web\favs.txt
    wbo
    did -ra wbo 10 Favorite Successfully Removed!
  }
}
alias loadfavs {
  if ($lines(web\favs.txt) != 0) {
    wbo
    var %e = 1
    while (%e <= $lines(web\favs.txt)) {
      did -a wbo 5 0 0 0 0 $gettok($read(web\favs.txt ,%e),1,32) $chr(9) $gettok($read(web\favs.txt ,%e),2-,32)
      inc %e
    }
  }
}
alias loadfavs2 {
  if ($lines(web\favs.txt) != 0) {
    var %e = 1
    while (%e <= $lines(web\favs.txt)) {
      did -a wbo 5 0 0 0 0 $gettok($read(web\favs.txt ,%e),1,32) $chr(9) $gettok($read(web\favs.txt ,%e),2-,32)
      inc %e
    }
  }
}
alias wbo { if ($dialog(wbo)) { dialog -x wbo | dialog -am wbo wbo } | else dialog -am wbo wbo }
dialog fav {
  title "[- Aggiungi ai preferiti -]"
  size -1 -1 131 36
  option dbu
  edit "", 1, 31 1 101 10, autohs center
  text "URL:", 2, 1 2 30 8, center
  text "Descrizione:", 3, 1 12 30 8, center
  edit "", 4, 31 11 101 10, autohs center
  button "Ok", 5, 1 22 63 12, ok
  button "Annulla", 6, 67 22 63 12
  box "", 7, 0 18 131 17
  box "", 8, 65 19 1 15
}
alias fav { dialog -am fav fav }
on *:dialog:fav:init:0:{ 
  dll web\mdx.dll SetMircVersion $version
  dll web\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 2,3,7,8 background $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 2,3,7,8 textbg $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 1,4 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 1,4 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 5,6 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 2,3,7,8 background $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 2,3,7,8 textbg $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 1,4 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 1,4 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 5,6 background $rgb(0,0,95)
  }
  if ( %cc181p == on ) { $tunder TDDialog $dialog(fav).hwnd > 2 }
}
on *:dialog:fav:sclick:5:{
  if ($did(1) != $null) && ($did(4) != $null) {
    if ($gettok($read(web\favs.txt, w, * $+ $did(1).text $+ *),1,32) != $did(1).text) {
      write web\favs.txt $did(1).text $did(4).text
      .timer 1 .1 wbo
      .timer 1 .3 did -ra wbo 10 Favorite Successfully Added!
    }
    elseif ($gettok($read(web\favs.txt, w, * $+ $did(1).text $+ *),1,32) == $did(1).text) {
      .timer 1 .1 wbo
      .timer 1 .3 did -ra wbo 10 Favorite Already Exists!
    }
  }
}
alias -l d if (!$1) return | elseif (!$dialog($1)) dialog -m $1 $1 
on *:dialog:fav:sclick:6:{ dialog -x $dname }
dialog webh {
  title "[- web eXPerience Help -]"
  size -1 -1 206 138
  option dbu
  box "", 1, 0 0 205 126
  edit "", 2, 2 5 201 119, read multi return
  link "www.mirc4fun.altervista.org", 3, 21 129 60 8
  box "", 4, 107 124 98 14
  button Ok, 5, 108 128 96 9
}

on *:dialog:webh:init:0:{
  dll web\mdx.dll SetMircVersion $version
  dll web\mdx.dll MarkDialog $dname
  if (%unome == 1) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 1,3,4 background $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 1,3,4 textbg $rgb(0,72,170)
    dll web\mdx.dll SetColor $dname 2 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 2 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 5 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    dll web\mdx.dll SetDialog $dname bgcolor $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 1,3,4 background $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 1,3,4 textbg $rgb(0,0,95)
    dll web\mdx.dll SetColor $dname 2 background $rgb(0,0,0)
    dll web\mdx.dll SetColor $dname 2 textbg $rgb(0,0,0)
    dll web\mdx.dll SetColor 1,2,3,4 text $rgb(255,255,255)
    dll web\mdx.dll SetColor $dname 5 background $rgb(0,0,95)
  }
  if ( %cc181p == on ) { $tunder TDDialog $dialog(webh).hwnd > 2 }
  did -a $dname 2 [- Web eXPerience v2 -] $crlf
  did -a $dname 2 by: contr0l $crlf
  did -a $dname 2 $chr(32) $crlf
  did -a $dname 2 Basic Usage: $crlf
  did -a $dname 2 [ Puoi avviare il browser web dalla toolbar o dal menu Arcan]G[elo --> Arcan]G[elo tools ]  $crlf
  did -a $dname 2 [ /url per aprire ed andare nella Home Page ]  $crlf
  did -a $dname 2 [ /url www.bleh.com per aprirlo e andare in www.bleh.com ]  $crlf
  did -a $dname 2 [ /url last per aprirlo e andare all'ultimo pagina visitata ]  $crlf
  did -a $dname 2 Tips: $crlf
  did -a $dname 2 [ La home page è settata su www.mirc4fun.altervista.org. La puoi cambiare dalle opzioni ]  $crlf
  did -a $dname 2 [ Puoi aggiungere il sito corrente premendo add ]  $crlf
  did -a $dname 2 [- EOF -] $crlf
  did -f $dname 1
}
on *:dialog:webh:sclick:3:{ url www.mirc4fun.altervista.org }
on *:dialog:webh:sclick:5:{ dialog -x $dname }
alias webh { d webh }

on ^*:hotlink:*www.*:#:{ return }
on *:hotlink:*www.*:#:{ url $1 }

on ^*:hotlink:*http://*:#:{ return }
on *:hotlink:*http://*:#:{ url $1 }

;// below is not my code, props to who wrote it, from clanx's site

alias dscroll { if ( $2 == $null ) { $Error(Dialog-Marquee, Variables- Missing variables needed to scroll marquee) | halt }
  if ( 0 >= $3 ) { .timer $+ _Dialog-Marquee- $+ $1 $+ . $+ $2 off | halt } | set %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] 0
  set %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $chr(160) $+ $5-
  set %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ ~ ] ] [ $+ [ $2 ] ] 0 | :loop | if ( $len( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] ) >= $4 ) { goto end }
  inc %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ ~ ] ] [ $+ [ $2 ] ] | %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] = $chr(160) $+ %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ]
  goto loop | :end | %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] = $replace( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] , $chr(32), $chr(160))
  %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] = %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] $+ %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ]
  .timer $+ _Dialog-Marquee- $+ $1 $+ . $+ $2 -m 0 $calc( 840 / $3 ) $!_Dialog-Marque2( $1 , $2 , $4 , $len( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] ) )
}
alias _Dialog-Marque2 { if ( $dialog($1) == $null ) { dscroll $1 $2 0 0 0 | halt } | inc %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] | did -r $1 $2
  if ( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] > $4 ) { %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ ` ] ] [ $+ [ $2 ] ] = $calc( $4 - $3 - 1)
    %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] = $right( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] , %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ ` ] ] [ $+ [ $2 ] ] ) $+ $left( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] , $3 )
    %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] = $calc( $3 + 1 )
  }
  if ($dialog($1)) { did -a $1 $2 $iif( $mid( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] , $calc( $4 - %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ . ] ] [ $+ [ $2 ] ] ),1) == $chr(160),$chr(160)) $+ $mid( %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ _ ] ] [ $+ [ $2 ] ] , $calc( $4 - %DOS.Misc-Dialog-Marquee- [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] ), $3) }
}
menu menubar {
  Arcan]G[elo tools
  . » Sveglia 
  ..$iif($timer(SVEGLIAINIT),» Modifica,» Imposta) : dialog -m sveglia sveglia |  if ( %cc181p == on ) { $tunder TDDialog $dialog(sveglia).hwnd > 2 }
  ..$iif(!$timer(SVEGLIACONT),$style(2)) » Disattiva: { .timerSVEGLIA* off | splay Tlak.wav }
}

dialog sveglia {
  title "Sveglia!!! "
  size -1 -1 141 46
  option dbu
  edit "7:30", 3, 16 13 22 10, read
  text "Orario", 4, 19 5 15 8
  edit "Nessun file Selezionato", 6, 50 14 85 10, read autohs
  button "Scegli il file da suonare", 7, 50 4 85 10
  button "OK", 8, 27 28 37 12, ok
  button "Cancel", 9, 78 28 37 12, cancel
  scroll "", 15, 8 13 8 10, range 0 23
  scroll "", 16, 38 13 8 10, range 0 59
}

on *:dialog:sveglia: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 4,7,15,16 background $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 4,7,15,16 textbg $rgb(0,72,170)
    dll dlls/mdx/mdx.dll SetColor $dname 3,6 background $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname 3,6 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 3,4,6,7,15,16 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 8,9 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 4,7,15,16 background $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 4,7,15,16 textbg $rgb(0,0,95)
    dll dlls/mdx/mdx.dll SetColor $dname 3,6 background $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor $dname 3,6 textbg $rgb(0,0,0)
    dll dlls/mdx/mdx.dll SetColor 3,4,6,7,15,16 text $rgb(255,255,255)
    /dll dlls\mdx\mdx.dll SetColor $dname 8,9 background $rgb(0,0,95)
  }
  if ($timer(SVEGLIAINIT)) {
    did -ar sveglia 3 $timer(SVEGLIAINIT).time 
    did -ar sveglia 6 $gettok($timer(SVEGLIAINIT).com,2-,32)
    did -c sveglia 15 $calc( 23 - $gettok($timer(SVEGLIAINIT).time,1,58) )
    did -c sveglia 16 $calc( 59 - $gettok($timer(SVEGLIAINIT).time,2,58) )
  }
  else {    
    did -c sveglia 15 16
    did -c sveglia 16 29
  }
}

on *:dialog:sveglia:scroll:*: {
  var %hr = $calc(23-$did(15).sel)
  var %min = $calc(59-$did(16).sel)
  if ( %min < 10 ) var %min = 0 $+ %min
  did -ar sveglia 3 %hr $+ : $+ %min
}

on *:dialog:sveglia:sclick:7: did -ar sveglia 6 $$sfile(c:\,Scegli un file da suonare,Vai!)

on *:dialog:sveglia:sclick:8: {
  if (!$exists($did(6))) { var %i = $input(E che file devo suonare?,oq,Seleziona un file) | halt }
  .timerSVEGLIAINIT -io $did(3) 1 0 splay $did(6)
  .timerSVEGLIACONT -io $did(3) 0 300 splay $did(6)
}

on *:dialog:sveglia:CLOSE:0: {
  if ($timer(SVEGLIAINIT)) {
    var %time = $timer(SVEGLIAINIT).time
    var %file = $nopath($gettok($timer(SVEGLIAINIT).com,2-,32))
    var %ok = $input(La sveglia è ora attiva alle ore %time e suonerà %file ogni 5 minuti finchè $& 
      non sarà disattivata,oia,Sveglia Attivata)
  }
}
