Client Event Script - Timer, Switch User Question

I have a simple script to switch users to a default username and password after a set amount of time.
See script below.

This is working great with one exception. If the client stays inactive the script keeps firing and firing…
How can I write this so it will only be active if the default user (In this case brewers) is Not logged in?

Just read the client tag for username and check for it?
[System]Client/User/Username

I’m a complete rookie at this.
One of my attempts was to do just that but my syntax must have been way off.
Would you please show me an example.
Thank you

username = "brewers"
password="Mashbrew47"
if system.util.getInactivitySeconds() > 30 and system.tag.read("[System]Client/User/Username").value<>"brewers":
	system.security.switchUser(username,password)
2 Likes

Oh Yeah, I was way off.
This is working perfectly.
Thank you