1. #
  2. # winamp announce with swamp.dll
  3. #
  4. # SWAMP MP3: The mIRC's Sonique/Winamp Controller! v1.0.5 (601 lines)
  5. #--------------------------------------
  6. # Author: LightStrike
  7. # e-mail: LightStrike@mail.pt
  8. # edited by Rez
  9. # ------------------------------------------------
  10.  
  11.  
  12. menu channel,query,nicklist {
  13. -
  14. +- M.P.3 -+: mp3
  15. -
  16. }
  17.  
  18. alias mp3 {
  19. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, INSTALLED) == $false) { echo $active $mp3noinstal | halt }
  20. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, RUNNING) == $false) { echo $active $mp3quit | halt }
  21. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Playing) { set %mp3.path $nofile($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) | say $mp3playing | halt }
  22. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Paused) { echo $active $mp3stopped | halt }
  23. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Stopped) { echo $active $mp3stopped | halt }
  24. }
  25.  
  26. alias mp3b {
  27. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, INSTALLED) == $false) { echo $active $mp3noinstal | halt }
  28. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, RUNNING) == $false) { echo $active $mp3quit | halt }
  29. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Playing) { set %mp3.path $nofile($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) | say $mp3playingb | halt }
  30. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Paused) { echo $active $mp3stopped | halt }
  31. if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Stopped) { echo $active $mp3stopped | halt }
  32. }
  33.  
  34. alias mp3playingb { return 03playing: " $+ $mp3artist - $mp3title $+ " 03Genre: $mp3genre }
  35. alias mp3playing { return 14,1playing: 15" $+ $mp3title $+ " 14From:15 $mp3path 14Genre:15 $mp3genre }
  36.  
  37. alias mp3stopped { return winamp $dll($shortfn($mircdir\swamp.dll), WinAmpGet, VERSION) not playing }
  38. alias mp3quit { return winamp stone dead }
  39. alias mp3noinstal { return winamp not installed }
  40. alias mp3get { return $dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) }
  41. alias mp3get { return $dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) }
  42.  
  43. alias mp3time { return $int($calc(($dll($shortfn($mircdir\swamp.dll), WinAmpGet, PLAYEDTIME) / $calc($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKTIME) * 1000)) * 100)) $+ $chr(37) of $replace($duration($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKTIME)),hrs,h,hr,h,mins,m,secs,s,sec,s)) }
  44.  
  45. alias mp3path {
  46. var %x = %mp3.path
  47. return $gettok(%x,$calc($gettok(%x,0,92) 1) $+ -,92)
  48. }
  49.  
  50. alias mlen {
  51. if ($1) {
  52. if (!$exists($1-)) { return 1 | halt }
  53. var %x = $calc($sound($1-).length /1000)
  54. return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
  55. }
  56. if (!$1) {
  57. if (!$insong) { return 2 | halt }
  58. var %x = $calc($insong.length /1000)
  59. return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
  60. }
  61. }
  62.  
  63. alias mpos {
  64. if (!$insong) { return 2 | halt }
  65. var %x = $calc($insong.pos /1000)
  66. return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
  67. }
  68. alias mrem {
  69. if (!$insong) { return 2 | halt }
  70. var %x = $calc(($insong.length - $insong.pos) / 1000)
  71. return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
  72. }
  73.  
  74. alias -l mp3title {
  75. var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).title
  76. if (%tmp == $null) {
  77. %tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).title }
  78. if (%tmp == $null) {
  79. %tmp = $replace($remove($nopath($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)),.mp3),_,$chr(32))
  80. }
  81. return %tmp
  82. }
  83.  
  84. alias -l mp3artist {
  85. var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).artist
  86. if (%tmp == $null) {
  87. %tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).artist }
  88. if (%tmp == $null) {
  89. %tmp = $replace($remove($nopath($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)),.mp3),_,$chr(32))
  90. }
  91. return %tmp
  92. }
  93.  
  94. alias -l mp3genre {
  95. var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).genre
  96. if (%tmp == $null) {
  97. %tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).genre
  98. }
  99. if (%tmp == $null) {
  100. %tmp = N/A
  101.  
  102. }
  103. return %tmp
  104. }
  105. }
  106. }
  107.