Quake AMP — File Browser

QuakeAMPv1.2 / QuakeAMPv1.2 / qAMP / qAMP / qAMP.mrc

qAMP.mrc — 6.69 KB — Download this file

; ––––––––––––––––––––––––––––––––––––––––––––––––
; qAMP by impulZ
; ––––––––––––––––––––––––––––––––––––––––––––––––

on *:load:{
  qamp_s
  set %wamp $winamptrack
  echo -a Loaded Quake AMP. Type 4/qAMP to configure it!
}

on *:unload:{
  unset %wamp
  .timermp3 off
}

on *:start:{
  qamp_s
}

alias qamp_s {
  .timermp3 0 1 mp3ingame
  if (!$hget(mp3)) { hmake mp3 50 }
  hload -o mp3 " $+ $scriptdirmp3.hash $+ "
}

alias mp3ingame {
  if (%wamp != $winamptrack) {
    if ($hget(mp3,nexttrack) == 1 && $hget(mp3,qengine) == 1) { sendq3 echo $iif($replace($hget(mp3,mp3style),<track>,$winamptrack),$ifmatch,$winamptrack) }
    if ($hget(mp3,qengine) == 0 && $hget(mp3,gpath)) { write -c $+($chr(34),$hget(mp3,gpath),mp3.cfg,$chr(34)) say $iif($replace($hget(mp3,mp3style),<track>,$winamptrack),$ifmatch,$winamptrack) }
  }
  if ($hget(mp3,qengine) == 1) { sendq3 set winamp Quake AMP | sendq3 set mp3ad say $iif($replace($hget(mp3,mp3style),<track>,$winamptrack),$ifmatch,$winamptrack) }
  set %wamp $winamptrack

  ;lese console aus
  if ($hget(mp3,winampcmd) == 1 && $hget(mp3,qengine) == 1) {
    var %get.console = $dll(" $+ $scriptdirdll\qAMP.dll $+ ",ScanConsole,\winamp)
    .dll " $+ $scriptdirdll\qAMP.dll $+ " ClearConsole

    if (%get.console) {
      var %current 1
      while (%current <= $numtok(%get.console,255)) {
        dll " $+ $scriptdirdll\wa_link.dll $+ " WA_Link_Command $upper($gettok(%get.console,%current,32))
        inc %current 1
      }
    }
  }
}

alias -l sendq3 { dll " $+ $scriptdirdll\qAMP.dll $+ " SendConsole $strip($1-) }

alias -l winampTrack {
  unset %track
  var %track = $gettok($dll(" $+ $scriptdirdll\winamp.dll $+ ",title,1),2-,46)
  return $iif(%track,%track,Stille...)
}

alias -l infdialog {
  set %infor $1-
  dialog $iif($dialog(infdialog),-v,-m) infdialog infdialog
}

dialog infdialog {
  title "Information"
  size -1 -1 153 60
  option dbu
  button "Ok", 4, 111 47 40 12, cancel
  edit "", 2, 1 2 150 43, read multi return vsbar
  text "1", 5, -5 -5 1 1, result
}

on *:DIALOG:infdialog:INIT:*:{ did -a $dname 2 %infor }

alias qAMP { dialog $iif($dialog(qAMP),-v,-m) qAMP qAMP }

dialog qAMP {
  title "Quake AMP [/qAMP]"
  size -1 -1 99 170
  option dbu
  radio "Quake 3, RTCW, ET, CoD", 1, 5 8 76 10
  radio "Games which support scripts", 2, 5 18 77 10
  button "?", 3, 84 8 10 10
  button "?", 4, 84 18 10 10
  box "Games", 5, 1 0 97 31
  box "Mp3 Script", 6, 1 64 97 61
  edit "", 8, 31 72 53 10, autohs
  text "Modfolder:", 9, 4 73 27 8
  button "...", 10, 85 72 10 10
  button "Generate Script", 11, 4 112 50 10
  text "Advertise button:", 12, 4 84 44 8
  edit "", 13, 49 83 46 10, autohs center
  box "Output", 14, 1 93 97 32
  edit "", 15, 4 101 91 10, read autohs
  button "Clipboard", 16, 64 112 31 10
  box "Preview", 24, 1 126 97 43
  icon 26, 4 134 72 10, " $+ $scriptdirprev.bmp $+ ", 0
  edit "", 20, 4 156 91 10, autohs
  text "<track> will be the WinAmp Track", 17, 3 147 93 8, center
  box "Options", 7, 1 32 97 31
  check "Show next as echo", 18, 5 40 82 10
  check "Enable \WinAmp command", 19, 5 50 76 10
  button "3", 21, 78 134 9 10
  button "4", 22, 87 134 9 10
}

