Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; iTunes info script
- ;
- ; mIRC Script by Rroff (msrp24@hotmail.com), modifications by Wintereise(Wintereise@rizon.net)
- ; /load -rs iTunesi.mrc
- ; Ver 0.06
- on *:unload:{
- echo # *** [iTunesi] iTunesi info script has been unloaded - use /load -rs iTunesi.mrc to reload
- iTunesiClean
- unload -rs iTunesi.mrc
- }
- alias iTunesiClean {
- if ($com(iTunesiCom)) {
- .comclose iTunesiCom
- }
- if ($com(NowPlaying)) {
- .comclose NowPlaying
- }
- }
- alias iTunesiETAS {
- var %test $1-
- var %Thours $int($calc((%test / 60 ) / 60))
- var %Thourr $calc((%Thours * 60 ) * 60)
- dec %test %Thourr
- var %Tmins $int($calc(%test / 60))
- var %Tminsr $calc(%Tmins * 60)
- dec %test %Tminsr
- var %Tsecs $int(%test)
- if (%Tsecs < 10) {
- var %Tsecs 0 $+ %Tsecs
- }
- if (%Thours == 0) {
- var %Tret %Tmins $+ : $+ %Tsecs
- }
- else {
- var %Tret %Thours $+ : $+ %Tmins $+ : $+ %Tsecs
- }
- return %Tret
- }
- alias npit {
- var %verbosestate $1
- if (!$com(iTunesiCom)) {
- .comopen iTunesiCom iTunes.Application
- if ($comerr) {
- echo # 4*** [iTunesi] Ooops couldn't hook iTunes
- }
- else {
- set %null $com(iTunesiCom,CurrentTrack,3,dispatch* NowPlaying)
- }
- }
- if (!$com(NowPlaying)) {
- set %null $com(iTunesiCom,CurrentTrack,3,dispatch* NowPlaying)
- }
- if ($com(iTunesiCom) && $com(NowPlaying)) {
- set %null $com(NowPlaying,Name,3)
- set %iTunesiplaying $com(NowPlaying).result
- set %null $com(NowPlaying,Artist,3)
- set %iTunesiartist $com(NowPlaying).result
- set %null $com(NowPlaying,Album,3)
- set %iTunesialbum $com(NowPlaying).result
- set %null $com(iTunesiCom,PlayerPosition,3)
- set %iTunesipos $iTunesiETAS($com(iTunesiCom).result)
- set %null $com(iTunesiCom,PlayerState,3)
- set %iTunesistate $com(iTunesiCom).result
- set %null $com(NowPlaying,BitRate,3)
- set %iTunesibit $com(NowPlaying).result
- set %null $com(NowPlaying,SampleRate,3)
- set %iTunesisamp $com(NowPlaying).result
- set %null $com(NowPlaying,Duration,3)
- set %iTunesiduration $iTunesiETAS($com(NowPlaying).result)
- set %null $com(NowPlaying,Rating,3)
- set %iTunesirate $com(NowPlaying).result
- set %iTunesirate $int($calc( %iTunesirate / 20 ))
- set %null $com(NowPlaying,PlayedCount,3)
- set %iTunesicount $com(NowPlaying).result
- if (%iTunesialbum == $null) {
- set %iTunesialbum N/A
- }
- say [ 12Now Playing $+ : %iTunesiartist 12- %iTunesiplaying 12| %iTunesialbum 12| %iTunesipos $+ 12/ $+ %iTunesiduration 12| %iTunesibit $+ kbps ]
- .comclose iTunesiCom
- .comclose NowPlaying
- }
- iTunesiClean
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement