I need a little script help with the mobile interface "Image buttons". I have two custom images I have made for one button... put simply, I have a green image for script running, and a red image for script stopped. I have the following script where if I press the image button once, the script runs. Pressing the same button again, the script stops.
What I have been trying to do is when the button is pressed once to start the script, I would like to have the green "running" image continuously on show while the script is running.
Then to press the same button again to stop the script, then have the red "stopped" image continuously show until button is pressed again. At the moment, only the "Stopped" image is displayed whether the script is running or stopped. Here's the script with #notes included...
#If button is pressed, this section runs.
#This is the running script where the green RUNNING image should come on and stay on...
ControlCommand("Sound Sensors", ScriptStart)
$pressed = 1
#If the same button is pressed again, this section runs.
#This is the stopped script where the red STOPPED image should come on and stay on...
ControlCommand("Sound Sensors", ScriptStop)
$pressed = 0
I can guess that something like a "WaitForChange() " is needed, but have not had much luck so far. So any help you guys can offer would be appreciated.