;-=-=-=-=-=-
; DeadLy Script - WAV
;-=-=-=-=-=-
on *:LOAD: wav | s.open
alias wa return @Wav
alias wav {
  window -Ckpa +fbn $wa -1 -1 290 355 $icons(mp3)
  drawrect -fr $wa $gettok(%xrgb,1,44) 1 0 0 290 355
  but1
  drawbut $wa 100 307 90 16 default 
  titlebar $wa / Mp3 / Mdi file sound system 
}
alias sss return start,login,disconnect,exit,notice,ctcp,open window,query chat,flood,deop,nick mentioned,error,click window,nuke

alias but1 { var %x 1
  while %x <= 14 { 
    drawchk $wa 10 $calc(%x *20) $hget(wav,chk $+ %x) $gettok($sss,%x,44)
    drawedit $wa 130 $calc(%x *20) 70 14
    drawbut $wa 210 $calc(%x *20) 22 14 ?
    drawbut $wa 240 $calc(%x *20) 35 14 play
    drawtext -c $wa 15 verdana 11 135 $calc(%x *20) 999 999 $iif($hget(wav,edt $+ %x) != $null, $nopath($hget(wav,edt $+ %x)), select sound)
    inc %x 1 
  }
}
alias wavchk {
  if ($inrect($mouse.x,$mouse.y,10 ,$2 ,110,16) = $true) { 
    hadd wav $1 $iif($hget(wav,$1) = on, off, on)
    drawchk $wa 10 $2 $hget(wav,$1)
  }
}
alias br {
  if ($inrect($mouse.x,$mouse.y,210 ,$2 ,25,16) = $true) { s.key
    drawbutx $wa 210 $2 22 16 ?
    hadd wav $1 $$sfile($mircdirs\wavs\*.wav;*.mp3,select *.wav;*.mp3;*.mdi files,Select)
    drawedit $wa 130 $2 70 16
    drawtext -c $wa 15 verdana 11 135 $2 999 999 $nopath($hget(wav,$1))
  }
}
alias tezt {
  if ($inrect($mouse.x,$mouse.y,240 ,$2 ,40,16) = $true) { 
    drawbutx $wa 240 $2 35 16 play
    if $isfile($hget(wav,$1)) = $true .splay $hget(wav,$1)
    else c set $style1 File not exist. click "?" to browse and select wav/mp3/mdi file
  }
}
on *:ACTIVE:@Wav: if $lactive = @edit window -c @edit
on *:CLOSE:@Wav: { unset %temp.click %editz | window -c @edit | bak.wav | unloads wav }
menu @Wav {
  sclick:{ 
    if ($inrect($mouse.x,$mouse.y,100,307,90,16) = $true) { drawbutx $wa 100 307 90 16 default | defwav | wav }
    wavchk chk1 20
    wavchk chk2 40
    wavchk chk3 60
    wavchk chk4 80
    wavchk chk5 100
    wavchk chk6 120
    wavchk chk7 140
    wavchk chk8 160
    wavchk chk9 180
    wavchk chk10 200
    wavchk chk11 220
    wavchk chk12 240
    wavchk chk13 260
    wavchk chk14 280

    br edt1 20
    br edt2 40
    br edt3 60
    br edt4 80
    br edt5 100
    br edt6 120
    br edt7 140
    br edt8 160
    br edt9 180
    br edt10 200
    br edt11 220
    br edt12 240
    br edt13 260
    br edt14 280

    tezt edt1 20
    tezt edt2 40
    tezt edt3 60
    tezt edt4 80
    tezt edt5 100
    tezt edt6 120
    tezt edt7 140
    tezt edt8 160
    tezt edt9 180
    tezt edt10 200
    tezt edt11 220
    tezt edt12 240
    tezt edt13 260
    tezt edt14 280

  }
}
on *:EXIT: unloads Wav
;-=-=-=-=-=-
;-=-=-=-=-=-
