Results 1 to 8 of 8
  1. #1

    Lightbulb ProconRulz: In-game Control of Pandora Music bot

    I was messing around with a concept I had for a Pandora based Musicbot that can be controlled from within Battlefield's in-game chat. Here's a slightly bad video if you'd like to see my test in action: http://youtu.be/kTBN4F-BHZw

    The method I used to interface Pandora with Battlefield is through a modified version of Proconrulz, a custom built listener program and a Pandora client. The video showcases my first version which does have a bit of lag when issuing commands, however I'm working on a newer version of the listener to help reduce this and add more features (custom playlists, request queues, voting and rating songs, etc.).

    I figured I'd share my work and see if anyone wants to help improve the concept... maybe even write a separate plugin specifically for this. My knowledge of the language used to write plugins for Procon is very limited, so that's why I modified Proconrulz as opposed to starting from scratch.

    So here's how I did it...

    Proconrulz needed a way to communicate with outside programs, so since it was already writing data to an ini file, all it needed to do is reload that data every time a rule is fired, which it wasn't doing. Here's how to enable that...

    After line 4205 (v44j1), add this...

    Code:
    // Reload the ini file
    rulz_vars.resetini();
    After line 879, add this...

    Code:
    // reload the stored ini values
    public void resetini()
    {
        ini_vars.Clear();
        ini_load(ini_filename);
    }

    Next, you need an interfacing script. Here is the script I wrote...

    Code:
    # Say the Song Info if an update was detected
    On Spawn;If %lastDisplayedSong% != %ini_vars_currentSong%;Set %lastDisplayedSong% %ini_vars_currentSong%;Say Now Playing %lastDisplayedSong%;log Updated the Currently Playing Song (%lastDisplayedSong%)
    On Kill;If %lastDisplayedSong% != %ini_vars_currentSong%;Set %lastDisplayedSong% %ini_vars_currentSong%;Say Now Playing %lastDisplayedSong%;log Updated the Currently Playing Song (%lastDisplayedSong%)
    On Say;If %lastDisplayedSong% != %ini_vars_currentSong%;Set %lastDisplayedSong% %ini_vars_currentSong%;Say Now Playing %lastDisplayedSong%;log Updated the Currently Playing Song (%lastDisplayedSong%)
    
    
    # !currentSong : Displays the currently playing song within the chat log
    On Say;Text !currentSong;Say Currently Playing "%ini_vars_currentSong%";log %p% asked what the current song is (%ini_vars_currentSong%)
    
    
    # !skipSong : Tells Pandora to skip the currently playing song and go to the next
    On Say;Text !skipSong;Set %ini_vars_musicCommand% skip;Say %p% skipped songs;log %p% skipped songs
    
    
    # !pauseSong : Tells Pandora to Pause (Toggle) the currently playing song
    On Say;Text !pauseSong;Set %ini_vars_musicCommand% pause;Say %p% paused the music;log %p% paused the music
    
    
    # !volumeLow : Tells Pandora to go to a Low Volume (10)
    On Say;Text !volumeLow;Set %ini_vars_musicCommand% volumeLow;Say %p% set the volume to low;log %p% set the volume to low
    
    
    # !volumeMedium : Tells Pandora to go to a Medium Volume (20)
    On Say;Text !volumeMedium;Set %ini_vars_musicCommand% volumeMedium;Say %p% set the volume to medium;log %p% set the volume to medium
    
    
    # !volumeHigh : Tells Pandora to go to a High Volume (35)
    On Say;Text !volumeHigh;Set %ini_vars_musicCommand% volumeHigh;Say %p% set the volume to high;log %p% set the volume to high
    
    
    # !changeStation : Tells Pandora to go to a different station
    On Say;Text !changeStation;Set %ini_vars_musicCommand% changeStation;Say %p% changed the station;log %p% changed the station
    And finally, you need a listener. All it has to do is load the ini file every few seconds and check for updated commands. Not a graceful way of accomplishing this task, but again, this is just a concept. What would be nice is a Proconrulz Plugin that can send commands via the command line or tcp, etc.

    Any advice or assistance is appreciated. I'd rather not re-invent the wheel if someone else already has a good solution for this, so feel free to let me know. Thanks!

  2. #2
    hi speedbump
    I like to try this, un fortunatly I cant find the pandora client. At their home page it gives me:
    Dear Pandora Visitor,

    We are deeply, deeply sorry to say that due to licensing constraints, we can no longer allow access to Pandora for listeners located outside of the U.S., Australia and New Zealand. We will continue to work diligently to realize the vision of a truly global Pandora, but for the time being we are required to restrict its use. We are very sad to have to do this, but there is no other alternative. ???!!
    Any other software I can use because I loved this idea

  3. #3
    Hello GRMaDHoUsE,

    It sounds like your located in a place that Pandora doesn't service. About the only way around that geoblock to use a Proxy service that gives you an IP Address in the US, Australia or New Zealand.

    However, I have been working on a new version of this whole concept and it doesn't require Pandora or another 3rd party music player. Basically it combines the listener program with a custom music player. The advantage of this is that there is less of a delay between issuing commands in-game and then executing them, and you only need 1 piece of free software to run it.

    I'm still a month away from releasing anything, so if you don't mind waiting a bit, I can have a ready-to-go solution for you.

  4. #4
    Hi speedbump

    Thx for your fast reply and I can wait since I dont have the knowledge of doing it myself.
    (Alter IP would make bad ping for server otherwise a good idea) Your new version: You mean like Iam DJing my choice of music
    to be played in game? if yes: YEEEEEEEEEY!!!! and the free software is.... hopefully available in Greece

  5. #5
    HI how is program going?

  6. #6
    Sorry for the super delayed response. I'm making progress on the player, but my primary employment has me doing a number of other things. I'll see if I can get something put together and available this week. Again, sorry about the really long delay!

  7. #7
    OK, I had a chance to put some more time into the program but I've encountered a bug in the development software. This bug prevents my player from playing about half of the MP3's I throw at it. In my test, I ran through about 1,000 MP3's and it would play some, then nothing at all.

    I'm going to give the company that builds the development software a chance to see if they can fix the bug. If I don't get anywhere within them in a few weeks then I'll probably look into an alternative solution.

    I'll keep you posted.

  8. #8

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •