on *:load:{
  if ($version == 5.08) || ($version == 5.09) || ($version == 6.0) || ($version == 6.01)  || ($version == 6.02) || ($version == 6.03) || ($version == 6.12) || ($version == 6.14) || ($gettok($version,1,46) >= 6)  { 
    set %sradio.nome (soft!) Radio Player 0.1
    set %sradio.genero (soft!)
    set %sradio.url www.softeam.rg3.net
    set %sradio.equal 30 31 31 31 31 31 31 31 31 31 31
    set %sradio.equal2 Off
    set %sradio.bal 0
    set %sradio.vol 255
    set %sradio.mute Off
    set %sradio.msg 3,1Ascolta Questa Radio 4 [u] 7- 4[g] %scriptlogo
    set %sradio.msgcanais On
    set %sradio.msgnotice off
    set %sradio.msgecho off
    set %sradio.msgtimer On
    set %sradio.msgtimersecs 8
    ampload | eqload
    dll $bamp_in Misc equalizer preamp-set 31
    dll $bamp_in Misc equalizer set 31 31 31 31 31 31 31 31 31 31
    dll $bamp_in Misc setpan 0
    dll $bamp_in Misc setvolume 255
  } | else { echo 4Versão do mIRC Incorreta, $chr(2) $+ $version $+ $chr(2) $+ , somente maior que 5.08..  | .unload -rs $shotfn($script) }
}
on *:unload:{
  unset %sradio.*
  .timersradio* off
  if ($dialog(sradio)) { dialog -x sradio }
  dll $bamp_in Stop .
  sockclose sradio
}
dialog sradio {
  title "(soft!) Radio Player 0.1"
  size -1 -1 296 442
  option pixels
  button "", 1, 0 0 0 0, hide cancel
  list 4, 10 282 276 100, size
  button "Aggiungi", 5, 4 396 55 23
  button "Rimuovi", 6, 62 396 55 23, disable
  button "Pulisci", 8, 120 396 55 23
  list 10, 260 110 18 100, size
  list 11, 84 110 18 100, size
  list 12, 106 110 18 100, size
  list 13, 128 110 18 100, size
  list 14, 150 110 18 100, size
  list 15, 172 110 18 100, size
  list 16, 60 110 18 100, size
  list 17, 194 110 18 100, size
  list 18, 216 110 18 100, size
  list 19, 238 110 18 100, size
  list 20, 22 110 18 100, size
  text "Preamp", 21, 12 212 46 16, disable
  box "Equalizzatore", 22, 4 90 288 174, disable
  text "60", 24, 62 212 20 16, disable
  text "170", 25, 81 212 20 16, disable
  text "600", 26, 128 212 20 16, disable
  text "310", 27, 105 212 20 16, disable
  text "1k", 28, 153 212 20 16, disable
  text "3k", 29, 174 212 20 16, disable
  text "6k", 30, 197 212 20 16, disable
  text "12k", 31, 216 212 20 16, disable
  text "14k", 32, 238 212 20 16, disable
  text "16k", 33, 260 212 20 16, disable
  box "Lista delle radio", 34, 4 266 288 124, disable
  text "", 3, 65 20 218 16, center
  text "", 2, 12 20 50 16, center
  box "Radio Attuale", 35, 4 2 288 85, disable
  list 36, 62 65 60 18, size
  text "Bilanciamento:", 37, 10 66 50 16
  check "", 38, 240 64 10 10
  text "Muto", 380, 260 64 49 20
  list 39, 172 65 60 18, size
  text "Volume:", 40, 127 66 42 16
  text "", 41, 12 42 90 16, center
  text "", 42, 105 42 178 16, center
  text "", 9, 4 424 290 15, disable
  check "", 23, 210 240 20 20, hide
  text "Equalizzatore", 230, 230 240 78 20, hide
  button "Connetti", 7, 223 396 70 23
  button "Msg", 43, 178 396 42 23
  button "Stili", 44, 12 234 55 23
  button "", 45, 0 0 0 0, hide
}
on *:dialog:sradio:init:*:{
  bmdx SetMircVersion $version
  bmdx MarkDialog $dname
  bmdx SetDialog $dname icon $shortfn($scriptdirIcones/Sound.ico)
  bmdx SetControlMDX 45 positioner minbox > $bmdialog
  dialogsradio
  if (%unome == 1) {
    bmdx SetFont 1,2,3,4,5,6,7,8,9,14,41,42,43,37,38,40,23,44,45 13 00 tahoma
    bmdx SetFont 9,21,24,25,27,26,28,29,30,31,32,33 13 600 tahoma
    bmdx SetBorderStyle 2,3,41,42 staticedge
    bmdx SetControlMDX 4 listview report single showsel report report flatbs rowselect > $bviews
    bmdx SetColor $dname 22,34,35 background $rgb(255,134,0)
    bmdx SetDialog $dname bgcolor $rgb(0,72,170)
    bmdx  SetColor $dname 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,4,36,37,38,380,39,40,42,23,230,9 background $rgb(0,72,170)
    bmdx  SetColor $dname 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,4,36,37,38,380,39,40,42,23,230,9 textbg $rgb(0,72,170)
    bmdx  SetColor $dname 2,3,41,42 background $rgb(0,0,0)
    bmdx  SetColor $dname 2,3,41,42 textbg $rgb(0,0,0)
    bmdx  SetColor 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,3,4,2,36,37,38,380,39,40,41,42,9,23,230 text $rgb(255,255,255)
    bmdx  SetColor $dname 1,5,6,8,7,43,44,45 background $rgb(0,72,170)
  }
  if (%unome == 2) {
    bmdx SetFont 1,2,3,4,5,6,7,8,9,14,41,42,43,37,38,40,23,44,45 13 00 tahoma
    bmdx SetFont 9,21,24,25,27,26,28,29,30,31,32,33 13 600 tahoma
    bmdx SetBorderStyle 2,3,41,42 staticedge
    bmdx SetControlMDX 4 listview report single showsel report report flatbs rowselect > $bviews
    bmdx SetColor $dname 22,34,35 background $rgb(196,196,196)
    bmdx SetDialog $dname bgcolor $rgb(0,0,95)
    bmdx  SetColor $dname 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,4,36,37,38,380,39,40,42,23,230,9 background $rgb(0,0,95)
    bmdx  SetColor $dname 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,4,36,37,38,380,39,40,42,23,230,9 textbg $rgb(0,0,95)
    bmdx  SetColor $dname 2,3,41,42 background $rgb(0,0,0)
    bmdx  SetColor $dname 2,3,41,42 textbg $rgb(0,0,0)
    bmdx  SetColor 4,10,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,3,4,2,36,37,38,380,39,40,41,42,9,23,230 text $rgb(255,255,255)
    bmdx  SetColor $dname 1,5,6,8,7,43,44,45 background $rgb(0,0,95)
  }
  did -i sradio 4 1 headerdims 202 52
  did -i sradio 4 1 headertext Url $chr(9) Porta
  .timersradio -m 0 500 dialogsradio
  did -a sradio 9 $iif($sock(sradio),Recebendo $bytes($sockbr).suf por pack ...,Aspetto connessione..)
  did -v sradio 23
  bmdx SetControlMDX 10,11,12,13,14,15,16,17,18,19,20 trackbar noticks vertical autoticks both > $bbars
  bmdx SetBorderStyle 10,11,12,13,14,15,16,17,18,19,20,36,39 tool
  did -i sradio 10,11,12,13,14,15,16,17,18,19,20 1 params 0 0 127  * * * *  13 13
  bmdx SetControlMDX 36,39 trackbar noticks horizontal autoticks both > $bbars
  did -i sradio 39 1 params %sradio.vol 0 255  * * * *  13 13
  did -i sradio 36 1 params $calc(%sradio.bal +  127) 0 254  * * * *  13 13

  did -i sradio 20 1 params $gettok($dll($bamp_in,Misc,equalizer preamp-get),2,32) 0 63  * * * *  13 13
  did -i sradio 16 1 params $gettok($dll($bamp_in,Misc,equalizer get),2,32) 0 63  * * * 10 12
  did -i sradio 11 1 params $gettok($dll($bamp_in,Misc,equalizer get),3,32) 0 63  * * * 10 12
  did -i sradio 12 1 params $gettok($dll($bamp_in,Misc,equalizer get),4,32) 0 63  * * * 10 12
  did -i sradio 13 1 params $gettok($dll($bamp_in,Misc,equalizer get),5,32) 0 63  * * * 10 12
  did -i sradio 14 1 params $gettok($dll($bamp_in,Misc,equalizer get),6,32) 0 63  * * * 10 12
  did -i sradio 15 1 params $gettok($dll($bamp_in,Misc,equalizer get),7,32) 0 63  * * * 10 12
  did -i sradio 17 1 params $gettok($dll($bamp_in,Misc,equalizer get),8,32) 0 63  * * * 10 12
  did -i sradio 18 1 params $gettok($dll($bamp_in,Misc,equalizer get),9,32) 0 63  * * * 10 12
  did -i sradio 19 1 params $gettok($dll($bamp_in,Misc,equalizer get),10,32) 0 63  * * * 10 12
  did -i sradio 10 1 params $gettok($dll($bamp_in,Misc,equalizer get),11,32) 0 63  * * * 10 12
  if (%sradio.equal2 == on) { did -c sradio 23 }
  if (%sradio.mute == on) { did -c sradio 38 }
  sradiolist
  if ($sock(sradio)) { did -e sradio 7 }
}
on *:dialog:sradio:sclick:38:{
  set %sradio.mute $iif($did(38).state == 1,On,Off) 
  if (%sradio.mute == on) { vol -vu1 } | else { vol -vu2 }
}
on *:dialog:sradio:sclick:43:{ sradioop }
on *:dialog:sradio:sclick:23:{
  set %sradio.equal2 $iif($did(23).state == 1,On,Off) 
  if (%sradio.equal2 == on) { dll $bamp_in Misc equalizer enable } | else { dll $bamp_in Misc equalizer disable }
}
on *:dialog:sradio:sclick:44:{ sradioeq }
on *:dialog:sradio:sclick:36:{ dll $bamp_in Misc setpan $calc($gettok($did(36).seltext,1,32) -127) | set %sradio.bal $calc($gettok($did(36).seltext,1,32) -127) }
on *:dialog:sradio:sclick:39:{ dll $bamp_in Misc setvolume $gettok($did(39).seltext,1,32) | set %sradio.vol $gettok($did(39).seltext,1,32) }
on *:dialog:sradio:sclick:5:{
  var %x = $input(Digita un url/host:,1,Adicionar Rádio)
  if (%x == $null) { return }
  var %h = $input(Digita una porta:,1,Adicionar Rádio)
  if (%h == $null) { return }
  write $shortfn($scriptdirRadios.db) %x %h
  sradiolist
}
alias sradiolist { did -r sradio 4 | var %a = 1 | while (%a <= $lines($shortfn($scriptdirRadios.db))) { did -a sradio 4 $gettok($read($shortfn($scriptdirRadios.db),%a),1,32) $chr(9) $gettok($read($shortfn($scriptdirRadios.db),%a),2,32) | inc %a } }
on *:dialog:sradio:sclick:4:{ if ($did(4).sel) { did -e sradio 6 } | else { did -b sradio 6 } }
on *:dialog:sradio:sclick:8:{ write -c $shortfn($scriptdirRadios.db) | did -r sradio 4 | did -b sradio 6 }
on *:dialog:sradio:sclick:6:{
  if ($did(4).sel) { write -dl $+ $calc($did(4).sel - 1) $shortfn($scriptdirRadios.db) | did -d sradio 4 $did(4).sel } 
}
on *:dialog:sradio:sclick:7:{
  if ($did(7) == Scollegare) { sockclose sradio | .timersradioanum off | .timersradiorcvd off | did -ra sradio 7 Collegare | did -ra sradio 9 Disconnesso, aspetto connessione...  | dll $bamp_in Stop . | return }
  if ($did(4).sel) && ($did(7) == Collegare) { cradio $gettok($did(4).seltext,-6,32) $gettok($did(4).seltext,11,32) } 
}
on *:dialog:sradio:dclick:4:{
  if ($did(4).sel) { cradio $gettok($did(4).seltext,-6,32) $gettok($did(4).seltext,11,32) } 
}
on *:dialog:sradio:sclick:20:{ eqset }
on *:dialog:sradio:sclick:16:{ eqset }
on *:dialog:sradio:sclick:11:{ eqset }
on *:dialog:sradio:sclick:12:{ eqset }
on *:dialog:sradio:sclick:13:{ eqset }
on *:dialog:sradio:sclick:14:{ eqset }
on *:dialog:sradio:sclick:15:{ eqset }
on *:dialog:sradio:sclick:17:{ eqset }
on *:dialog:sradio:sclick:18:{ eqset }
on *:dialog:sradio:sclick:19:{ eqset }
on *:dialog:sradio:sclick:10:{ eqset }
alias eqload { 
  dll $bamp_in Misc setpan %sradio.bal
  dll $bamp_in Misc equalizer preamp-set $gettok(%sradio.equal,1,32)
  dll $bamp_in Misc equalizer set $gettok(%sradio.equal,2-,32)
  dll $bamp_in Misc setpan %sradio.bal
  dll $bamp_in Misc setvolume %sradio.vol
  if (%sradio.equal2 == on) { dll $bamp_in Misc equalizer enable } | else { dll $bamp_in Misc equalizer disable }
}
alias eqset {
  dll $bamp_in Misc equalizer preamp-set $gettok($did(20).seltext,1,32) 
  dll $bamp_in Misc equalizer set $gettok($did(16).seltext,1,32) $gettok($did(11).seltext,1,32) $gettok($did(12).seltext,1,32) $gettok($did(13).seltext,1,32) $gettok($did(14).seltext,1,32) $gettok($did(15).seltext,1,32) $gettok($did(17).seltext,1,32) $gettok($did(18).seltext,1,32) $gettok($did(19).seltext,1,32) $gettok($did(10).seltext,1,32)
  set %sradio.equal $gettok($dll($bamp_in,Misc,equalizer preamp-get),2,32) $gettok($did(16).seltext,1,32) $gettok($did(11).seltext,1,32) $gettok($did(12).seltext,1,32) $gettok($did(13).seltext,1,32) $gettok($did(14).seltext,1,32) $gettok($did(15).seltext,1,32) $gettok($did(17).seltext,1,32) $gettok($did(18).seltext,1,32) $gettok($did(19).seltext,1,32) $gettok($did(10).seltext,1,32)
}

