Mercifull Posted June 3, 2005 Share Posted June 3, 2005 Solved: See this post by me or simply scroll down. -------------- Ok iTunes 4.8 has just been released and my old plugin broke. I then installed the newer version of the iTunes Multi-Plugin from http://www.aqua-soft.org by Loc[a]lhost This plugin creates a file called CurrentTrack.txt with data on the song currently playing in iTunes I modified my old script to pull off the data from within that text file. alias np { %iTunes.dir = C:\Program Files\iTunes\CurrentTrack.txt %artist = $read(%iTunes.dir , 2) %song = $read(%iTunes.dir , 3) %album = $read(%iTunes.dir , 4) %genre = $read(%iTunes.dir , 6) %year = $read(%iTunes.dir , 15) %time = $read(%iTunes.dir , 8) %details = ( $+ %album $+ , %genre $+ , %year $+ , %time $+ ) /say [Now Playing] %artist - %song %details } However for some reason it didnt work. It look me a long time to figure it out and it was only when I noticed that the filesize was bigger than it should be and opened in EditPlus. It appears that the newest verion of the plugin speaks in UNICODE instead of ANSI and my script just cannot read anything past those annoying invisible box symbols. So... does anyone know how I can modify my script to ignore the unicode elements or strip them from the text file? The actual script works so theres nothing wrong with my coding. It is purely a plugin issue. I have spoken to the plugin author and he doesnt seem to be very helpful right now but if anyone knows of a quick fix solution I would be grateful Thanks Mercifull <3 Suzi "We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12 Link to comment Share on other sites More sharing options...
Hannibal Posted June 3, 2005 Share Posted June 3, 2005 Well, as long as you don't have any fancy characters in the generated file, I presume everything you're stripping out is purely null bytes. You could just run a global replace on everything you get from that file? (replacing the null bytes with an empty string). Actually, I'm not 100% sure if they're null-bytes. Try to get a charcode on them (shouldn't be hard, I don't know mIRC but it should have the equivalent of asc or String.charCodeAt(number) ) Link to comment Share on other sites More sharing options...
Mercifull Posted June 3, 2005 Author Share Posted June 3, 2005 I tried to copy and paste the "box" to see what it was but when i pasted nothing happened. Those boxes just will not go into the clipboard. How can i find out what character it is? Mercifull <3 Suzi "We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12 Link to comment Share on other sites More sharing options...
Mercifull Posted June 3, 2005 Author Share Posted June 3, 2005 Well the multiplugin author has released a dll to pull off the data from itunes that mirc can understand yay :D Here is my new script in full. ; ############################################## ; # Matt Sims' iTunes Now Playing Script v.1.0 # ; # My first attempt at a proper mIRC script # ; # Works with the iTunes Multi-Plugin # ; # Needs the mIRC_iTunes.dll to work # ; # Copyright Matt Sims (c) 2005 # ; # www.mattsims.com [email protected] # ; ############################################## ; You use it in the script the following way: ; $dll(mIRC_iTunes.dll, GetInfo, *INFOSTRING*) ; The value of that will be the string pointed by *INFOSTRING* formatted with the requested data, if it is available. ; the *INFOSTRING* is a string without quotes, which uses the following formatting tags ; !Playlist - The play list that the track is in ; !Album ; !Artist ; !Name - Song name ; !Genre ; !Grouping ; !Composer ; !DiscCount ; !DiscNumber ; !Position - The player's position within the currently playing track ; !Duration ; !TimeLeft - The time left for the track to play ; !PlayCount ; !Rating ; !TrackCount ; !TrackNumber ; !Year ; !BitRate ; !SampleRate ; !Kind - The file type of the track. ; ############################################## ; BEGIN Now playing alias alias np { %details = ( $+ !Album $+ , !Genre $+ , !Year $+ , !BitRate $+ kbps, !TimeLeft $+ ) if (%np.extended == on) { /say $dll(mIRC_iTunes.dll, GetInfo, [Now Playing] !Artist - !Name %details) } else { /say $dll(mIRC_iTunes.dll, GetInfo, [Now Playing] !Artist - !Name) } } ; END Now playing alias ; ############################################## ; BEGIN Right Click menu controls menu status,channel,query,nicklist,menu,chat { .- .iTunes Now playing:/np .iTunes Controls .Play/Pause:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,PlayPause,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } .< Previous:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,PreviousTrack,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } .> Next:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,NextTrack,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } .Advanced Controls ..Open iTunes:run itunes ..Close iTunes:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,Quit,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } ..iTunes Control Panel:/dialog -mdieo iPanel iPanel .Contact Matt Sims:run http://www.mattsims.com/page.php?page=contact } ; END Right Click menu controls ; ############################################## ; BEGIN Control Panel dialog iPanel { title "iTunes Control Panel" size -1 -1 184 40 option pixels button "< prev", 1, 0 0 40 20, push button "play/pause", 2, 40 0 70 20, push button "stop", 3, 110 0 30 20, push button "next >", 4, 140 0 44 20, push button details in output: %np.extended, 5, 0 20 184 20, push } on *:DIALOG:iPanel:SCLICK:1:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,PreviousTrack,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } on *:DIALOG:iPanel:SCLICK:2:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,PlayPause,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } on *:DIALOG:iPanel:SCLICK:3:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,Stop,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } on *:DIALOG:iPanel:SCLICK:4:{ if (!$com(itunes)) { /comopen itunes iTunes.Application } %com.result = $com(itunes,NextTrack,3) if (%com.result==0) { echo -a Error: Make sure iTunes is open. } } on *:DIALOG:iPanel:SCLICK:5:{ if (%np.extended == on) { %np.extended = off /did -r iPanel 5 /did -a iPanel 5 details in output: %np.extended } else { %np.extended = on /did -r iPanel 5 /did -a iPanel 5 details in output: %np.extended } } on *:DIALOG:iPanel:close:*:{ if ($com(itunes)) { /comclose itunes } } ; END Control Panel ; ################# END SCRIPT ################# Download the iTunes Multi Plugin Download mIRC_iTunes.dll Mercifull <3 Suzi "We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now