USA
Asked — Edited

Scripting Help

I have experience in C++, but I have absolutely no experience in EZ Script so bare with me.

I have lots of questions, but I'll begin with two- How does one initiate another script at a certain time- let's say 9PM

Thanks!


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

United Kingdom
#1  

EZ-Script is exactly as it sounds, easy.

The manual for EZ-Script is in the right hand side of the script UI along with all "control commands" etc. It's also available to download as a PDF here (although not always current as it is maintained by me not by EZ-Robot inc.)

There are a few ways to initiate a script at a set time. WaitUntilTime

Quote:

WaitUntilTime( hour, minute ) Waits until the specified time. The script will stop at this command and not continue until the specified time. The time is declared in 24 hour for Example: WaitUntilTime(17, 30)
This will pause a script until the time specified.

Or personally, if it's part of another script which you want running in a loop you could always use the global variables $hour $minute and $second in an IF statement to then call the required script or action with a ControlCommand


:start

# Other code for script such as other timers etc...

If ($hour = 17 and $minute = 30)
  ControlCommand("Script Manager", ScriptStart, "1730alarm")
EndIf

# More code for other functions etc...

Goto(start)

I have also written a nice introduction to scripting post here which it may pay to have a read of. I plan further posts going in to great detail of specific functions so if there is anything specific you wish to know more about please say so and I will work it in to the tutorials.

#2  

The amount of amazing people on this forum is absolutely outstanding. I have plans to move the proejct over to C# eventually, whether or not that will ever happen is debatable, but hopefully I'll get there.

Next question: Next, how would one detect audio output from the speakers? By this I mean in general for the entire computer. Lets say move a servo if audio output is detected.

United Kingdom
#3  

You wouldn't need to use a script for that, I believe there is a control for audio detection User-inserted image

Help page is here

User-inserted image

User-inserted image