Author Topic: Command Repeat counter  (Read 6870 times)

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Command Repeat counter
« on: June 08, 2018, 04:09:11 PM »
Is there a way to show how many times a command has repeated, other than counting the number of times it shows in the log.
I have a command that repeats 15 times over 7 hours and was trying to track where in the cycle it is.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #1 on: June 08, 2018, 06:54:06 PM »
You'd have to make your looping command increment a variable, then check that variable using another command.

E.G.
Code: [Select]
Set integer [repeatCount] to [repeatCount] plus 1
Would be present in your looping command.

Check repeat count
Code: [Select]
Say, 'The command has repeated {INT:repeatCount} times.'
And a command like this could be used to retrieve that data.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #2 on: June 09, 2018, 10:51:59 AM »
Thank you I will give it a try.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #3 on: June 09, 2018, 12:59:33 PM »
Well I finally figured out how to create the command. I love these investigative tests to make me familiar with voice attack.
Is there a way to get it to write the count to the recognition  log.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #4 on: June 09, 2018, 02:19:31 PM »
Is there a way to get it to write the count to the recognition  log.

Use the "Write a Value to the Event Log" action:
Code: [Select]
Write '[Blue] The command has repeated {INT:repeatCount} times.' to log

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #5 on: June 13, 2018, 07:01:50 PM »
I am having a problem I have produced the command, got it to work once and now I only get "the command had repeated not set times"
Clearly I am missing something

« Last Edit: June 13, 2018, 07:16:18 PM by Incurable-Rash »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #6 on: June 14, 2018, 12:20:07 PM »
There doesn't appear to be anything wrong with the action you've posted; Could you post the rest of the command?

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #7 on: June 14, 2018, 01:21:39 PM »
I think this is what your asking for

Set integer [repeatcount] to [repeatcount] plus 1
Write ' The command has repeated {INT:repeatcount} times.' to log
Say, 'Disable Throttle'  (and wait until it completes)
Execute command, 'Game Login auto - Keybinding' (and wait until it completes)

I have also tried this way too:

Set integer [repeatcount] to [repeatcount] plus 1
Say, 'The command has repeated {INTrepeatcount} times.'
Say, 'Disable Throttle'  (and wait until it completes)
Execute command, 'Game Login auto - Keybinding' (and wait until it completes)

« Last Edit: June 14, 2018, 01:24:40 PM by Incurable-Rash »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #8 on: June 15, 2018, 04:41:56 AM »
There's nothing in your first example that would lead to "Not Set"(the second example cannot work because "{INTrepeatcount}" is not a valid token syntax) from what I can see.

One improvement you can make is to add a "~~" prefix to make the variable execution chain-scoped(meaning the value only applies to this command and the ones it executes, executing it a second time, even simultaneously, will result in both keeping their own count instead of incrementing the same one).


If it still won't work, I could take a look at your profile if you export it and attach it to a post here.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #9 on: June 15, 2018, 09:50:21 AM »
That seemed to work in my test command. I'll try it in the working command.

Does the say command not work in my example because it was missing the colon. or is it just the whole command.

For future reference if it didn't work were you asking for the whole profile or just the whole command.
I can give you either but the vap is some 750 commands large, not sure if that is a problem or not.

And thanks for all your help
« Last Edit: June 15, 2018, 11:13:37 AM by Incurable-Rash »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #10 on: June 16, 2018, 09:17:24 AM »
Does the say command not work in my example because it was missing the colon. or is it just the whole command.
Because of the missing colon, the second one would say "The command has repeated INTrepeatcount times", because if text between curly braces doesn't match a known token the braces will be stripped.

In this particular case there isn't much of a difference between writing to the log and having TTS speak it; The token should be processed and replaced with the value of the variable, and the rest is static text.

It should work in either form(if the token syntax is correct), from what I can see.


For future reference if it didn't work were you asking for the whole profile or just the whole command.
That depends; If the full command by itself works on my machine the entire profile could be necessary, or even the entire profile database file.

Because what you're posting appears to be a valid command, it should work, so if it doesn't work it could be an undiscovered bug, which should be fixed if possible.

There are no guarantees, however; People have had issues with various commands in the past, and rebuilding them the exact same way fixed it for them, but the cause for that sort of thing is really hard to track down without the exact conditions that led to the issue in the first place(Almost up to and including the phase of the moon and the amount of solar radiation at the time ::)).

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #11 on: June 16, 2018, 09:45:35 AM »
Thank you for the information.
The write to log started working with your addition of ~
The say part have not worked on yet,
in the write to log command it say blue, should I be expecting the written text to show up in blue or is it just the dot next to it?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #12 on: June 16, 2018, 10:51:53 AM »
in the write to log command it say blue, should I be expecting the written text to show up in blue or is it just the dot next to it?
The text is either black or white, in "normal" or dark mode, respectively; Only the dot changes color depending on the setting in the action.


The reason your text is blue in your earlier post is that
Code: [Select]
[Blue] is also used in bbcode, so the forum interprets it as such.
If you wrap it in code tags(click the "#" symbol above the post textbox), the forum will not process it and leave your text intact.

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #13 on: June 22, 2018, 08:25:18 PM »
can a {time} token be placed in command to time stamp when the count number is written

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Command Repeat counter
« Reply #14 on: June 22, 2018, 10:46:58 PM »
Yes...

You could add it to the log like
Code: [Select]
Write 'The command has repeated {INT:repeatcount} times at {time}.' to logand it'd result in something like "The command has repeated 5 times at 5:30 PM."

Incurable-Rash

  • Full Member
  • ***
  • Posts: 181
Re: Command Repeat counter
« Reply #15 on: June 23, 2018, 02:13:42 PM »
cool thanks
Was not sure how to write it.