Author Topic: Question about RoboB  (Read 1260 times)

0 Members and 3 Guests are viewing this topic.

doughep

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Question about RoboB
« on: January 03, 2015, 12:30:54 PM »
So I have only been using Voxcommando for only a week or so and have installed the our groceries xml and had an idea for vox to tell me how many fuel points I have from local grocery.  I tried to use RoboB and got as far as I could but unfortunately when I tried to extract the data in the html the value is a variable that is pulled in at runtime.  So how can I just find the data on the screen using Cntl F and then copy and paste the data somewhere to have vox tell me what the value is?  I looked into using some sort of macro software but I thought maybe the gurus have a better solution.  Any help would be greatly appreciated.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Question about RoboB
« Reply #1 on: January 03, 2015, 12:45:22 PM »
Hi doughep.

If you can share what you have done so far (prefereably with xml and some explanation of the command) and the site that you are trying to extract info from maybe we can suggest something.

If it requires us to log in to a restricted account of some kind that might be a problem.  You could always share your login info with me privately and then change your password once we are finished, if you are comfortable with that.

You should not need to do any keyboard emulation to get the info you want from RoboBrowser but if you want to do that it might be  possible.    I don't think we can do a find in the RoboBrowser though so you would probably need to use a normal web browser. We have 3 kinds of keyboard emulation and also the ability to set and get text form the system clipboard.

Keyboard emulation (usually try InputKeys first):
  http://voxcommando.com/mediawiki/index.php?title=Actions#InputKeys
  http://voxcommando.com/mediawiki/index.php?title=Actions#SendKeys
  http://voxcommando.com/mediawiki/index.php?title=Plugin_List#DxInput

Clipboard actions:
  http://voxcommando.com/mediawiki/index.php?title=Actions#System

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Question about RoboB
« Reply #2 on: January 03, 2015, 02:03:47 PM »
I tried to use RoboB and got as far as I could but unfortunately when I tried to extract the data in the html the value is a variable that is pulled in at runtime.

It's hard to know the right course of action without seeing the page you're talking about and the command you've been using, but an important tool when using RoboB is the RoboB.Wait action. This usually allows even dynamic pages to finish loading all their content before we grab anything from that page.

Below is an example to illustrate the point, using Google's online calculator.

Test the command with the RoboB.Wait action disabled (as it is now), then test it with the action enabled. The command only works in the latter instance.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="425" name="RoboB.Wait Test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Test this command several times, changing the RoboB.Wait repeat value from &quot;0&quot; (0 = disabled action) to the standard &quot;1&quot;. Calculation only works if we wait for the page to finish loading.">
  <action>
    <cmdType>RoboB.Select</cmdType>
    <params>
      <param>ggTest</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Navigate</cmdType>
    <params>
      <param>https://www.google.ca/search?q=calculate+{1}*{2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Wait</cmdType>
    <params />
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Show</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByID</cmdType>
    <params>
      <param>cwos</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>calculate</phrase>
  <payloadRange>1,10</payloadRange>
  <phrase>times</phrase>
  <payloadRange>1,10</payloadRange>
</command>
« Last Edit: January 03, 2015, 03:37:13 PM 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)