on *:dialog:qAMP:*:*:{
  if ($devent == INIT) {
    if (!$hget(mp3)) { hmake mp3 50 | hload -o mp3 " $+ $scriptdirmp3.hash $+ " }
    else {
      if ($hget(mp3,qengine) == 1) { did -fc $dname 1 | did -b $dname 8,10 }
      else { did -fc $dname 2 | did -b $dname 18,19 }
      if ($hget(mp3,button)) { did -a $dname 13 $hget(mp3,button) }
      else { did -b $dname 11 }
      if ($hget(mp3,gpath)) { did -a $dname 8 $hget(mp3,gpath) }
      if ($hget(mp3,mp3style)) { did -a $dname 20 $hget(mp3,mp3style) }
      if ($hget(mp3,nexttrack)) { did -c $dname 18 }
      if ($hget(mp3,winampcmd)) { did -c $dname 19 }
    }

    dll " $+ $scriptdirdll\mdx.dll $+ " SetMircVersion $version
    dll " $+ $scriptdirdll\mdx.dll $+ " MarkDialog $dname $dialog($dname).hwnd
    dll " $+ $scriptdirdll\mdx.dll $+ " SetFont $dname 21,22 19 800 Webdings

    did -b $dname 16,21

    set %qAMP.prev 2
    qAMP.prev
  }
  if ($devent == EDIT) {
    if ($did == 8) {
      if ($did($dname,2).state == 1 && (!$isdir($did($dname,8)) || !$did($dname,13))) { did -b $dname 11 }
      else { did -e $dname 11 }
    }
    if ($did == 13) {
      hadd mp3 button $did($dname,13)
      if ($did($dname,13)) { did -e $dname 11 }
      else { did -b $dname 11 }
    }
    if ($did == 20) {
      if ($did($dname,20)) {
        hadd mp3 mp3style $did($dname,20)
        qAMP.prev
      }
      else { hdel mp3 mp3style }
    }
  }
  if ($devent == SCLICK) {
    if ($did == 1 || $did == 2) {
      hadd mp3 qengine $did($dname,1).state
      if ($did($dname,1).state == 1) { did -b $dname 8,10 | did -e $dname 18,19 }
      else { did -e $dname 8,10 | did -b $dname 18,19 }
      if ($did($dname,2).state == 1 && (!$isdir($did($dname,8)) || !$did($dname,13))) { did -b $dname 11 }
      else { did -e $dname 11 }
    }
    if ($did == 3) { infdialog If you check the Quake engine box you can use this script with the following Games: $+ $crlf $+ Quake 3, RTCW, Enemy-Territory and Call of Duty }
    if ($did == 4) { infdialog You can use the script with games like Jedi Knight, Half-Life/Counter-Strike or Half-LifeΒ² }
    if ($did == 10) {
      var %curr $sdir($mircdir,Select the Modfolder for the Winamp config)
      if (%curr) {
        did -ra $dname 8
        hadd mp3 gpath %curr
      }
    }
    if ($did == 11) {
      if ($did($dname,1).state == 1) { did -ra $dname 15 bind $+($chr(34),$did($dname,13),$chr(34)) $+($chr(34),vstr mp3ad,$chr(34)) }
      else { did -ra $dname 15 bind $+($chr(34),$did($dname,13),$chr(34)) $+($chr(34),exec mp3.cfg,$chr(34)) }
      did -e $dname 16
    }
    if ($did == 16) { clipboard $did($dname,15) }
    if ($did == 18) { hadd mp3 nexttrack $did($dname,18).state }
    if ($did == 19) { hadd mp3 winampcmd $did($dname,19).state }
    if ($did == 21) {
      inc %qAMP.prev 60
      if (%qAMP.prev == 2) { did -b $dname 21 }
      qAMP.prev
    }
    if ($did == 22) {
      dec %qAMP.prev 60
      if (%qAMP.prev < 2) { did -e $dname 21 }
      qAMP.prev
    }
  }
  if ($devent == CLOSE) { hsave -o mp3 " $+ $scriptdirmp3.hash $+ " | unset %qAMP.prev }
}

alias -l qAMP.prev {
  if ($dialog(qamp)) {
    window -ph +d @prev 0 0 144 20
    drawfill @prev 1 1 0 0
    drawtext -pb @prev 1 1 $+(",$window($active).font,") 12 %qAMP.prev 1 0 $+ $replace($did(qamp,20),^0,1,^1,4,^2,9,^3,8,^4,10,^5,9,^6,13,^7,0,^8,7,^9,15,<track>,$winamptrack)
    drawsave @prev " $+ $scriptdirprev.bmp $+ "
    close -@ @prev
    did -g $dname 26 " $+ $scriptdirprev.bmp $+ "
  }
}