Floating button

lumgte

New member
Hello help guys please. So in macro droid ì want to create a macro that will be autoscrolling, pinching, expanding and whatever with gestures related. I made floating button made one gesture and 3 hours past since ive stuck on how to stop actions by pressing the same button i pressed to start the action?
 

JA-Translator

Moderator
how to stop actions by pressing the same button i pressed to start the action?

You can use a child constraint under an Action or IF clause.
That's how you can run a different action with the same button.

See the sample below.

If this is not a right advice for what you are looking for, then sorry about that and never mind. 😆

Screenshot_20230525_033056.png
 

Endercraft

Moderator (& bug finder :D)
You can use a child constraint under an Action or IF clause.
That's how you can run a different action with the same button.

See the sample below.

If this is not a right advice for what you are looking for, then sorry about that and never mind. 😆

View attachment 5626
It should work correctly if you toggle a boolean variable instead but the sample's order is correct.
 

lumgte

New member
It should look like this: if trigger pressed - swipe 5 times. And if (else if) its fired - cancel macro actions. Why in this case macro runs but can't be stopped pressing the trigger?
 

Attachments

  • Screenshot_20230525_072426.jpg
    Screenshot_20230525_072426.jpg
    105.3 KB · Views: 6

Endercraft

Moderator (& bug finder :D)
I would correct it and take a screenshot but I can't really do so right now so instead I'll just edit your screenshot.
Screenshot_20230525_082713.jpg
 

Endercraft

Moderator (& bug finder :D)
I don't think you can switch from a point to another with this type without sliding to it. You have to use another gesture action...
 

Endercraft

Moderator (& bug finder :D)
I think it's preferable to add a Set Variable toggle=true action between End Loop and Else, otherwise if you don't interrupt the macro with the button, the loop won't start the next time you press it
I don't think it would change anything as the variable is already true when running this else statement ; the if statement is if toggle=false which means the else statement will run whenever the toggle variable is true so no need to set the variable to true.
 

Qarboz

Well-known member
I don't think it would change anything as the variable is already true when running this else statement ; the if statement is if toggle=false which means the else statement will run whenever the toggle variable is true so no need to set the variable to true.
I most likely misunderstood, but it seems to me that when you press the button when the toggle variable is true, it is set to false and the loop is launched. If the loop executes the 5 time, the macro terminates execution, and the toggle variable is still false. If press the button in this condition, the macro sets the variable to true and does not execute the loop; to execute it it is necessary to press the button again. Ok, it's not a big problem, but with a little work it can be fixed. But then again, maybe I misunderstood the macro
 

Endercraft

Moderator (& bug finder :D)
I most likely misunderstood, but it seems to me that when you press the button when the toggle variable is true, it is set to false and the loop is launched. If the loop executes the 5 time, the macro terminates execution, and the toggle variable is still false. If press the button in this condition, the macro sets the variable to true and does not execute the loop; to execute it it is necessary to press the button again. Ok, it's not a big problem, but with a little work it can be fixed. But then again, maybe I misunderstood the macro
You're right ! In your first post you said to put the set variable
between End Loop and Else
but it has to be placed before the Else.
 
Top