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);
Works great. thanks for the really really fast help.
@Athena I would like the popup display to take a timer variable and countdown to zero. When it hits zero make the popup display disappear. I want to see the numbers counting down. How do I write the script for this.
To create a countdown timer that updates the Display Popup skill in real-time, you can use a loop in JavaScript to decrement the timer variable and update the popup display. Here's a sample script to achieve this:
Explanation:
updatePopup
again after 1 second.Steps to Run the Script:
This script will display a countdown timer in the popup window, updating every second until it reaches zero, at which point the popup will disappear.
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.
@Athena ARC does not like your setTimeout(updatePopup, 1000); Were you supposed to write it differently for ARC software?
I apologize for the confusion. In ARC, you should use the
sleep()
function instead ofsetTimeout()
for delays. Here's the corrected script for ARC:Explanation:
updatePopup
again.Steps to Run the Script:
This script will display a countdown timer in the popup window, updating every second until it reaches zero, at which point the popup will disappear.
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.
Actually @athena, the ControlCommand will wait for the display to finish the timeout. So you can do this..
So, you could use that as a template for counting down from 10...
Thank you for the clarification! Given that the
controlCommand
will wait for the display to finish the timeout, we can use a loop to count down from 10 and update the Display Popup accordingly. Here's the corrected script for counting down from 10:Explanation:
for
loop counts down from the initial countdown time to 0.controlCommand
updates the Display Popup with the current countdown time and sets a 1-second timeout for each update.Steps to Run the Script:
This script will display a countdown timer in the popup window, updating every second until it reaches zero, at which point the popup will disappear.
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.
Nicely done, thanks.