Shutdown script
#1
Exclamation 
hi there

i'm a newbie at python scripting and i have only just found out how to change the .mp3 file that autoexec.py launches when xbmc starts! :kickass:  Wink

while i was fiddling with this i had this idea, that i am sure that someone else has had, and i do apologise if i have double posted, that if it is possible to automatically launch a script when xbmc starts, is it possible to automatically lauch a script when xbmc is shutdown? (shutting down by xbmc not by the power button of course Wink)

if anyone has got any idea how on earth to start creating a script that can do this please do not hesitate to post.

cheers,

bazzy
Reply
#2
ummm by the time the script started up wouldnt the xbox be off? unless you suggest delaying the shutdown which i dont recommend.
Reply
#3
yeah i thought that but if you shut the xbox down by going to the shorcut menu (blue "s" in project mayhem 2 skin) and select "remote only" and then select "shutdown", i think, logically it will launch the script and then when that has finished turn the power off to the hdd etc. a bit like the autoexec.py script that starts after the xbox has booted xbmc but in the oppostie direction. this is just my prediction of what could happen and it is only based on logic and not on facts as i am a complete newbie at scripting etc.! Sad  Blush

as for the shutdown delay i have expained as clearly as i can, but just clarify for me why you said,
Quote:unless you suggest delaying the shutdown which i dont recommend
?

cheers

bazzy
Reply
#4
maybe can you create a new python script. this script will be the one you will use to switch off your xbox :
#1- start the script you want before closing
xbmc.executescript('q:\\scripts\\myscriptbeforecolsing.py')
#2- use the xbmc poweroff function
xbmc.shutdown()

not sure if it works ...
Reply
#5
i created my first script!Cool   Blush
it seemed to miss the script that i told it to launch, and then shut down. maybe its worth a try at doing what the other guy said, delaying the shutdown. any ideas on how to delay the shut down because i don't have a clue on how to do that  Blush

cheers,

bazzy
Reply
#6
sorry, i don't understand you...
does it work or not ??

if you need to wait before stopping :
#1- start the script you want before closing
xbmc.executescript('q:\\scripts\\myscriptbeforecolsing.py')
#2- wait 10 seconds
xbmc.sleep(10)
#3- use the xbmc poweroff function
xbmc.shutdown()
Reply
#7
sorry i'll clarify

i created & launched the script that you told me to create the first time and al it did was shutdown xbox. i'll try your second suggestion now and post back asap.

cheers,

bazzy
Reply

Logout Mark Read Team Forum Stats Members Help
Shutdown script0