Author Topic: Page Up / Down Multiple Times  (Read 3160 times)

0 Members and 1 Guest are viewing this topic.

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Page Up / Down Multiple Times
« on: January 01, 2016, 11:35:10 PM »
Sorry I know this is basic to you experts but I've hunted around & can't figure it.

How do I tell VC to Page Down 2, 3 or 4 times?

I've popped the code below & the payload is
Value - Phrase
1 - Page Down
2 - Page Down
3 - Page Down
4 - Page Down

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="697" name="Page Down (Number)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>SendKeys</cmdType>
    <params>
      <param>{PGDN}{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Page Down {1}</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Page Up-Down Mulitple.xml</payloadFromXML>
  <payloadRange>1,4</payloadRange>
</command>

****************************************************
Update, I've tried eliminating the payload.xml & using a payload range 1,4 but VC just sends the command once.
Do I need a payload xml for this?
I'm finding with a payload.xml VC doesn't recognize commands but with a payload range of 1,4 it will recognize the command but will only Page Down once.
So Page Down 2 & the VC history displays "Send.Keys{PGDN}{2}"

Been twiddling on this for about 2 hrs but just can't get it :-(

This is where I'm at...
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="697" name="Page Down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>SendKeys</cmdType>
    <params>
      <param>{PGDN}{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Page Down, Go Down</phrase>
  <payloadRange>1,4</payloadRange>
</command>



« Last Edit: January 02, 2016, 12:41:30 AM by SteveB69 »
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #1 on: January 02, 2016, 01:58:01 AM »
Jitterjames has answered this question for you in another thread but for moving up, down, left, right
http://voxcommando.com/forum/index.php?topic=2397.msg20700#msg20700

if you look at the command he shared you will see how he built the command and how he uses {1} as the direction to move

and {2} (all the way on the right side of the action by the X) to tell it how many times the action should execute

so if you say:

Move RIGHT 5

Right (payload 1) = {1}

5 (payload 2) = {2}

all of this is covered in the links that jitterjames and I shared with you on the other thread

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #2 on: January 02, 2016, 02:14:36 AM »
I've looked at that 4 directions command & I do have it installed. Believe me I have looked,

I guess I could add a Page Down phrase to that but I'd really like to understand how to build these things myself so I'm not jumping on the forum all the time.

In the 4 directions a payload.xml is used. So if I use a payload.xml for Page Downd x 2 what do I put in the payload.xml.
In the command, vk:{1}, what does the vk mean?
Why has 4 directions been given a repeat of 2?

Is there any chance you could list out what I need to do for Page Down x 1, 2, 3, or 4, because I can't get it?
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #3 on: January 02, 2016, 02:31:04 AM »
{1} = payload 1
{2} = payload 2
... and so on

so when building a command if you have 2 payload phases then they are represented in the actions as {1} and {2} so if your phrase is
(underlinded means payload)         
move up 5

up is {1}

5  is {2}

or if your command is

play movie Avatar and Zoolander

Avatar is {1}

Zoolander is {2}

I hope this helps

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #4 on: January 03, 2016, 08:16:56 PM »
The code below is where I am at.
i am kinda getting to grips with payloads but what I am talking about, Page Down (followed by a spoken number)
Should I use a payload range, a payload list or a payload xml?

This is a screenshot of my command, where should I put the payload {1} as where it is placed at the moment, the command is being recognized but the action is only doing Page Down x 1. Despite the OSD confirmation displaying whatever number I say as well.

I'm not following what you mean re a phrase is underlined if a phrase is used.
Example, using the 4directions.
If I say Jump Up 2, nothing is underlined in the OSD & nothing is underlined in the history window???





Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.2-->
<command id="697" name="Page Down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>SendKeys</cmdType>
    <params>
      <param>{PGDN}{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Page Down, Go Down</phrase>
  <payloadRange>1,4</payloadRange>
</command>
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #5 on: January 03, 2016, 09:39:52 PM »
this is how you would set the command up to make it execute X amount of times

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="697" name="Page Down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>SendKeys</cmdType>
    <params>
      <param>{PGDN}</param>
    </params>
    <cmdRepeat>{1}</cmdRepeat>
  </action>
  <phrase>Page Down, Go Down</phrase>
  <payloadRange>1,4</payloadRange>
</command>

if you look at the command you will see that on the far right of the action I placed {1} where 1 is by default, so that the command would repeat the action the same amount as you say for payload 1

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #6 on: January 03, 2016, 10:41:33 PM »
Brilliant, that's got it, thanks, I had no idea that a payload you want repeated could be put into the repeat box & would not have figured that one out.  :bonk

On a side note, my Kodi Simple Actions was interfering with this, I'm not a massive Koid user so not a problem, I disabled the Kodi Simple Action Command tree, right click, disable.
However for Page Down 7, VC will not recognise the 7 (this is probably down to training?) but only happens on 7 & does nothing, just wondering why?

So whenever I say Page Down 7 this comes up on the OSD
Page Down
Kodi Simple Actions

And in the history.

Quote
Page Down  (96.1%)

Quote
XJson.Raw:Input.ExecuteAction&&"action":"pagedown"
Error: System.Exception: Failed to connect to XBMC:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.0.2:80
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.getObj(String[] allParameters)
   at vcPlugin.xJsonHttpCommunicator.jsonRaw(String[] allParameters, Boolean convertSlashToFwd)
   at vcPlugin.Plugin.doAction(String[] parsedActions, String[] parsedParams)
Plugin: D:\VoxCommando\Plugins\XJson\XJson.dll
Quote
<event>VC.NotRecognized</event>
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #7 on: January 03, 2016, 11:19:28 PM »
it sounds like there is a command that uses "Page down" phrase in your kodi commands, you can either change the phrasing for one of the two commands or your could, disable the Kodi command,

the command I shared with you only had a range of 1-4, after you changed that number in the payload range did you close the command tree and save changes?

as for the error that you received it looks like VC did not connect to Kodi properly,

Was Kodi running when you issued the command? if not that is most likely what caused the error

if Kodi was running, go into your XJson plugin and click "Test HTTP Connection", what does that return as a result?

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #8 on: January 04, 2016, 12:11:34 AM »
Thanks PegLeg, no I'm not using Kodi & rarely do.
I just want to use the Page Down multiple times within windows, I did disable the Kodi Simple Actions command & restart.

It seems hit and miss though, sometimes it will work as the Window Navigation folder I have the command in, sometimes it will just OSD Page Down & have it listed under the Kodi Simple Actions, so I'm just surprised as I have disabled the Simple Actions tree. Not really an issue as I just won't use 7 but I'm confused why a disabled action is still coming up on the screen?
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #9 on: January 04, 2016, 12:24:56 AM »
on the main window of VC there is a check box next to the word Groups, click that and then look through that list for the name of the group that you disabled (Simple Actions) and make sure it is yellow if it isn't yellow then click it and it should now be yellow, then try and execute that command,

if you are still having trouble with it executing the command seven times then I would enable logging http://voxcommando.com/mediawiki/index.php?title=Log,

and then issue the command four or five times using  different numbers, with two of them using 7, and then attach the log file so it can be looked over

also what is the payload range on your action set too? (1,4)

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #10 on: January 04, 2016, 12:38:20 AM »
Yeah the group is yellow under groups.

I changed the payload range to 1,10

As said it works fine on all other numbers, it's just 7. I'll do a full PC reboot later just in case & if still not working will do the log event as you suggested. Am now trying to get gg.cal to work, which I've mentioned on another thread :-)
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #11 on: January 04, 2016, 03:40:09 AM »
Here is a other way for "page down" command, maybe this will work better for you.
This command group use the payload range in the "looping" function in the command editor and has the advantage that you can stop the executed command if you have say a to large or a wrong number by accident. If VC recognize by accident "page down 50" instead of "page down 15", you can say "stop page down" to stop the command. You have also a control over the scroll speed by setting up the delay. If the "looping" function is enabled, the command has blue letters in the VC command tree. All this is not new to VC, only a bit reading in the Wiki  ;)


http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder#Looping


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<commandGroup open="False" name="page down" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="700" name="Page Down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="100" loopMax="{1}" description="">
    <action>
      <cmdType>SendKeys</cmdType>
      <params>
        <param>{PGDN}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Page Down, Go Down</phrase>
    <payloadRange>1,100</payloadRange>
  </command>
  <command id="33" name="stop page down" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>nothing</cmdType>
      <params>
        <param>nothing</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>stop page down</phrase>
  </command>
</commandGroup>
« Last Edit: January 04, 2016, 03:44:06 AM by Kalle »
***********  get excited and make things  **********

SteveB69

  • Contributor
  • ***
  • Posts: 72
  • Karma: -1
    • View Profile
Re: Page Up / Down Multiple Times
« Reply #12 on: January 04, 2016, 10:11:42 PM »
Just wanted to add tha 24 hrs later & after a C reboot the Page Down or Page Up 7 is now working perfectly.
Thanks for the help in getting this one working.
Chances are I've searched the forum, searched the wiki & scoured You Tube but I'm just to thick to work it out without help!