Username:
Password:
  Home About Us Articles Rules Script Library FAQ Help
Not logged in (register
iTunes script for mIRC

Last Modified: Jun 07 3:54pm (r1)

use the /itunes command to say it in active channel/query
alias itunes {
  if ( $itunes.getvalues ) say [iTunes] ...  $+ %itunes.artist - %itunes.name $+ 
  unset %itunes.*
}
; Get PlayerState and if playing Song/Stream Information via COM
alias itunes.getvalues {
  ; Open COM connection
  .comopen iitunes iTunes.application
  ; check for error
  if ($comerr) {
    goto comerror
  }

  ; Get Player State
  set %itunes.dummy $com(iitunes,PlayerState,3)
  set %itunes.playerstate $com(iitunes).result

  if (%itunes.playerstate == 1) {

    ; Get Objects
    set %itunes.dummy $com(iitunes,CurrentTrack,3,dispatch* iittrack)
    if ($comerr) {
      goto comerror
    }
    set %itunes.dummy $com(iitunes,CurrentPlaylist,3,dispatch* iitplay)
    if ($comerr) {
      goto comerror
    }
    ; Get Song Information
    ; song name
    set %itunes.dummy $com(iittrack,Name,3)
    set %itunes.name $com(iittrack).result
    if ($comerr) {
      goto comerror
    }
    ; artist
    set %itunes.dummy $com(iittrack,Artist,3)
    set %itunes.artist $com(iittrack).result
    if ($comerr) {
      goto comerror
    }
    ; Close COM connections
    .comclose iitplay
    .comclose iittrack
  }
  ; Close COM connection
  .comclose iitunes
  return 1
  ; Error Handling
  :comerror
  ; Close COM connections
  while ($com(0)) {
    .comclose $com(1)
  }
  echo -s COM Error.
  halt
  :error
  ; Close COM connections
  while ($com(0)) {
    .comclose $com(1)
  }
  echo -s Script Error: $error
  halt
}

Comments
 
All content Copyright © 2004 - 2008 UtoNet IRC Network
UtoNet is sponsored and hosted by Datinix Systems