#!/usr/bin/perl # ---------- announceroK ---------- # Version 0.1 # Created by Jen (jen@caffeinated-dreams.net) # ---------- Commands ---------- # /amarok ......... displays current track IRC::print "\cC2\cBannounceroK has loaded successfully.\003"; IRC::print "\cC2/amarok to display current song."; Xchat::register("announceroK", "0.1","Display what's on amaroK"); Xchat::hook_command("amarok", "amarok"); sub amarok { chomp($isplaying = `dcop --no-user-time amarok default isPlaying`); if($isplaying eq "true") { #chomp($playing = `dcop amarok default nowPlaying`); chomp($title = `dcop --no-user-time amarok default title`); chomp($artist = `dcop --no-user-time amarok default artist`); chomp($timenow = `dcop --no-user-time amarok default currentTime`); chomp($timetotal =`dcop --no-user-time amarok default totalTime`); #chomp($version = `amarok -version | grep amarok`); # Announce methods, choose which way you wish to announce your song # by uncommenting/commenting. Only one at a time may be uncommented. # Action announce #Xchat::command("me \cC14is doncing to\003 \cC13$title\003 \cC14by\003 \cC13$artist\003 \cC14($timenow/$timetotal)"); # Message announce Xchat::command("say \cC14Now playing\003 \cC13$title\003 \cC14by\003 \cC13$artist\003 \cC14($timenow/$timetotal)"); } else { IRC::print "\cC2\cBNo song is currently playing!\003"; } }