Author Topic: Command problem  (Read 2094 times)

Christy

  • Newbie
  • *
  • Posts: 13
Command problem
« on: May 02, 2019, 11:27:09 AM »
Hi,
I put a Zoom command with a delay of 0.9sec and I would like in the same command 'stop' it before the delay of 9sec if necessary. But I can not, I looked in the manual, but I can not, and for a non-English speaker it's not easy to translate the manual, and there are specific examples. Fortunately, your forum exists.
Thank you

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Command problem
« Reply #1 on: May 02, 2019, 11:42:09 AM »
You could try something like this:
Code: [Select]
Begin Boolean Compare : [{CMDWHENISAY}Running] Equals True
    Set Boolean [{CMDWHENISAY}Running] to [Not Set]
    Release Z key
    Kill command, '{CMD}' (by name)
End Condition - Exit when condition met
Set Boolean [{CMDWHENISAY}Running] to True
Press down Z key
Pause 9 seconds
Release Z key
Set Boolean [{CMDWHENISAY}Running] to [Not Set]

I don't know how your zoom command works exactly, but if you're holding down a key, you need to release it before killing the command, otherwise it'll remain pressed.

Note that using "{CMD}" for the kill action will only work with a non-spoken trigger if the command only has a single trigger phrase(I.E. no semicolons), otherwise you'll have to type in one of the phrases manually.

Christy

  • Newbie
  • *
  • Posts: 13
Re: Command problem
« Reply #2 on: May 03, 2019, 07:02:54 AM »
Thanck you for your reponse. But this code is too complicated for me
I modified my order while waiting to do better.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Command problem
« Reply #3 on: May 03, 2019, 07:17:57 AM »
I've attached that command so you can import it and have a look at how it's put together.

Christy

  • Newbie
  • *
  • Posts: 13
Re: Command problem
« Reply #4 on: May 03, 2019, 08:35:38 AM »
Merci beaucoup for  the file.

In fact the zoom shortcut is:    Press Left Ctrl+9keys and hold for 15sec and release

iI wish I could say to close the zoom before the delay of 15 sec and ask :  to center the view.
 Keyboard command is : Right Shift+Num Pad5 keys .

this additional info can help you simplify to answer me?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Command problem
« Reply #5 on: May 03, 2019, 08:51:40 AM »
You'll have to clarify what you need help with exactly.

The key combination can easily be changed within the command.

If you want to run another command and kill the first command, that's the same action, just make sure to also clear the variable:
Code: [Select]
Kill command, 'stop if already running'
Set Boolean [stop if already runningRunning] to [Not Set]

Christy

  • Newbie
  • *
  • Posts: 13
Re: Command problem
« Reply #6 on: May 03, 2019, 09:05:04 AM »
Here's what I did from your file

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Command problem
« Reply #7 on: May 03, 2019, 09:17:01 AM »
You said (Bold emphasis mine):
I put a Zoom command with a delay of 0.9sec and I would like in the same command 'stop' it before the delay of 9sec if necessary.
which I took to mean you wanted one command to do both.

If they're separate commands, you only need
Code: [Select]
Kill command, 'zoom'in your "Stop Zoom" command.

Also check the "Allow other commands to execute while this one is running" option in your "zoom" command, that's why the "Stop Zoom" command isn't running.

Christy

  • Newbie
  • *
  • Posts: 13
Re: Command problem
« Reply #8 on: May 03, 2019, 10:00:40 AM »
sorry, I tried to edit with your new info:

'stop if already running'


Set Boolean [stop if already runningRunning] to [Not Set]


Kill command 'zoom'  I do not know at what level I put 'zoom'.

but I can not do it, I have no mistake but: Stop zooming in progress, does not work.

I am not a programmer ... and I do not reach the 'boolean' menu to put the right options.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Command problem
« Reply #9 on: May 03, 2019, 10:50:03 AM »
You don't need to set any variables if you're using two commands, that's what I'm saying. Just discard the "stop if already running" command entirely.

Literally the only action in your "Stop Zoom" command should be
Code: [Select]
Kill command, 'zoom'
You can use the "Stop by name" option and type "zoom" or use the "Stop selected command" option and find "zoom" in the dropdown, both will have the same effect.