Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.61 KB | None | 0 0
  1. alias -l c1 { return $+($chr(3),07) }
  2. alias -l c2 { return $+($chr(3),14) }
  3. alias -l c3 { return $+($chr(3),04) }
  4. alias -l c4 { return $+($chr(3),12) }
  5. alias -l l { return $+($chr(2),$c3,»,$chr(3),$chr(2)) }
  6. alias -l ll { return $+($c2,$1-,$c3,:,$c1) }
  7. alias -l it { return $+($c2,[,$c4,iTunes,$c2,],$chr(2),$c3 —›,$chr(2)) }
  8. alias -l lll { return $+($c2,[,$c1,$1-,$c2,]) }
  9. alias itunes { _iTunes | .timeriTunes 0 9999999 noop $!_itunes }
  10. alias itunesoff { .timeriTune* off }
  11.  
  12. alias _itunes {
  13. if (!$chkprg(iTunes.exe)) {
  14. if (!$isid) {
  15. var %x = $?!="Would you like to run iTunes?"
  16. if (%x) { run iTunes.exe | echo -at $c1 $+ ** $it $+($c2,Now running,$chr(32),$c1,iTunes.exe,$c2,. Type /itunes again when iTunes finishes opening and you have started playing music.) }
  17. else { echo -at $c1 $+ ** $it $+ $c2 No action taken. }
  18. }
  19. .timeriTune* off
  20. return
  21. }
  22. scid $activecid
  23. var %p = iTunes, %i = IITTrack, %b = $chr(2), %% = $+(%b,$c3,»,$chr(3),%B), $&
  24. %chans = #pc #idle #irchelp #rsmarket #XBNC
  25. .comopen iTunes iTunes.Application
  26. if ($comerr) { .timeriTunes off | return }
  27. if $com(%p,CurrentTrack,3,dispatch* %i) {
  28. var %k = $com(%i,Name,2), %name = $com(%i).result, $&
  29. %k = $com(%i,Album,2), %album = $com(%i).result, $&
  30. %k = $com(%i,Artist,2), %artist = $com(%i).result, $&
  31. %k = $com(%i,BitRate,2), %bitrate $com(%i).result, $&
  32. %k = $com(%i,Time,2), %time = $regsubex($com(%i).result,/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
  33. %k = $com(%i,Rating,2), %n = $com(%i).result, $&
  34. %rating = $+($str(¤,$calc(%n /20)),%b,$str(-,$calc(5 - (%n /20))),%B), $&
  35. %k = $com(%i,Year,2), %year = $com(%i).result
  36. var %k = $com(%i,Duration,2), %k = $com(%p,PlayerPosition,2), $&
  37. %position = $regsubex($asctime($com(%p).result,n:ss),/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
  38. %pr = $calc($com(%p).result / $com(%i).result), $&
  39. %progress = $+(%b,$chr(3),4,$str(¦,$floor($calc(%pr *10))),$chr(3),1¦,$chr(3),3,$str(¦,$calc(10- $round($calc(%pr *10),0))),%b,$c2), $&
  40. %k = $com(%p,PlayerState,2), %st = $com(%p).result, $&
  41. %k = $com(%i,Genre,2), %genre = $com(%i).result, $&
  42. %k = $com(%i,PlayedCount,2), %played = $com(%i).result
  43. var %msg = $it $ll(Track) %name $iif(!%st,$lll(Paused)) $&
  44. %% $ll(Artist) %artist $iif(%year,$lll(%year)) $&
  45. %% $ll(Album) %album $&
  46. %% $ll(Position) $+(%position,$c2,/,$c1,%time) $&
  47. $lll($calc($round(%pr,2) *100) $+ %) $+([,%progress,]) $&
  48. %% $ll(Rating) %rating $&
  49. %% $ll(Bitrate) $+(%bitrate,$c2,kbps) $&
  50. %% $ll(Genre) %genre $&
  51. %% $ll(PlayedCount) %played $+ $chr(15)
  52. $iif($active ischan && !$istok(%chans,$active,32),msg $active,noop) $iif(c !isincs $chan($active).mode,%msg,$strip(%msg,c)))
  53. }
  54. :error
  55. while ($com(0)) { .comclose $com(1) }
  56. }
  57.  
  58. alias pause {
  59. if (!$chkprg(iTunes.exe)) { return }
  60. .comopen iTunes iTunes.Application
  61. noop $com(iTunes,Pause,3)
  62. echo -at $c1 $+ ** $it $c2 $+ Music Paused.
  63. .comclose iTunes
  64. }
  65.  
  66. alias resume {
  67. if (!$chkprg(iTunes.exe)) { return }
  68. .comopen iTunes iTunes.Application
  69. noop $com(iTunes,Play,3)
  70. echo -at $c1 $+ ** $it $c2 $+ Music Resumed.
  71. .comclose iTunes
  72. }
  73.  
  74. alias setrating {
  75. if (!$1) { return }
  76. var %p = iTunes, %i = IITTrack
  77. .comopen iTunes iTunes.Application
  78. if ($comerr) { .timeriTunes off | return }
  79. if $com(%p,CurrentTrack,3,dispatch* %i) {
  80. var %k = $com(%i,Rating,4,long,$calc($1 *20)), $&
  81. %k = $com(%i,Name,2), %n = $com(%i).result
  82. echo -at $c1 $+ ** $it $+($c2,Rating for:,$c1,$chr(32),%n,$chr(32),$c2,changed to,$c1,$chr(32),$1,$c2,.)
  83. }
  84. :error
  85. while ($com(0)) { .comclose $com(1) }
  86. }
  87.  
  88. alias next {
  89. if (!$chkprg(iTunes.exe)) { return }
  90. var %p = iTunes, %i = IITTrack
  91. .comopen iTunes iTunes.Application
  92. if ($comerr) { .timeriTunes off | return }
  93. if $com(%p,CurrentTrack,3,dispatch* %i) {
  94. var %k = $com(%p,NextTrack,3)
  95. .timer 1 .5 _next
  96. }
  97. while ($com(0)) { .comclose $com(1) }
  98. }
  99.  
  100. alias back {
  101. if (!$chkprg(iTunes.exe)) { return }
  102. var %p = iTunes, %i = IITTrack
  103. .comopen iTunes iTunes.Application
  104. if ($comerr) { .timeriTunes off | return }
  105. if $com(%p,CurrentTrack,3,dispatch* %i) {
  106. var %k = $com(%p,PreviousTrack,3)
  107. .timer 1 .5 _back
  108. }
  109. while ($com(0)) { .comclose $com(1) }
  110. }
  111.  
  112. alias -l _back {
  113. var %p = iTunes, %i = IITTrack
  114. .comopen iTunes iTunes.Application
  115. if ($comerr) { .timeriTunes off | return }
  116. if $com(%p,CurrentTrack,3,dispatch* %i) {
  117. var %k = $com(%i,Name,2)
  118. echo -at $c1 $+ ** $it $+($c2,Advanced to previous track:,$c1) $com(%i).result
  119. }
  120. while ($com(0)) { .comclose $com(1) }
  121. }
  122.  
  123. alias -l _next {
  124. var %p = iTunes, %i = IITTrack
  125. .comopen iTunes iTunes.Application
  126. if ($comerr) { .timeriTunes off | return }
  127. if $com(%p,CurrentTrack,3,dispatch* %i) {
  128. var %k = $com(%i,Name,2)
  129. echo -at $c1 $+ ** $it $+($c2,Advanced to next track:,$c1) $com(%i).result
  130. }
  131. while ($com(0)) { .comclose $com(1) }
  132. }
  133.  
  134. alias chkprg {
  135. .fopen -o processes processes.txt
  136. .fclose processes
  137. var %% = aline @@, %x = processes.txt
  138. window -h @@
  139. %% Dim z, x, t
  140. %% Set z = CreateObject("Scripting.FileSystemObject")
  141. %% Set x = z.OpenTextFile(" $+ $mircdir $+ %x $+ ", 2, 1)
  142. %% t = "."
  143. %% For Each obj In GetObject("winmgmts://" & t & "/root/cimv2").ExecQuery("SELECT * FROM Win32_Process")
  144. %% x.Write(obj.Description & vbCrLf)
  145. %% Next
  146. savebuf @@ pro.vbs
  147. window -c @@
  148. .comopen q wscript.shell
  149. .comclose q $com(q,run,3,bstr,wscript " $+ $mircdir $+ pro.vbs",uint,5,bool,true)
  150. return $read(processes.txt,r,$1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement