Timed screensaver that works with touchscreens without mouse emulation

This script, combined with a user created tag and a "invisible" rectangle, will allow for a timed screensaver page to start either 2 minutes after the screen was opened or 2 minutes after the last interaction (touch or click) with the screen (ie. if you open a page a two minute timer starts, the moment you press a button, the timer stops and won't restart until you release). Change the length of time by changing the 120 in the graphics script to how ever many seconds you want before a screensaver page would become active.

1.) Make this your graphics script:

'Variables with local scope can be declared and initialized here.


'Procedures with local scope can be implemented here.


'This procedure is executed just once when the graphic module is started.
Sub Graphics_OnStart()

End Sub

'This procedure is executed continuously while the graphic module is running.
Sub Graphics_WhileRunning()
If $ScrnSvr=1 Then
If DateDiff("s", $StrGetElement($ScrnSvr->TimeStamp, ".", 1), Now)>=120 Then $Open("Screensaver") Else
End If

End Sub

'This procedure is executed just once when the graphic module is closed.
Sub Graphics_OnEnd()

End Sub





2.) Set this as your screen script for every screen:

'Variables available on this screen can be declared and initialized here.


'Procedures available on this screen can be implemented here


'This procedure is executed just once when this screen is open.
Sub Screen_OnOpen()
$ScrnSvr=1
End Sub

'This procedure is executed continuously while this screen is open.
Sub Screen_WhileOpen()

End Sub

'This procedure is executed just once when this screen is closed.
Sub Screen_OnClose()
$ScrnSvr=0
End Sub



3.) Create rectangle that covers the entire page and add a command to it. In the command, make *On Down as Reset Tag and *On Up make Set Tag. Tag for both should be ScrnSvr if you are using my script directly, if not you will need to change all instances of ScrnSvr to your own custom tag.

4.) Make the rectangle invisible by selecting no fill and no outline.

Fun demo attached. Easter eggs included. If anyone wants a video demo making this, let me know and I will create one.