rendered paste body;;----------------------------------------------------------;;
;; script by Kvn Pfc :: http://rseos.com/EchoScript/ ;;
;;----------------------------------------------------------;;
alias -l c1 { return $+($chr(3),07) }
alias -l c2 { return $+($chr(3),14) }
alias -l c3 { return $+($chr(3),04) }
alias -l c4 { return $+($chr(3),12) }
alias -l l { return $+($chr(2),$c3,»,$chr(3),$chr(2)) }
alias -l ll { return $+($c2,$1-,$c3,:,$c1) }
alias -l it { return $+($c2,[,$c4,iTunes,$c2,],$chr(2),$c3 —›,$chr(2)) }
alias -l lll { return $+($c2,[,$c1,$1-,$c2,]) }
alias itunes { _iTunes }
;| .timeriTunes 0 480 noop $!_itunes }
alias ituneson { .timeriTunes 0 600 noop $!_itunes }
alias itunesoff { .timeriTune* off }
alias _itunes {
if (!$chkprg(iTunes.exe)) {
if (!$isid) {
var %x = $?!="Would you like to run iTunes?"
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.) }
else { echo -at $c1 $+ ** $it $+ $c2 No action taken. }
}
.timeriTune* off
return
}
scid $activecid
var %p = iTunes, %i = IITTrack, %b = $chr(2), %% = $+(%b,$c3,»,$chr(3),%b), $&
%chans = #pc #idle #irchelp #rsmarket #rs #rs-market #help #support #pcw
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%i,Name,2), %name = $com(%i).result, $&
%k = $com(%i,Album,2), %album = $com(%i).result, $&
%k = $com(%i,Artist,2), %artist = $com(%i).result, $&
%k = $com(%i,BitRate,2), %bitrate $com(%i).result, $&
%k = $com(%i,Time,2), %time = $regsubex($com(%i).result,/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
%k = $com(%i,Rating,2), %n = $com(%i).result, $&
%rating = $+($str(¤,$calc(%n /20)),%b,$str(-,$calc(5 - (%n /20))),%b), $&
%k = $com(%i,Year,2), %year = $com(%i).result
var %k = $com(%i,Duration,2), %k = $com(%p,PlayerPosition,2), $&
%position = $regsubex($asctime($com(%p).result,n:ss),/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
%pr = $calc($com(%p).result / $com(%i).result), $&
%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), $&
%k = $com(%p,PlayerState,2), %st = $com(%p).result, $&
%k = $com(%i,Genre,2), %genre = $com(%i).result, $&
%k = $com(%i,PlayedCount,2), %played = $com(%i).result
var %msg = $it $ll(Track) %name $iif(!%st,$lll(Paused)) $&
%% $ll(Artist) %artist $iif(%year,$lll(%year)) $&
%% $ll(Album) %album $&
%% $ll(Position) $+(%position,$c2,/,$c1,%time) $&
$lll($calc($round(%pr,2) *100) $+ %) $+([,%progress,]) $&
%% $ll(Rating) %rating $&
%% $ll(Bitrate) $+(%bitrate,$c2,kbps) $&
%% $ll(Genre) %genre $&
%% $ll(PlayedCount) %played $+ $chr(15)
;$iif($active ischan && !$istok(%chans,$active,32),msg $chan,noop) $iif(c !isincs $chan($active).mode,%msg,$strip(%msg,c)))
$iif(!$istok(%chans,$chan,32),msg $chan,noop) $iif(c !isincs $chan($chan).mode,%msg,$strip(%msg,c)))
}
:error
while ($com(0)) { .comclose $com(1) }
}
alias _itunes.ann {
if (!$chkprg(iTunes.exe)) {
if (!$isid) {
var %x = $?!="Would you like to run iTunes?"
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.) }
else { echo -at $c1 $+ ** $it $+ $c2 No action taken. }
}
.timeriTune* off
return
}
scid $activecid
var %p = iTunes, %i = IITTrack, %b = $chr(2), %% = $+(%b,$c3,»,$chr(3),%b), $&
%chans = #pc #idle #irchelp #rsmarket #rs #rs-market #help #support #pcw
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%i,Name,2), %name = $com(%i).result, $&
%k = $com(%i,Album,2), %album = $com(%i).result, $&
%k = $com(%i,Artist,2), %artist = $com(%i).result, $&
%k = $com(%i,BitRate,2), %bitrate $com(%i).result, $&
%k = $com(%i,Time,2), %time = $regsubex($com(%i).result,/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
%k = $com(%i,Rating,2), %n = $com(%i).result, $&
%rating = $+($str(¤,$calc(%n /20)),%b,$str(-,$calc(5 - (%n /20))),%b), $&
%k = $com(%i,Year,2), %year = $com(%i).result
var %k = $com(%i,Duration,2), %k = $com(%p,PlayerPosition,2), $&
%position = $regsubex($asctime($com(%p).result,n:ss),/(\d+):(\d+)/,$+(\1,$c2,:,$c1,\2)), $&
%pr = $calc($com(%p).result / $com(%i).result), $&
%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), $&
%k = $com(%p,PlayerState,2), %st = $com(%p).result, $&
%k = $com(%i,Genre,2), %genre = $com(%i).result, $&
%k = $com(%i,PlayedCount,2), %played = $com(%i).result
var %msg = $it $ll(Track) %name $iif(!%st,$lll(Paused)) $&
%% $ll(Artist) %artist $iif(%year,$lll(%year)) $&
%% $ll(Album) %album $&
%% $ll(Position) $+(%position,$c2,/,$c1,%time) $&
$lll($calc($round(%pr,2) *100) $+ %) $+([,%progress,]) $&
%% $ll(Rating) %rating $&
%% $ll(Bitrate) $+(%bitrate,$c2,kbps) $&
%% $ll(Genre) %genre $&
%% $ll(PlayedCount) %played $+ $chr(15)
;$iif($active ischan && !$istok(%chans,$active,32),msg $chan,noop) $iif(c !isincs $chan($active).mode,%msg,$strip(%msg,c)))
msg $1 %msg
;$iif(!$istok(%chans,$chan,32),msg $chan,noop) $iif(c !isincs $chan($chan).mode,%msg,$strip(%msg,c)))
}
:error
while ($com(0)) { .comclose $com(1) }
}
alias pause {
if (!$chkprg(iTunes.exe)) { return }
.comopen iTunes iTunes.Application
noop $com(iTunes,Pause,3)
echo -ga $c1 $+ ** $it $c2 $+ Music Paused.
.comclose iTunes
}
alias resume {
if (!$chkprg(iTunes.exe)) { return }
.comopen iTunes iTunes.Application
noop $com(iTunes,Play,3)
echo -ga $c1 $+ ** $it $c2 $+ Music Resumed.
.comclose iTunes
}
alias setrating {
if (!$1) { return }
var %p = iTunes, %i = IITTrack
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%i,Rating,4,long,$calc($1 *20)), $&
%k = $com(%i,Name,2), %n = $com(%i).result
echo -ga $c1 $+ ** $it $+($c2,Rating for:,$c1,$chr(32),%n,$chr(32),$c2,changed to,$c1,$chr(32),$1,$c2,.)
}
:error
while ($com(0)) { .comclose $com(1) }
}
alias next {
if (!$chkprg(iTunes.exe)) { return }
var %p = iTunes, %i = IITTrack
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%p,NextTrack,3)
.timer 1 .5 _next
}
while ($com(0)) { .comclose $com(1) }
}
alias back {
if (!$chkprg(iTunes.exe)) { return }
var %p = iTunes, %i = IITTrack
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%p,PreviousTrack,3)
.timer 1 .5 _back
}
while ($com(0)) { .comclose $com(1) }
}
alias -l _back {
var %p = iTunes, %i = IITTrack
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%i,Name,2)
echo -ga $c1 $+ ** $it $+($c2,Advanced to previous track:,$c1) $com(%i).result
}
while ($com(0)) { .comclose $com(1) }
}
alias -l _next {
var %p = iTunes, %i = IITTrack
.comopen iTunes iTunes.Application
if ($comerr) { .timeriTunes off | return }
if $com(%p,CurrentTrack,3,dispatch* %i) {
var %k = $com(%i,Name,2)
echo -ga $c1 $+ ** $it $+($c2,Advanced to next track:,$c1) $com(%i).result
}
while ($com(0)) { .comclose $com(1) }
}
alias chkprg {
.fopen -o processes processes.txt
.fclose processes
var %% = aline @@, %x = processes.txt
window -h @@
%% Dim z, x, t
%% Set z = CreateObject("Scripting.FileSystemObject")
%% Set x = z.OpenTextFile(" $+ $mircdir $+ %x $+ ", 2, 1)
%% t = "."
%% For Each obj In GetObject("winmgmts://" & t & "/root/cimv2").ExecQuery("SELECT * FROM Win32_Process")
%% x.Write(obj.Description & vbCrLf)
%% Next
savebuf @@ pro.vbs
window -c @@
.comopen q wscript.shell
.comclose q $com(q,run,3,bstr,wscript " $+ $mircdir $+ pro.vbs",uint,5,bool,true)
return $read(processes.txt,r,$1)
}
/*
; Joshua's Dialog for iTunes Script
; Version 1.00a
*/
alias itunes_control { dialog -md itunez_control itunez_control }
menu * {
Joshua's iTunes Controller:/itunes_control
}
dialog itunez_control {
title "Joshua's iTunes Controller (version 1.2)"
size -1 -1 159 110
option dbu
tab "Playback", 1, 1 0 157 108
button "Previous", 4, 4 20 37 12, tab 1
button "Next", 5, 42 20 37 12, tab 1
button "Restart", 6, 80 20 37 12, tab 1
button "Stop Scan", 7, 118 20 37 12, tab 1
button "Rewind", 8, 4 36 37 12, tab 1
button "Play", 9, 42 36 37 12, tab 1
button "Pause", 10, 80 36 37 12, tab 1
button "Fast Forward", 11, 118 36 37 12, tab 1
check "Announce?", 17, 5 64 50 10, tab 1
tab "Volume", 2
text "Set volume", 15, 14 22 45 8, tab 2 center
list 16, 11 32 50 64, tab 2 size vsbar
button "Set Volume", 18, 87 32 37 12, tab 2
check "Mute", 19, 89 94 50 10, tab 2 push
tab "Rating", 3
text "Select a Rating", 12, 13 20 66 8, tab 3 center
list 13, 16 37 46 50, tab 3 size
button "Set Rating", 14, 79 53 37 12, tab 3
}
on *:dialog:itunez_control:sclick:4: {
itunes.previous
}
on *:dialog:itunez_control:sclick:5: {
itunes.next
}
on *:dialog:itunez_control:sclick:6: {
itunes.backtrack
}
on *:dialog:itunez_control:sclick:7: {
itunes.noFFRW
}
on *:dialog:itunez_control:sclick:8: {
itunes.rewind
}
on *:dialog:itunez_control:sclick:9: {
itunes.play
}
on *:dialog:itunez_control:sclick:10: {
itunes.pausetoggle
}
on *:dialog:itunez_control:sclick:11: {
itunes.fastforward
}
on *:dialog:itunez_control:sclick:19: {
if ($did(19).state == 1) {
itunes.mute
}
elseif ($did(19).state == 0) {
itunes.unmute
}
}
on *:dialog:itunez_control:sclick:17: {
if ($did(17).state == 1) {
var %i $?="What channel do you want to announce in?"
.timeriTunes 0 $calc(60*10) _itunes.ann %i
}
elseif ($did(17).state == 0) {
if ($timer(iTunes)) {
/.timeriTunes off
}
}
}
on *:dialog:itunez_control:init:0: {
var %i 0
var %j 1
while (%i <= 100) {
did -a itunez_control 16 %i
inc %i
}
while (%j <= 5) {
did -a itunez_control 13 %j
inc %j
}
}
alias clrituneslb {
var %i 0
var %j 1
did -r itunez_control 16
did -r itunez_control 13
while (%i <= 100) {
did -a itunez_control 16 %i
inc %i
}
while (%j <= 5) {
did -a itunez_control 13 %j
inc %j
}
}
;list 16 ;set 18 ;mute/unmute 19
on *:dialog:itunez_control:sclick:18: {
if ($did(16).sel) {
itunes.vol $did(16).seltext
.timer 1 1 clrituneslb
}
elseif (!$did(16).sel) {
halt
}
}
on *:dialog:itunez_control:sclick:14: {
if ($did(13).sel) {
setrating $did(13).seltext
.timer 1 1 clrituneslb
}
elseif (!$did(13).sel) {
halt
}
}
/*
Copyright (c) 2005 zzattack
Contact: zzattack@gmail.com, only email
/itunes.backtrack -> restarts current track
/itunes.pause -> pauses, no error if already paused
/itunes.resume -> resumes, no error if already playing
/itunes.play -> plays the file it it was stopped
/itunes.playfile "file" -> plays the file you selected
/itunes.pausetoggle -> toggles pause/play state
/itunes.next -> plays next file in playlist
/itunes.previous -> plays previous file in playlist
/itunes.noFFRW -> stops fastforwarding/rewinding
/itunes.fastforward -> starts fastforwarding
/itunes.rewind -> starts rewinding
/itunes.stop -> stops playing current song
/itunes.quit -> quits itunes application
/itunes.start -> loads itunes application
/itunes.mute -> mutes itunes
/itunes.unmute -> unmutes itunes
/itunes.vol 0-100 -> sets itunes volume percentage
/itunes.del -> removes current track from current playlist
$itunes.ver -> returns itunes software version
$itunes.mute -> returns $true if muted
$itunes.vol -> returns volume level
$itunes($1) where $1 is one of the following
Always returns an attribute of the currently playing track
- Album -> returns the album of the track
- Artist -> returns artist
- BitRate -> returns bitrate
- BPM -> returns Beats Per Minute
- Comment -> returns a comment set to the file, mostly not available
- DateAdded -> returns the date added to media lib (dunno how to parse)
- Duration -> returns duration in seconds (eg. 132)
- Genre -> returns songs genre
- KindAsString -> returns the file kind, eg. MPEG Audio
- ModificationDate -> returns the last modification date
- Name -> returns the title
- PlayedCount -> returns ammount of times the track is played
- PlayedDate -> returns last played date
- Pos -> returns the position in the song (eg. 2:12)
- Rating -> returns the rating given to the track
- SampleRate -> returns samplerate
- Size -> returns the size in bytes
- Time -> returns the duration of the whole track (eg. 2:13)
- TrackCount -> returns the track number of the album
- Year -> returns the year of release
If no attribute can be found a "0" is returned and will not be replaced automatically.
alias itune {
if ($istok(pos position playerposition,$1,32)) return $asctime($itunez(PlayerPosition),n:ss)
if ($istok(Album Artist BitRate BPM Comment $&
DateAdded Duration Genre KindAsString $&
ModificationDate Name PlayedCount PlayedDate $&
Rating SampleRate Size Time $&
TrackCount Year,$remove($1,$chr(40),$chr(41)),32)) return $itunez(CurrentTrack(). $+ $1-)
}
*/
alias itunes.backtrack itunez BackTrack()
alias itunes.fastforward itunez FastForward()
alias itunes.pause itunez Pause()
alias itunes.resume itunez Play()
alias itunes.normal itunez Resume()
alias itunes.play itunez Play()
alias itunes.playfile echo -a itunez playfile( $+ $1- $+ )=bstr
alias itunes.pausetoggle itunez PlayPause()
alias itunes.next itunez NextTrack()
alias itunes.previous itunez PreviousTrack()
alias itunes.noFFRW itunez Resume()
alias itunes.rewind itunez Rewind()
alias itunes.stop itunez Stop()
alias itunes.quit itunez Quit()
alias itunes.start run itunes
alias itunes.mute $iif($isid,return $itunez(mute),.echo -q $itunez(mute(1)))
alias itunes.unmute itunez mute(0)
alias itunes.vol $iif($isid,return $itunez(SoundVolume),.echo -q $itunez(SoundVolume( $+ $1 $+ )=ui1))
alias itunes.ver return $itunez(Version())
alias itunes.del itunez CurrentTrack().Delete()
alias itunez {
if (!$com(root)) .comopen root iTunes.Application
tokenize $asc(.) $1- | var %a
var %a,%current root,%b,%opened root
while (%a != $0) {
inc %a | %b = $($ $+ %a,2)
.echo -q $regex(%b,(\w+)(?:\((.+)\))?(?:=(.+))?)
var %member = $regml(1)
if ($com(%member)) .comclose $v1
if ($regml(3)) var %type = $v1
else var %type = $iif($regml(2) isnum,int,bstr)
if (%a != $0) {
var %opened = $addtok(%opened,%member,32)
if ($regml(0) == 1) .echo -q $com(%current,%member ,3,dispatch* %member)
else .echo -q $com(%current,%member,3,%type,$regml(2),dispatch* %member)
if (%member) && (!$com(%member)) return
%current = %member
}
else {
if ($regml(0) == 1) .echo -q $com(%current,%member,3)
else .echo -q $com(%current,%member,3,%type,$regml(2))
if ($comerr) .echo -q $com(%current,%member,4,%type,$regml(2))
}
}
return $iif($com(%current).result,$v1,$comerr)
}