Kodi Community Forum

Full Version: !need help! timer-started playing!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
description:
-the script has to start on turning on the xbox
-the script has to start playing a movie on a defined time (ex 12:00)
-the script has to loop until a defined time
-another script has to shut down the xbox

is this possible or should i forget it?
(hiqweever @ mar. 18 2005,10:16 Wrote:description:
-the script has to start on turning on the xbox
-the script has to start playing a movie on a defined time (ex 12:00)
-the script has to loop until a defined time
-another script has to shut down the xbox

is this possible or should i forget it?
1. call the script autoexec.py (i believe)
2-3. yeah have a while 1 loop and have it sleep for a few seconds in the polling... check out the yac script for an example of something like this
4. yeah xbmc.shutdown()

everything you said is doable and pretty easy.
thx!

the startup thing is ready! also the loop and the shut down!

the only thing now i need is to define a time on which the video began to play! is this possible? which string i need?

(sorry for my bad english! german!Wink
heres the standard python time module
http://www.python.org/doc/2.3/lib/module-time.html
im not totally sure xbmc supports it but it probably does.

you need to "import time"

you can either calculate the number of seconds from now until "12:00" and sleep for that time followed by a
player.play("f:\movie.avi")

or you can poll the time in your loop and play the movie when you reach the time.

theres a calendar script out there somewhere that you should look at as it probably makes use of the time module.
you can have a look in the thread module
it is supported with xbmc.
or you can do something like this :

while 1:
if timenow==starttime: playmovie
time.sleep(1)

but your script will use python 'all the time'

i really think that thread is the best way.
here is an example that should be interesting : wakeup !.rar
thats it! but i need this wakeup without the dialogs! only to set the wakeup time in the script! also i need to play a playlist file. and finally i need to set more wakeup times, to play different playlists on different time! is this possible?

i tried to modify your wakeup script but it will not work!

can you help me writing such a script?