Popup a custom window with custom text to the user from a command
How to add the Display Popup robot skill
- Load the most recent release of ARC (Get ARC).
- Press the Project tab from the top menu bar in ARC.
- Press Add Robot Skill from the button ribbon bar in ARC.
- Choose the Display category tab.
- Press the Display Popup icon to add the robot skill to your project.
Don't have a robot yet?
Follow the Getting Started Guide to build a robot and use the Display Popup robot skill.
How to use the Display Popup robot skill
Use the ControlCommand() to send custom text to this skill, which will be displayed on full screen for a set period. The configuration menu allows you to adjust the text font, text color, and background color. There is a default timeout value as well. All ControlCommand() for this skill can be found in the Cheat Sheet tab. See the video below for an example of use.
Main Window
1. Display Popup Nothing to interact with. Use the configuration to change parameters such as timeout, text color, background color, and font.
2. Script Use a ControlCommand() script to execute a Display Popup.
Configuration
1. Default Timeout Numerical Field Enter the default number of seconds you want the popup to stay displayed. It can be overwritten by the ControlCommand() script.
2. Color Buttons Change the color of the popup text and background.
3. Font Change Button Change the popup font. Use any font that's installed on your device.
How to Use Display Popup
Add the Display Popup skill to your ARC project (Project -> Add Skill -> Misc -> Display Popup).
Change the Display Popup configuration if needed.
Run a Display Popup ControlCommand() script. View your Display Popup until the timeout closes the popup.
*Note: Press any key to close the popup before the timeout expires.
Control Commands
controlCommand("Display Popup", "Display", "Text") controlCommand("Display Popup", "Display", "Text", [timeout seconds]) controlCommand("Display Popup", "Display", "Text", [timeout seconds], [window width], [window height]) controlCommand("Display Popup", "Display", "Text", [timeout seconds], [window width], [window height], [window x location], [window y location])Code Sample
# use default timeout value
ControlCommand("Display Popup", "Display", "Some text to display")
# use specified 10 second timeout
ControlCommand("Display Popup", "Display", "Some text to display", 10)
# use specified 10 second timeout and specify the window size
ControlCommand("Display Popup", "Display", "Some text to display", 10, 100, 200)
# count to 10
for (var x = 0; x < 10; x++)
controlCommand("Display Popup", "Display", x, 1);
If you scroll up and read the control commands manuals, it works in seconds only
the FOR statement is a loop.
@athena explain what a FOR loop is and each part of this
Sure, let's break down the
for
loop and how it works in the context of your script. Afor
loop in JavaScript (and many other programming languages) is used to repeat a block of code a certain number of times. It consists of three main parts: initialization, condition, and iteration.Here's the structure of a
for
loop:Explanation of Each Part:
true
, the loop continues; if it isfalse
, the loop stops.Your Specific
for
Loop:var x = 10;
- This initializes the counter variablex
to 10.x > 0;
- This checks ifx
is greater than 0. If it is, the loop continues; if not, the loop stops.x--
- This decrements the counter variablex
by 1 after each iteration.How to Modify for Tenths or Hundredths:
To count down in tenths or hundredths, you need to adjust the initialization, condition, and iteration parts of the loop accordingly. Here's how you can do it:
Counting Down in Tenths:
Counting Down in Hundredths:
Full Script Example for Hundredths:
Explanation:
var x = 10.0;
- Initializes the counter variablex
to 10.0.x > 0;
- Checks ifx
is greater than 0.x -= 0.01
- Decrements the counter variablex
by 0.01 after each iteration.controlCommand(Display Popup, Display, x.toFixed(2), 0.01, 100, 200);
- Updates the popup with the current value ofx
, formatted to two decimal places.sleep(10);
- Pauses the script for 10 milliseconds (0.01 seconds) to allow the display to update.This script will count down from 10.00 to 0.00 in hundredths of a second, updating the display every 0.01 seconds.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Now remember you can count down in 10th if a second but the robot skill only accepts seconds. The lowest it’ll go is 1 second.
Ahh, now it makes sense. Cannot make a skill go down to hundredths if it's not made to do it as the lowest it can go is 1 second. The code made sense on earlier versions but then when I ran it would take a second regardless of how I had put in .01. Thanks