!need help! timer-started playing! - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: !need help! timer-started playing! (/showthread.php?tid=10757) |
- hiqweever - 2005-03-18 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? - Asteron - 2005-03-19 (hiqweever @ mar. 18 2005,10:16 Wrote:description: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. - hiqweever - 2005-03-24 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! - Asteron - 2005-03-24 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. - solexalex - 2005-03-24 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 - hiqweever - 2005-03-25 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? |