xboxscene.org forums

Author Topic: Autoexec  (Read 316 times)

Safety in Nimbus

  • Archived User
  • Jr. Member
  • *
  • Posts: 71
Autoexec
« on: December 08, 2004, 12:11:00 PM »

I'm new to scripting and for some reason my auto execution of an mp3 will not work.   Everything looks correct so I don't understand \= Any and all help is greatly appreciated.  The mp3 script works by itself but the autoexec won't load it up when I launch xbmc.  Also, how would you add multiple scripts in the auto exec file?  If someone could post their mp3 startup file and a autoexec w/ multiple scripts it would be greatly appreciated.

Auto Execute (f:\xbmc\scripts)


# auto execute scripts when xbmc starts, place this file in xbmchome\scripts\
#
# note: - do not execute more than one script at a time which asks for user input!

# import xbmc

xbmc.executescript ('q:\\scripts\\mp3startup\\mp3start.py')


MP3Startup (f:\xbmc\scripts\mp3startup)

import xbmc

# By alx5962
# version 1.0

file = 'q:\\scripts\\mp3startup\\startup.mp3'
xbmc.Player().play(file)
Logged

Bocaj22

  • Archived User
  • Newbie
  • *
  • Posts: 22
Autoexec
« Reply #1 on: December 18, 2004, 06:50:00 PM »

ive had a problem liike this for a while, the script (autoexec) worked fine until i updated a while ago and it stopped working (SAME EXACT SCRIPT) idunno why.  its supost to start the mp3 script which does work, but . . . yeah
Logged

Kaer

  • Archived User
  • Newbie
  • *
  • Posts: 23
Autoexec
« Reply #2 on: December 18, 2004, 08:26:00 PM »

well never had any problems with the autoplay. here's my version, maybe it might be of some help

autoexec.py:
QUOTE

import xbmc
xbmc.executescript('q:\\scripts\\autoplay.py')


autoplay.py:
import xbmc
QUOTE

file = 'q:\\albums\\playlists\\all.m3u'
pls = xbmc.PlayList(0)
pls.load(file)
pls.shuffle()
xbmc.Player().play(pls)
Logged

kerv

  • Archived User
  • Newbie
  • *
  • Posts: 1
Autoexec
« Reply #3 on: December 23, 2004, 02:39:00 PM »

I did something like this.

Note: I'm a noob at Coding Python, so.. there is probably an easier way of doing something like this.

the autoexec.py file
CODE

import xbmc

xbmc.executescript('q:\\scripts\\start_music.py')


the start_music.py file
CODE

import xbmc, os, string, random, time

random.seed = time.time()

directory = 'q:\\scripts\\mp3\\'
MusicList = []
i = 0

filenames = os.listdir(directory)      

for filename in filenames:
     MusicList.append(directory+filename)
     i = i + 1

i = random.randrange(0, i)

filetoplay = MusicList

xbmc.Player().play(filetoplay)


This post has been edited by kerv: Dec 23 2004, 10:40 PM
Logged

juliecash

  • Archived User
  • Newbie
  • *
  • Posts: 5
Autoexec
« Reply #4 on: December 25, 2004, 10:27:00 PM »

hi frnd
does this really work
have u tried.
sorry I have no python lib installed yet on xbmc to test this.
regards
julie
Logged