Asked — Edited
Resolved Resolved by DJ Sures!

Scripts Not Executing On Mobile App

Hello,

I finished putting together my 1st set of actions and scripts to be executed from the mobile app. All of my actions execute perfectly, but none of my buttons that trigger scripts are working from the mobile app (all buttons script & action work fine while executing from the computer).

Attached I have provided my program, if someone can tell me what I'm doing wrong that will be great.

Thanks.1st-day-in-class.EZB


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

PRO
Synthiam
#1  

The script in your buttons won't work in either Mobile or Desktop - You're executing a bunch of Auto Position actions without any pauses between each.


print("Start Music...")
ControlCommand("Soundboard v4", Track_0)
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
ControlCommand("Auto Position", AutoPositionAction, "Egypt - Zone")
ControlCommand("Auto Position", AutoPositionAction, "Pushups")
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

What you should do is specify a pause that is dependent on how long you think you're action will run. like so...


print("Start Music...")
ControlCommand("Soundboard v4", Track_0)
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
sleep(3000)
ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")
sleep(5000)
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
sleep(3000)
ControlCommand("Auto Position", AutoPositionAction, "Egypt - Zone")
sleep(4000)
ControlCommand("Auto Position", AutoPositionAction, "Pushups")
sleep(8000)
ControlCommand("Auto Position", AutoPositionAction, "Happy Time")
sleep(4000)
ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

#2  

Hello DJ, thank you for taking the time to look at my project.

I know it may sound strange, but actually all buttons do work on my Windows environment. I put together a short video showing everything:
Scripts working in Windows

I will add the sleep commands, as you advised. Thanks for pointing that out, it makes sense that they are needed.

PRO
Synthiam
#3  

If they work in windows, it's magical:) Probably due to your PC having a much faster processor than your Mobile Device causing the threading to execute the last action, or one of the actions randomly. Threading can do strange things:D

#4  

Sorry, I have not had time to add the pauses, I will get to it this weekend. Thanks again for the suggestion.

PRO
Synthiam
#5  

Do not bother using this method any longer. There is the new Sound Board v4 which has Script Editing at specific times - look at the JD Dance DJ project in ARC

Unless you're still wanting to use the scripting method for education, do this to ensure the script is done before executing the next script.. This will only work for actions that do not repeat for ever. For action that repeat for ever, use a Sleep()


print("Start Music...")
ControlCommand("Soundboard v4", Track_0)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Egypt - Zone")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Pushups")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

goto(waitForActionComplete)

Halt()

:waitForActionComplete
# wait a brief moment to ensure the action is running
sleep(100)

#wait for the action to complete
WaitFor($AutoPositionStatus = 0)
return()

#6  

Hello,

I finally had an opportunity to make the recommended updates, but when I try to download my updated app, I get an "Unable to connect to EZ-Cloud" error. My mobile device is connected to the web and I have never had this problem before.

Any thoughts?

PRO
Synthiam
#7  

You are running the latest version of Mobile App and ARC?

Also, here's an even better way...

*Note: using the WaitFor() with an Auto Position Action assumes the action is not set to repeat for ever. The WAitFor() example below waits for the action to complete. If the action is set to run for ever, it will never complete


print("Start Music...")
ControlCommand("Soundboard v4", Track_0)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Egypt - Zone")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Pushups")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Happy Time")

goto(waitForActionComplete)

ControlCommand("Auto Position", AutoPositionAction, "Leg Stand")

goto(waitForActionComplete)

Halt()

:waitForActionComplete
# wait a brief moment to ensure the action is running
sleep(100)

# wait for the action to complete
WaitFor($AutoPositionStatus = 0)
return()

#8  

I updated the app and everything is working perfectly. I still have some bugs in my script, but I can figure it out from here.

Thank you very much for taking time to assist. ;)