Auto Logoff Script
#1
Question 
I just wanted to know if it was possible to add a script that automaticaly runs when I logon to my profile and when it leave the xbox alone for 10 minutes that it goes back to the login screen. Is this possible at all?
Reply
#2
yes
Reply
#3
- 12-08-2006 added: xbmc.getGlobalIdleTime() method to python. Updated some documentation.

You can use this method to check the idle time. I guess that was obvious. Smile
Reply
#4
I have tried looking around but I don't know what function to use to get it to go back to the login screen.
Reply
#5
the builtin command

system.logoff
Reply
#6
Code:
# idle time in minutes
IDLE_TIME_MIN = 10
s = 1
while s > 0:
  # get idle time
  it = xbmc.getGlobalIdleTime()
  #calculate sleep time in msec
  s = ((IDLE_TIME_MIN * 60) - it ) * 1000
  # sleep
  if (s > 0): xbmc.sleep(s)
# log off
xbmc.executebuiltin('System.LogOff')

either name it autoexec.py or call it from autoexec.py
Reply
#7
Could you please clarify exactly where to create autoexec.py and what permissions, if any, need to be set etc. I've dropped the above example into .xbmc/userdata and it doesn't appear to work.

Steve
Reply

Logout Mark Read Team Forum Stats Members Help
Auto Logoff Script0