OK here is what I was doing. My wife wanted me to be able to add all songs from the music DB to the playlist and shuffle it, I did this without a problem.....but I wanted more
I have a few stand-up comedy mp3's that I did not want included so I figured I would list all of the genres with the ability to pick individual genres loading all songs from that genre. I wanted to use a category of filter details so I would not have to type all the genres in manually, so I just do a "Set Filter" on Genre at the page load and it automatically lists all the Genre's from my music DB. The only problem I had was I wanted to be able to see what Genre's were selected already, toggle buttons would do this but I didn't know how to get that to work with a category, so I decided to have them listed in a text box as they were selected using the music>genre variable. The problem with this was to get the textbox to "list" the genre's instead of show one and then replace that one each time another was selected.
This is where the script came into play, thanks a bunch dalanik!!!
The problem I then ran into was it would not work on the thin client, AHHHHHHH
I finally got by that using xReceive/xSend.
I replaced the text box using the xReceive variable: plugin>XReceive>received
Here is the script I used:
- Code: Select all
Module Script
Public Sub Main(Source as string)
Dim StrGenre, StrGenreList
' *** get genre from xlobby database
'StrGenre = Xlobby.GetXlobbyVar("%music>genre%")
'StrGenre = Xlobby.GetXlobbyVar("%variable>testvar%")
' *** get list variable from xlobby
StrGenreList = Xlobby.GetXlobbyVar("variable>genrelist")
' *** append it to list (I suppose you want space to separate)
StrGenreList = StrGenreList & ControlChars.CrLf & Source
' *** now, save list to xlobby variable
Xlobby.SendCommand("xlobby", "save to variable", StrGenreList, "genrelist" )
Xlobby.SendCommand("xlobby", "run event", "general", "test" )
End Sub
End Module
Each time a category entry is clicked it runs:
Save to Variable
----Information: %music>genre%
----Variable: testvar
Add All
----Category Name: Music
Command
----Plugin: XscriptNG
----Command: ExecScript
----Variables: musicgenres.txt "%music>genre%"
Set Sort Order:
----Category Name: playlist
----Sort Order: shuffle.pos (shuffle.pos is created using the xMusic plugin)
The last event in the script:
- Code: Select all
Xlobby.SendCommand("xlobby", "run event", "general", "test" )
just send the genrelist variable to the server thru xSend which is then displayed on the server and thin client thru the plugin>XReceive>received variable. The cool part about this is the thin client and the server are always in sync with this....we need more of xReceive!!!!
This is just a quick type up of what I did but if anyone needs more info or clearer instructions just let me know.
Here is a screen cap of the Genre Select screen:
This was just whipped up quick as you can tell and is not finished, as you can tell with all of the "test" commands and event groups.