alias dialogsradio {
  if ($dialog(sradio)) { 
    did -ra sradio 2 $gmt($int($calc($gettok($dll($bamp_in,CurrentMusic,position),2,32) / 1000)),nn:ss)
    did -ra sradio 3 $iif($sock(sradio).status == active,%sradio.nome,Aspettando connessione...)
    did -ra sradio 41 $iif($sock(sradio).status == active,$mid(%sradio.genero,1,10) $+ ...,Aspettando...)
    did -ra sradio 42 $iif($sock(sradio).status == active,%sradio.url,Aspettando connessione...)
    did -ra sradio 7 $iif($sock(sradio).status == active,Scollegare,Collegare)
  }
}
alias sradiorcvd { if ($dialog(sradio)) && ($sock(sradio)) { did -a sradio 9 $iif($sock(sradio),Recebendo $bytes(%sradio.sockbr).suf por pack ...,Aspettando connessione..) } }
alias sradio { dialog $iif($dialog(sradio),-ve,-md) sradio sradio |  if ( %cc181p == on ) { $tunder TDDialog $dialog(sradio).hwnd > 2 } }
alias cradio { dll $bamp_in Stop . |  if (!$exists($shortfn($scriptdirRadio.mp3))) { write $shortfn($scriptdirRadio.mp3) } | if ($exists($shortfn($scriptdirRadio.mp3))) { .remove $shortfn($scriptdirRadio.mp3) } |   sockclose sradio | .timersradiorcvd off | if ($dialog(sradio)) { did -ra sradio 9 Disconnesso, aspettando connessione...  } | dll $bamp_in Stop .   | sockopen sradio $remove($$1,http://,/) $2 | if ($dialog(sradio)) did -ra sradio 9 Collegando... } }
on *:sockclose:sradio:{ .timersradiorcvd off | dll $bamp_in Stop . |  if ($dialog(sradio)) { did -ra sradio 9 Errore nessuna connessione, Sconettendo... | did -ra sradio 7 Collegare } |  if ($sokerr) { sradio $sock($sockname).ip $sock($sockname).port } }
on *:sockopen:sradio:{
  if ($sockerr) { if ($dialog(sradio)) did -ra sradio 9 Errore nessuna connessione, Scollegando... | return }
  else {
    sockwrite -n $sockname GET / HTTP/1.0
    sockwrite -n $sockname Host: $sock($sockname).ip
    sockwrite -n $sockname User-Agent: (soft!) Rádio Player 0.1 para mIRC
    sockwrite -n $sockname Accept: */*
    sockwrite -n $sockname Connection: close
    sockwrite -n $sockname
    sockmark $sockname !info!
  }
}
on *:sockread:sradio:{
  if ($sock(sradio).mark == !info!) {
    var %radio
    sockread %radio 
    tokenize 58 %radio
    if ($1 == icy-name) { set %sradio.nome  $iif($2-,$2-,Nome Sconosciuto) }
    if ($1 == icy-genre) { set %sradio.genero $iif($2-,$2-,Genere Sconosciuto) }
    if ($1 == icy-url) { set %sradio.url $iif($2-,$2-,Url Sconosciuto) }
    if ($left(%radio,3) != icy) { sockmark sradio !save! }
  }
  if ($sock(sradio).mark == !save!) {
    sockread &radio 8192
    while ($sockbr) {
      set %sradio.sockbr $sockbr
      bwrite $shortfn($scriptdir) $+ Radio.mp3 -1 -1 &radio
      sockread &radio 8192
    }
    var %m = $shortfn($scriptdir) $+ Radio.mp3

    if ($exists($shortfn($shortfn($scriptdirRadio.mp3)))) && ($int($bytes($file(%m).size,k)) >= 150) && ($gettok($dll($bamp_in,CurrentMusic,status),2,32) == stopped) { if ($dialog(sradio)) { did -ra sradio 9 Abrindo Radio %sradio.nome $+ ... } | bplay %m | .timersradioarcvd 1 2 .timersradiorcvd -m 0 600 sradiorcvd }
  }
}
alias bplay { dll $bamp_in Stop | dll $bamp_in Play $remove($1-,") | sradiotimer | sradioanum }

alias bamp_in { return $shortfn($scriptdirDlls/amp_in.dll) }
alias bmdx { dll $shortfn($scriptdirDlls/mdx.dll) $1-  }
alias bbars { return $shortfn($scriptdirDlls/bars.mdx) }
alias bviews { return $shortfn($scriptdirDlls/views.mdx) }
alias bmdialog { return $shortfn($scriptdirDlls/dialog.mdx) }
alias bctl_gen { return $shortfn($scriptdirDlls/ctl_gen.mdx) }

alias ampload-all-input return $findfile($shortfn($scriptdirDlls/),in_*.dll,0,1,ampload-input-plugin $1-)
alias ampload-waveout dll $bamp_in PluginManager load output $shortfn($scriptdirDlls/out_wave.dll)
alias ampload-input-plugin dll $bamp_in PluginManager load input $1-
alias ampload { ampload-all-input | ampload-waveout }

on *:start:{ ampload | eqload | wakopacotako }
on *:connect:{ sradiorcvd | dialogsradio | .timersradio -m 0 500 dialogsradio | .timersradiorcvd -m 0 600 sradiorcvd }
on *:disconnect:{ sradiorcvd | dialogsradio | .timersradio -m 0 500 dialogsradio | .timersradiorcvd -m 0 600 sradiorcvd }
dialog sradioop {
  title "(soft!) Radio Player 0.1 - Messaggi"
  size -1 -1 296 226
  option pixels
  button "", 1, 0 0 0 0, hide cancel
  box "Messaggi", 2, 4 2 288 108, disable
  edit "", 3, 10 20 276 21, autohs
  button "", 4, 11 44 274 21
  box "Inviare messaggi per", 5, 4 111 288 84, disable
  check "", 6, 197 130 20 20
  check "", 7, 197 150 20 20
  check "", 8, 12 130 20 20
  text "Tutti i pvt", 60, 217 130 90 20
  text "Tutti i canali", 70, 217 150 90 20
  text "Notice nella finestra attiva", 80, 32 130 136 20
  button "OK", 9, 236 200 55 23, ok
  text "Tags", 10, 12 80 34 16, disable
  text "[n] Nome della Radio", 11, 55 70 110 16, disable
  text "[g] Genere della Radio", 12, 55 88 120 16, disable
  text "[u] Url della Radio", 13, 170 70 110 16, disable
  check "", 14, 12 150 20 20
  check "", 15, 12 170 20 20
  text "Mostrare nella finestra attiva", 140, 32 150 184 20
  text "Messaggio ogni", 150, 32 170 114 20
  edit "", 16, 128 170 30 21, limit 6
  text "Minuti", 17, 164 173 59 16
  button "", 18, 0 0 0 0, hide
  button "About", 19, 4 200 55 23
}
on *:dialog:sradioop:init:*:{
  if ( %cc181p == on ) {  $tunder TDDialog $dialog(sradioop).hwnd > 2 }
  mdx SetMircVersion $version
  mdx MarkDialog $dname $dialog($dname).hwnd
  if (%unome == 1) {
    mdx SetDialog $dname bgcolor $rgb(0,72,170)
    mdx  SetColor $dname 5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,17  background $rgb(0,72,170)
    mdx  SetColor $dname 5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,17 textbg $rgb(0,72,170)
    mdx  SetColor $dname 3,16  background $rgb(0,0,0)
    mdx  SetColor $dname 3,16 textbg $rgb(0,0,0)
    mdx  SetColor 3,5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,16,17 text $rgb(255,255,255)
    mdx  SetColor $dname 1,4,9,18,19 background $rgb(0,72,170)
    mdx  SetColor $dname 2 background $rgb(255,134,0)
  }
  if (%unome == 2) {
    mdx SetDialog $dname bgcolor $rgb(0,0,95)
    mdx  SetColor $dname 5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,17  background $rgb(0,0,95)
    mdx  SetColor $dname 5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,17 textbg $rgb(0,0,95)
    mdx  SetColor $dname 3,16  background $rgb(0,0,0)
    mdx  SetColor $dname 3,16 textbg $rgb(0,0,0)
    mdx  SetColor 3,5,6,7,8,60,70,80,10,11,12,13,14,15,140,150,16,17 text $rgb(255,255,255)
    mdx  SetColor $dname 1,4,9,18,19 background $rgb(0,0,95)
    mdx  SetColor $dname 2 background $rgb(196,196,196)
  }
  bmdx SetMircVersion $version
  bmdx MarkDialog $dname
  bmdx SetDialog $dname icon $shortfn($scriptdirIcones/Stickies write.ico)
  bmdx SetControlMDX 18 positioner minbox > $bmdialog
  dialogsradio
  bmdx SetFont 1,3,4,6,7,8,9,14,15,16,17,18,19 13 00 tahoma
  bmdx SetFont 2,5,10,11,12,13 13 600 tahoma
  window -ph +b @sradio 0 0 250 20
  bmdx SetControlMDX 4 window > $bmdialog
  did -a sradioop 4 grab $window(@sradio).hwnd @sradio
  sradiopre %sradio.msg
  did -a sradioop 3 %sradio.msg
  if (%sradio.msgpvt == On) { did -c sradioop 6 }
  if (%sradio.msgcanais == On) { did -c sradioop 7 }
  if (%sradio.msgnotice == On) { did -c sradioop 8 }
  if (%sradio.msgecho == On) { did -c sradioop 14 }
  if (%sradio.msgtimer == On) { did -c sradioop 15 }
  did -a sradioop 16 %sradio.msgtimersecs
}
on *:dialog:sradioop:edit:3:{ set %sradio.msg $did(3) | sradiopre %sradio.msg }
on *:dialog:sradioop:sclick:6:{ set %sradio.msgpvt $iif($did(6).state == 1,On,off) }
on *:dialog:sradioop:sclick:7:{ set %sradio.msgcanais $iif($did(7).state == 1,On,off) }
on *:dialog:sradioop:sclick:8:{ set %sradio.msgnotice $iif($did(8).state == 1,On,off) }
on *:dialog:sradioop:sclick:14:{ set %sradio.msgecho $iif($did(14).state == 1,On,off) }
on *:dialog:sradioop:sclick:15:{ set %sradio.msgtimer $iif($did(15).state == 1,On,off)  | sradiotimer }
on *:dialog:sradioop:sclick:19:{ sradioabout }
on *:dialog:sradioop:edit:16:{ set %sradio.msgtimersecs $did(16) | sradiotimer }

alias sradioop { dialog $iif($dialog(sradioop),-ve,-md) sradioop sradioop }
alias sradiopre {
  clear @sradio
  if ($1) { drawtext -pbc @sradio 1 0 Tahoma 11 4 2 280 21 $1- }
}
alias sradiomsg { return $replacecs(%sradio.msg,[n],%sradio.nome,[g],%sradio.genero,[u],%sradio.url) }
alias sradiotimer { if (%sradio.msgtimer == On) && (%sradio.msgtimersecs) { .timersradioAnum 0 $calc(%sradio.msgtimersecs * 60) sradioanum } | else { .timersradioAnum off } }
alias sradioanum { 
  if (%sradio.msg) && ($gettok($dll($bamp_in,CurrentMusic,status),2,32) == playing) {
    if (%sradio.msgpvt == On) && ($server)  { var %a = 1 | while (%a <= $query(0))  { .msg $query(%a) $sradiomsg | inc %a } }
    if (%sradio.msgcanais == On) && ($server) && ($chan(0)) { ame $sradiomsg  }
    if (%sradio.msgnotice == On) && ($server) { if ($active ischan) || ($query($active)) { msg $active $sradiomsg } }
    if (%sradio.msgecho == On) && { echo -a $sradiomsg  }
  }
}
alias item { menu AddItem $1 end $2- }
alias menu {
  var %mnu
  if ($2 == $null) { var %mnu = $dll($udll,$1,.) }
  else { var %mnu =  $dll($udll,$1,$2-) }
  if ($gettok(%mnu,1,32) == OK) { return $gettok(%mnu,2-,32) }
}
alias udll { return $shortfn($scriptdirDlls/Popups.dll) }
alias do-popup {
  var %mnuu = $menu(Popup,$1-)
  if (%mnuu != $null) $gettok(%mnuu,3-,32)
  return
}
alias udll { return dlls\popups.dll }
alias sradioeq { sradioeqq | do-popup status $mouse.dx $mouse.dy }
alias sradioeqq {
  menu New status 16 16
  item status $iif($gettok(%sradio.equal,2-,32) == 31 31 31 31 31 31 31 31 31 31,+x,) Padrão (Resetado) $cr sradiopopset 31 31 31 31 31 31 31 31 31 31 
  item status $iif($gettok(%sradio.equal,2-,32) == 31 31 27 25 25 25 27 31 31 31,+x,) Clube $cr sradiopopset 31 31 27 25 25 25 27 31 31 31
  item status $iif($gettok(%sradio.equal,2-,32) == 31 31 31 31 31 31 43 43 43 46,+x,) Clássico $cr sradiopopset 31 31 31 31 31 31 43 43 43 46 
  item status $iif($gettok(%sradio.equal,2-,32) == 21 24 29 31 31 37 39 39 31 31,+x,) Dance $cr sradiopopset 21 24 29 31 31 37 39 39 31 31 
  item status $iif($gettok(%sradio.equal,2-,32) == 13 13 13 21 31 40 47 48 48 48,+x,) Full Bass $cr sradiopopset 13 13 13 21 31 40 47 48 48 48  
  item status $iif($gettok(%sradio.equal,2-,32) == 41 41 41 36 28 20 16 16 16 18,+x,) Full Treble $cr sradiopopset 41 41 41 36 28 20 16 16 16 18
  item status $iif($gettok(%sradio.equal,2-,32) == 37 26 19 19 24 36 37 37 37 37 ,+x,) Pop $cr sradiopopset 37 26 19 19 24 36 37 37 37 37 
  item status $iif($gettok(%sradio.equal,2-,32) == 26 29 33 34 33 27 22 21 20 19,+x,) Soft $cr sradiopopset 26 29 33 34 33 27 22 21 20 19
  item status $iif($gettok(%sradio.equal,2-,32) == 15 19 41 48 38 29 22 18 18 18,+x,) Rock $cr sradiopopset 15 19 41 48 38 29 22 18 18 18 
  item status $iif($gettok(%sradio.equal,2-,32) == 22 22 24 30 37 42 36 31 26 19,+x,) Soft Rock $cr sradiopopset 22 22 24 30 37 42 36 31 26 19
  item status $iif($gettok(%sradio.equal,2-,32) == 20 25 31 42 37 31 23 19 19 19,+x,) Techno $cr sradiopopset 20 25 31 42 37 31 23 19 19 19 
  item status $iif($gettok(%sradio.equal,2-,32) == 31 31 35 43 31 22 22 31 31 31 ,+x,) Reggae $cr sradiopopset 31 31 35 43 31 22 22 31 31 31 
  item status 

  if ($gettok(%sradio.equal,2-,32) != 31 31 31 31 31 31 43 43 43 46)  && ($gettok(%sradio.equal,2-,32) != 26 29 33 34 33 27 22 21 20 19) && ($gettok(%sradio.equal,2-,32) != 41 41 41 36 28 20 16 16 16 18) && ($gettok(%sradio.equal,2-,32) != 21 24 29 31 31 37 39 39 31 31) && ($gettok(%sradio.equal,2-,32) != 31 31 27 25 25 25 27 31 31 31) && ($gettok(%sradio.equal,2-,32) != 31 31 31 31 31 31 31 31 31 31) && ($gettok(%sradio.equal,2-,32) != 13 13 13 21 31 40 47 48 48 48)  && ($gettok(%sradio.equal,2-,32) != 37 26 19 19 24 36 37 37 37 37) && ($gettok(%sradio.equal,2-,32) != 15 19 41 48 38 29 22 18 18 18)  && ($gettok(%sradio.equal,2-,32) != 20 25 31 42 37 31 23 19 19 19) && ($gettok(%sradio.equal,2-,32) != 31 31 35 43 31 22 22 31 31 31)  &&  ($gettok(%sradio.equal,2-,32) != 22 22 24 30 37 42 36 31 26 19) {
    item status +xdD Pessoal $cr ruturn
    return
  }
  item status +dD Pessoal $cr ruturn
}
alias sradiopopset {
  dll $bamp_in Misc equalizer set $1-
  set %sradio.equal $gettok(%sradio.equal,1,32) $1-
  if ($dialog(sradio)) {
    did -i sradio 16 1 params $gettok($1-,1,32) 0 63  * * * 10 12
    did -i sradio 11 1 params $gettok($1-,2,32) 0 63  * * * 10 12
    did -i sradio 12 1 params $gettok($1-,3,32) 0 63  * * * 10 12
    did -i sradio 13 1 params $gettok($1-,4,32) 0 63  * * * 10 12
    did -i sradio 14 1 params $gettok($1-,5,32) 0 63  * * * 10 12
    did -i sradio 15 1 params $gettok($1-,6,32) 0 63  * * * 10 12
    did -i sradio 17 1 params $gettok($1-,7,32) 0 63  * * * 10 12
    did -i sradio 18 1 params $gettok($1-,8,32) 0 63  * * * 10 12
    did -i sradio 19 1 params $gettok($1-,9,32) 0 63  * * * 10 12
    did -i sradio 10 1 params $gettok($1-,10,32) 0 63  * * * 10 12
  }
}
alias sradioabout { 
  echo (soft!) Rádio Player 0.1 por Pinhero
  echo  Para abrir, /sradio ou menus. Ele usa a amp_in.dll, se seu script também usa esta dll, fique tranquilo, ele funcionará sem conflitos.
  echo Este addon foi criado para ouvir rádios web (Shoutcast), com a mesma qualidade e eficiência que outros programas para vc não precisar abrir mais nada além do mIRC. Tnks BiG- por alguns estilos do equalizador. 
  echo (soft!) http://www.softeam.rg3.net/ - A Revolução do mIRC Scripting ;)    
}
