Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. ; iTunes info script
  2. ;
  3. ; mIRC Script by Rroff (msrp24@hotmail.com), modifications by Wintereise(Wintereise@rizon.net)
  4. ; /load -rs iTunesi.mrc
  5. ; Ver 0.06
  6.  
  7. on *:unload:{
  8. echo # *** [iTunesi] iTunesi info script has been unloaded - use /load -rs iTunesi.mrc to reload
  9. iTunesiClean
  10. unload -rs iTunesi.mrc
  11. }
  12.  
  13. alias iTunesiClean {
  14. if ($com(iTunesiCom)) {
  15. .comclose iTunesiCom
  16. }
  17. if ($com(NowPlaying)) {
  18. .comclose NowPlaying
  19. }
  20. }
  21.  
  22. alias iTunesiETAS {
  23. var %test $1-
  24. var %Thours $int($calc((%test / 60 ) / 60))
  25. var %Thourr $calc((%Thours * 60 ) * 60)
  26. dec %test %Thourr
  27.  
  28. var %Tmins $int($calc(%test / 60))
  29. var %Tminsr $calc(%Tmins * 60)
  30. dec %test %Tminsr
  31.  
  32. var %Tsecs $int(%test)
  33.  
  34. if (%Tsecs < 10) {
  35. var %Tsecs 0 $+ %Tsecs
  36. }
  37.  
  38. if (%Thours == 0) {
  39. var %Tret %Tmins $+ : $+ %Tsecs
  40. }
  41. else {
  42. var %Tret %Thours $+ : $+ %Tmins $+ : $+ %Tsecs
  43. }
  44. return %Tret
  45. }
  46.  
  47. alias npit {
  48. var %verbosestate $1
  49. if (!$com(iTunesiCom)) {
  50. .comopen iTunesiCom iTunes.Application
  51. if ($comerr) {
  52. echo # 4*** [iTunesi] Ooops couldn't hook iTunes
  53. }
  54. else {
  55. set %null $com(iTunesiCom,CurrentTrack,3,dispatch* NowPlaying)
  56. }
  57. }
  58.  
  59. if (!$com(NowPlaying)) {
  60. set %null $com(iTunesiCom,CurrentTrack,3,dispatch* NowPlaying)
  61. }
  62.  
  63. if ($com(iTunesiCom) && $com(NowPlaying)) {
  64.  
  65. set %null $com(NowPlaying,Name,3)
  66. set %iTunesiplaying $com(NowPlaying).result
  67.  
  68. set %null $com(NowPlaying,Artist,3)
  69. set %iTunesiartist $com(NowPlaying).result
  70.  
  71. set %null $com(NowPlaying,Album,3)
  72. set %iTunesialbum $com(NowPlaying).result
  73.  
  74. set %null $com(iTunesiCom,PlayerPosition,3)
  75. set %iTunesipos $iTunesiETAS($com(iTunesiCom).result)
  76.  
  77. set %null $com(iTunesiCom,PlayerState,3)
  78. set %iTunesistate $com(iTunesiCom).result
  79.  
  80. set %null $com(NowPlaying,BitRate,3)
  81. set %iTunesibit $com(NowPlaying).result
  82.  
  83. set %null $com(NowPlaying,SampleRate,3)
  84. set %iTunesisamp $com(NowPlaying).result
  85.  
  86. set %null $com(NowPlaying,Duration,3)
  87. set %iTunesiduration $iTunesiETAS($com(NowPlaying).result)
  88.  
  89. set %null $com(NowPlaying,Rating,3)
  90. set %iTunesirate $com(NowPlaying).result
  91. set %iTunesirate $int($calc( %iTunesirate / 20 ))
  92.  
  93.  
  94. set %null $com(NowPlaying,PlayedCount,3)
  95. set %iTunesicount $com(NowPlaying).result
  96.  
  97. if (%iTunesialbum == $null) {
  98. set %iTunesialbum N/A
  99. }
  100.  
  101. say [ 12Now Playing $+ : %iTunesiartist 12- %iTunesiplaying 12| %iTunesialbum 12| %iTunesipos $+ 12/ $+ %iTunesiduration 12| %iTunesibit $+ kbps ]
  102.  
  103.  
  104. .comclose iTunesiCom
  105. .comclose NowPlaying
  106. }
  107.  
  108. iTunesiClean
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement