Author Topic: Requesting plugin support for Pinup Popper  (Read 7843 times)

0 Members and 2 Guests are viewing this topic.

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #15 on: September 22, 2018, 03:40:41 PM »
ok, so how does the loadbysql command work.  Does anything have to be modified on popper to use query searches like you use for media monkey.

Say for instance, i want to play a table by creator, so play a table from stern, and i want it to return a random table by creator stern ID that i can use in the scraper.

there is also a command that can return a json of the current table data, can that data be used by vox, for the "what table am i playing" or who created this table" function?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #16 on: September 22, 2018, 04:19:56 PM »
ok, so how does the loadbysql command work.  Does anything have to be modified on popper to use query searches like you use for media monkey.
You should look at the web API provided by PUP and if it doesn't provide the functionality you want you should ask them if they can add it.

there is also a command that can return a json of the current table data, can that data be used by vox, for the "what table am i playing" or who created this table" function?

there is also a command that can return a json of the current table data, can that data be used by vox, for the "what table am i playing" or who created this table" function?
Yes it's just a question of scraping and then looking for the information you want.  Probably with RegEx.
https://voxcommando.com/forum/index.php?topic=1699.msg14765

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #17 on: September 22, 2018, 08:22:42 PM »
ok, only think worth pulling in the json was the game name and the emulator name.

So is it hard for vox to access the .db file directly or does it have to be with an API.

Per the developer,  "the reason i did sqllite is SO anyone could read it" , is it alot of work to have vox do the same thing, that its doing the xml generator. Return results from a query of the database and use those results in vox command?


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #18 on: September 23, 2018, 09:10:03 AM »
Hi rablack,

As far as I know, via the xSQL plugin solution that James previously described and VC's various other capabilities you should have everything you need to work with Pinup Popper's remote control options, such as they are.

For example, yesterday you asked how to create a command that would launch a random game for a particular, requested manufacturer.

We took a look at your db when you posted, and came up with the following option.

Generate a Custom payloadXML file via the xSQL plugin that associates a comma-separated list of game IDs with the appropriate game manufacturer:

Code: [Select]
SELECT GROUP_CONCAT(GameID), Manufact from Games where Manufact is not null GROUP by Manufact
This will result in a payloadXML where, for example, the Phrase "Stern" will be associated with Value "1,3,7,8,9,13,27,28,44,49,52,80,230,238,239,247"

Then, in your VC command you just need to parse that value to select one of the IDs randomly. VC gives a bunch of ways to do this. Here's one:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.1-->
<command id="50" name="Get random game by {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>(\d+)</param>
      <param />
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>randomID</param>
      <param>{Match.Rnd}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Launching: {var.randomID}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://REPLACE WITH YOUR IP ADDRESS/function/launchgame/{var.randomID}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>load a game by</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\PUPcreators.xml</payloadFromXML>
</command>

Note: When I generated the Custom payloadXML, I named the file "PUPcreators.xml". By default, these payloads are stored in the XbmcPayloads folder, therefore that is what my command XML points to.

--
Basically, all VC command solutions will be about coming up with the right SQLite query to get the info you want from PUP, and then using a simple Scrape command to execute the desired PUP action. You may have to get a bit creative with your SQL queries.

Have fun.


« Last Edit: September 23, 2018, 09:13:13 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #19 on: September 24, 2018, 12:04:07 AM »
ok this makes sense and will work fine.

One more question.

Is there a find function, where you would say "find tron" and it scrape an all games xml and display all game names with the word tron in the OSD.  That way way you could see the different variations of the table before trying to launch the actual table.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #20 on: September 24, 2018, 08:06:05 AM »
There is no such function.  You could of course write a command to do something similar, although you'd probably have to rely on payload dictation to tell it what to search for.

But this is exactly what subset matching and alternates are there for.

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #21 on: September 24, 2018, 11:23:16 AM »
any directional hints on how to do this, i'm not grasping the regex xml scrape nime5ter.  I can't get any results to return in the test.

I'm assuming you would have to create a payload xml with all of the variations?

In regards to the alternates, does the full vox commando window show up with the alternates of just a black Show.OSD screen?  I'm looking for just the Show.OSD screen, and is there a way to rotate the Show.OSD screen?

I just need a suggested command to use for the find functi, and i can run with it.  Just not sure which route to go.


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #22 on: September 24, 2018, 12:22:52 PM »
Sorry it's not working for you. Not sure what is meant by "I can't get any results to return in the test".

You generated the payloadXML and issued a voice command successfully but it's not returning any game ID? It's not returning a valid game ID? The Scrape action is not properly launching a selected game? Something else?

Maybe you could run the command with logging enabled and post the log per standard user support requests, and also post the payloadXML you generated that you're using in the command.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #23 on: September 24, 2018, 01:38:53 PM »
Sorry it's not working for you. Not sure what is meant by "I can't get any results to return in the test".

You generated the payloadXML and issued a voice command successfully but it's not returning any game ID? It's not returning a valid game ID? The Scrape action is not properly launching a selected game? Something else?

Maybe you could run the command with logging enabled and post the log per standard user support requests, and also post the payloadXML you generated that you're using in the command.


No your command is working great.

I'm talking about a find function, which per James doesn't exist.

Was looking for some guidance, on how i could use the payload dictation and search through an xml and return all like results.

For example, create an all games xml, say find "batman" and have an OSD show all results LIKE Batman in a list.  Not really as an alternate command, just as a reference command.

If i have 3 batman tables the list will show all 3 titles, then i know what to say to launch it.

In your example you scraped the xml, and used Results.Regex, but when you open regex and try to view the results of the xml scrape nothing shows up, so I can't confirm if my scrape criteria is correct.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #24 on: September 24, 2018, 03:05:28 PM »
Ah, OK.

Personally I would recommend that you experiment with the built-in Alternates feature rather than creating a reference command. That's what it is designed for.

You can customize the Alternates OSD window a bit in VC Options, including choosing which monitor it's displayed on if you have multiple screens, and where on the screen it appears. There are quite a few VC videos that show it in action, including the JRiver demo video and others.

If you still want to create a custom command after fully exploring alternates, it could be done pretty easily by importing your games payloadXML into VC Maps and then in your command you would just execute a standard SQL query that looks for "batman" (i.e. the payload dictation term) in the appropriate column of your map table, but I question whether payload dictation will be reliable enough to handle weird video game words.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #25 on: September 24, 2018, 03:13:52 PM »
agreed on the dictation stability, i'm having to create a vox friendly list of pinball game names :)

I will look into alternates osd window as well.

TY for the tip on the VC Maps, just needed a bone.

Appreciate the teams time to look into the requests.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #26 on: September 24, 2018, 03:33:35 PM »
Subset matching and alternates were created for exactly this type of thing.  The only possible issue is that there are 8 alternates at most.

By the way you need to clean up your game names to makes them more speech friendly.

In particular you need to replace all your underscores with spaces.  There are probably other issues as well.

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #27 on: September 24, 2018, 03:57:24 PM »
yep in the process of doing that now (cleaning up the game names), i'm check to see what impacts the GameName has on the software, clean that up and generate an xml off of that field, or might just ask developer to create a VoxName Field.

8 alternates is plenty.

With the advice given, i already have it doing some pretty cool stuff, i'm testing out different headsets now.

Once i get this find function down, i'll be on to scraping data from the Pinball database URL for info  :)

Is there a way to rotate the OSD?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Requesting plugin support for Pinup Popper
« Reply #28 on: September 24, 2018, 04:00:49 PM »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Requesting plugin support for Pinup Popper
« Reply #29 on: September 25, 2018, 01:48:43 PM »
Hi,


maybe this command group will help you, but what James suggest - you have to clean the game names a bit and set a check mark in the VC option menue for show OSD alternates like in the attached picture.


(I tried it with the generated payload XML from James)
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.1-->
<commandGroup open="False" name="play pinball (read alternates aloud)" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="418" name="play pinball {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{PF.1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play pinball</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\PuP_Games.xml</payloadFromXML>
  </command>
  <command id="1164" name="alternates event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{1}&amp;&amp;play pinball</ifParams>
      <then>
        <action>
          <cmdType>Results.SetLastResult</cmdType>
          <params>
            <param>There are {#P} alternates available. You can choose from option 1, to option {#P}.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetLastResult</cmdType>
          <params>
            <param>{LastResult}{CR}Option {i}: {{i}}.</param>
          </params>
          <cmdRepeat>{#P}</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegExReplace</cmdType>
          <params>
            <param>play.*?\{|}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>{LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>{LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <event>VC.Alternates.*</event>
  </command>
</commandGroup>


Kalle
***********  get excited and make things  **********