Jump to content

RamEliC

Members
  • Posts

    3
  • Joined

  • Last visited

RamEliC's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks for your help guys! I'll try to do some testing with that when I get home tonight. If I get it working I'll post up some code for anyone who would be interested. Because I wrote my own home automation system using AutoIt and I would like greater control over XBMC with it. For example, I have the automation system wake me up in the morning by booting up my media center in the bedroom, turn on my TV and it'll launch XBMC. i then want to have it play my last.fm personal radio station. Right now, i have it loading a playlist (using the Web API) that i created, but that gets old after a while and i dont want to be make new playlists regularly. So i figured it would be better to have it load a last.fm radio station so it could do that for me. I tried doing it through the Web API but i cant seem to figure it out (it may not even be possible).
  2. I know its late but i would certainly like to see this implemented. I've been using the Web API but its not as robust as I would like it to be. I tried dabbling with the JSON RPC interface but i cant get it to work for the life of me. I can connect successfully to port 9090 with TCPConnect but no matter what i throw at it i get errors in my xbmc log that it could not parse the information received. Can anyone PLEASE assist with this??
  3. I've been looking for an answer to this myself and have found a "cheap" way of labeling a drive that was mapped using the SUBST command. I will explain what the script does because I KNOW there has to be a MUCH more efficient way of achieving the same results so I hope someone will post a "cleaner" version of my code. I discovered that when you map the drive a registry key is added to "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2". The problem is that it appears the name of the key is never the same twice. I have my script read all of the keys under "MountPoints2" and add them to an array. Then I have it map the drive using the SUBST command and then it creates a new array with a list of the new keys and then compares the two until it finds the new key. I then have it add the correct REG_SZ value to name the drive. #include <Process.au3> Dim $Before[50], $After[50] $times = 0;Used to determine how many subkeys there are under the MountPoints2 key ; Take a "Before" snap shot of the subkeys to see what is there prior to mapping the drive While 1 $times = $times + 1 $var = RegEnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2", $times) If @error <> 0 then ExitLoop $Before[$times] = $var WEnd ; Map the drive and then pause for a second to wait for the system to catch up (it would'nt work without a pause) _RunDOS("Subst Z: \\server\share"); Change the drive letter and path to suit your needs Sleep(1000) ; Take a snapshot of subkeys AFTER the mapping For $i = 1 to $times $After[$i] = RegEnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2", $i) Next ; Compare the two arrays line by line until it finds the first discrepency (which is the new key) and write the new label For $i = 1 to $times If $Before[$i] <> $After[$i] Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\" & $After[$i], "_LabelFromReg", "REG_SZ", "My new label"); Change the "My new label" to suit your needs Exit EndIf Next I hope this helps out.
×
×
  • Create New...