!need help! timer-started playing!

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
hiqweever Offline
Junior Member
Posts: 15
Joined: Mar 2005
Reputation: 0
Sad    Post: #1
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?
find quote
Asteron Offline
"Skilled" Python Coder
Posts: 933
Joined: Feb 2004
Reputation: 0
Post: #2
(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.
find quote
hiqweever Offline
Junior Member
Posts: 15
Joined: Mar 2005
Reputation: 0
Thumbs Up    Post: #3
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
find quote
Asteron Offline
"Skilled" Python Coder
Posts: 933
Joined: Feb 2004
Reputation: 0
Post: #4
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.
find quote
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #5
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
find quote
hiqweever Offline
Junior Member
Posts: 15
Joined: Mar 2005
Reputation: 0
Thumbs Up    Post: #6
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?
find quote