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);
I also tried it, works well
@Athena After trying the script did not have good results // Set the initial countdown time in seconds var countdownTime = 10;
// Loop to count down from 10 to 0 for (var x = countdownTime; x >= 0; x--) { // Display the current countdown time with a 1-second timeout controlCommand("Display Popup", "Display", "Countdown: " + x, 10, 200, 200); }
I understand the sizing of the popup but where do I change the location of where the popup is located on the screen? Not sure why but as written the code takes 10 seconds between each number 10, 9, 8... rather than the 1 second.
It looks like there was a misunderstanding in the script. The timeout value should be set to 1 second for each countdown step, and the loop should decrement correctly. Additionally, to set the location of the popup, you can specify the
window x location
andwindow y location
parameters in thecontrolCommand
.Here's the corrected script with the proper timeout and location settings:
Explanation:
for
loop counts down from the initial countdown time to 0.controlCommand
updates the Display Popup with the current countdown time, sets a 1-second timeout, specifies the window size (200x200), and sets the window location (100, 100).sleep(1000)
function pauses the script for 1 second to allow the display to update before continuing to the next iteration.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. The popup will be located at the specified coordinates (100, 100) on the screen.
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 Yes that was better but I'd still like to fine tune it more. The popup keeps turning on and off would rather have it continuously on and decrement the number. I'd also like to have the seconds broken into the hundredths 3.33 seconds etc. Is there a schematic of the grid location of the screen so I can pinpoint the location that I'd like to have it located rather than trial and error. How does the x y work and is there a calibration somewhere that I need to know about for sizing and location?
To achieve a smoother countdown without the popup turning on and off, you can update the text within the same popup window instead of creating a new one each second. Additionally, to display the countdown in hundredths of a second, you can adjust the sleep interval and the countdown decrement accordingly.
Regarding the screen coordinates, the x and y values represent the position of the top-left corner of the popup window relative to the top-left corner of the screen. The coordinates (0, 0) would place the popup at the top-left corner of the screen. There isn't a specific schematic for the grid location, but you can use the screen resolution to determine the coordinates.
Here's an updated script that keeps the popup continuously on and updates the countdown in hundredths of a second:
Explanation:
Screen Coordinates:
Tips for Fine-Tuning:
Replace
x
andy
with different values to see where the popup appears on the screen.This approach should provide a smoother countdown experience and allow you to fine-tune the popup's position on the screen.
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 Tried your script and understand what you are trying to do but it totally got hung up and did not change till I pushed the escape button which decremented it. Could you please verify that the script works with ARC software.
Do it like this to count down 10
Yes that is very close to what I'm looking for. Would like it to do in tenths or hundredths but not sure how to do that. Here is my modified code with location and size. for (var x = 10; x > 0; x--) controlCommand("Display Popup", "Display", x, 1,100, 200); I also tried this for (var x = 10; x > 0; x-=.01) but that didn't work as it counted down 1/100 for each second. How is it known behind the scenes that 10 is 10 seconds as usually we have to specify 10,000 is 10 seconds. example sleep(10000);