Jump to content


Photo

Skin Switcher


  • Please log in to reply
13 replies to this topic

#1 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 March 2004 - 12:57 AM

A sort of skin randomizer. Although it isn't really random, you'll never use the same skin twice before you use every other skin you have.

Update: Skin Switcher 0.2
- Made the script completly automated
- Fixed small typo in info part of script
- Added a Results MsgBox that automatically goes away after 2 seconds
- Changed RandSkin.xml to skinlist.xml
- Change the save path for the skinlist.xml to E:\UDATA\00004321\skinlist.xml

Save As - SkinSwitcher.xas
CODE

;###########################################################
;# Name: Skin Switcher
;# Author: flattspott
;# Date: 03-29-2004
;# Version: 0.2
;# FileName: SkinSwitcher.xas
;#
;# Disclaimer:
;#  This is a WIP script only (Tested and made with the 1191 Build)
;#
;# Purpose:
;#  Will create a list of all your skins (not the internal ones) and step though the list
;#  on bootup each time, setting your skin to the next one in the list
;#
;# Installation:
;#  Upload SkinSwitcher.xas file to your Xbox,(into your scripts folder)
;#  then add something like this somewhere in your MXM.xml.
;#  $ActualPath$ is where MXM starts from.
;#  Also note that below I have the xas file inside a subfolder from the main scripts folder
;#  This is a personal preference, change it if need be.
;#
;#   <scripts>
;#      <ActionScript Name="_AutoExec">
;#         CallFile $ActualPath$\Scripts\SkinSwitcher\SkinSwitcher.xas
;#      </ActionScript>
;#   </Scripts>
;############################################################
Set Temp 0
Set SkinList E:\UDATA\00004321\skinlist.xml

:LookUp
XMLOpen SomeXML ::MXM
XMLGetValue SomeXML spName !.Main^SkinsPath
SetFunc sPath FileExists %spName%
If# %sPath% == 0 Goto Error
If# %sPath% == 1 Goto Begin

:Begin
SetFunc Used FileExists %SkinList%
If# %Used% == 0 Goto New
If# %Used% == 1 Goto Old

:New
XMLCreate RandomXML Main
XMLSetValue RandomXML !.Status^LastSkin "0"
Goto Search

:Old
XMLOpen RandomXML %SkinList%
XMLGetValue RandomXML Current !.Status^LastSkin
Add Current 1
XMLClose RandonXML
XMLCreate RandomXML Main
XMLSetValue RandomXML !.Status^LastSkin "%Current%"
Goto Search

:Search
BeginSearch %spName%\*
:StartSearch
SEARCHTYPE s_type
SEARCHITEM s_name

IF "%s_name%" == "" Goto DoneSearch
IF %s_type% == "dir" Goto ListSkin
IF %s_type% == "file" Goto SearchContinue

:SEARCHCONTINUE
SEARCHNEXT
GOTO STARTSEARCH

:ListSkin
SetFunc SkinName Replace %spName% "" %search_name%
XMLSetValue RandomXML !.Skins.Skin:%Temp%~Name "%SkinName%"
Add Temp 1
Goto SearchContinue

:DoneSearch
ENDSEARCH
Goto Finish

:Error
MsgBox "Skin Switcher can't find:$eol$%spName%$eol$Please make sure it exists" 0 3500
Goto End

:Finish
XMLSetNodePtr RandomXML !.Skins
XMLGetNodeCount RandomXML Count
If %Current% == %Count% Goto New
XMLGetValue RandomXML NextSkin !.Skins.Skin:%Current%~Name
XMLOpen SkinXML %spName%\%NextSkin%\MXM_Skin.xml
XMLGetValue SkinXML RealName !~name
XMLClose SkinXML
XMLOpen PrefXML  ::Prefs
XMLSetValue PrefXML !.UserSetting^Skin "%RealName%"
XMLSave PrefXML  ::Prefs
MsgBox "When you reboot your skin will be$eol$%RealName%" 0 2000
XMLSave RandomXML %SkinList%
XMLClose RandomXML
XMLClose SomeXML
XMLClose PrefXML

:End
Quit


Post comments or bugs here.

Edited by flattspott, 02 April 2004 - 03:41 PM.


#2 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 March 2004 - 08:05 PM

Also, in case you're wondering. The reason I open and close the existing xml, and then create it again is this.

First I have to get the old skin, then I have to rescans your skins incase you add some new ones since the last time.

Like I said, in case anyone was wondering

#3 thetruethugg

thetruethugg

    X-S Expert

  • Members
  • PipPipPip
  • 638 posts
  • Xbox Version:v1.0

Posted 30 March 2004 - 09:11 PM

I was about to say "Bitch, it doesn't work", then I relized I was an idiot and never copied the new MXM.xml file over.. biggrin.gif But, now, it seems to work great, haven't added a new skin yet, and I turned on the notification for next skin just to make sure everything was in working order. I see no noticable bugs thus far.

#4 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 March 2004 - 10:23 PM

Well I try to test the hell out of my scripts before I post them, I didn't find any bugs yet.



#5 thetruethugg

thetruethugg

    X-S Expert

  • Members
  • PipPipPip
  • 638 posts
  • Xbox Version:v1.0

Posted 31 March 2004 - 09:20 AM

Actually, I found a bug.. It got "stuck" on the "Advantage" skin. It loaded the skin prior to it fine (at least 2 skins before advantage), then loaded advantage and said it will be loaded next. So, I reboot, it loads advantage, and says it's going to do it again. At this point, I've manually selected the next skin (bluespek), apply, MXM restarts using bluespek, but says it's going to load advantage next time (again)..

I'll mess around with it before I go to bed (Came to the come because I thought my internet connection crapped out again, fucking done that shit like 20 times, literally in the last 3-4 days). I'll see if it always wants to load advantage, or if it moves on and get's stuck again.

Also, one suggestion would be, have the 'Will load blah skin next time' go away after awhile (like the MXM wip, don't distro message).

Update: Ok, getting stuck regardless of skin. I deleted advantage to see if would do the same on the next skin, and it does. So, either I'm an idiot and don't know what I'm talking about with this 'prior to advantage' crap (I wont rule this out), but I could swear that I saw it change a skin or two before then.. No workie, using latest MXM WIP build..

Edited by thetruethugg, 31 March 2004 - 10:05 AM.


#6 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 March 2004 - 02:25 PM

hm, i dunno what could be happening, did you change the script at all? (Other then the Message Box)

Try to take a look at the RandSkin.xml wherever you have it. You could also try to delete it and see if that helps.

Im gonna go get that skin and see if it happens for me

#7 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 March 2004 - 03:06 PM

Well I went and got the skin, also went and reboott my xbox 25 times (25 skins) and it didn't happend to me. Check that skin dir for any noticable errors.

And I made it so the MsgBox Goes away after 2 secs

MsgBox "When you reboot your skin will be$eol$%RealName%" 0 2000

#8 thetruethugg

thetruethugg

    X-S Expert

  • Members
  • PipPipPip
  • 638 posts
  • Xbox Version:v1.0

Posted 31 March 2004 - 10:38 PM

Allright, I'll try the new script, and deleting the randskin.xml file aswell..

#9 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 01 April 2004 - 02:20 AM

Another thing, I tested this quite a few times with skins I already had installed, as well as after installing several new ones.

#10 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 01 April 2004 - 02:48 AM

Sweet indeed. Could be a plugin too. But I guess all the skin selection stuff will be revamped.

#11 thetruethugg

thetruethugg

    X-S Expert

  • Members
  • PipPipPip
  • 638 posts
  • Xbox Version:v1.0

Posted 01 April 2004 - 06:47 AM

I do not seem to have a RandSkin.xml anywhere. That must've been the problem, as for why it was never created, I don't know. Oh well. Will test with the new script.

#12 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 01 April 2004 - 01:57 PM

If you installed the script exactly like i have in the script as it is here

you should see the file @

$ActualPath$\Scripts\SkinSwitcher\RandSkin.xml

Unless you changed it that.

#13 thetruethugg

thetruethugg

    X-S Expert

  • Members
  • PipPipPip
  • 638 posts
  • Xbox Version:v1.0

Posted 01 April 2004 - 11:54 PM

Yes I know the path, I looked there, and the file wasn't there.

But, It now seems to work, after changing the path, the 'old' path was a nonexistent directory, after changing it to my actions directory, it works.. So, perhaps a mkdir command first, or telling the user to change the path to a real directory (for those that don't use 'scripts' and a subdir for each script [or at least skinswitcher])..

#14 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 02 April 2004 - 12:42 AM

Well there you go, however the info part of the script says that you should chage it if you don't have it set up like so.


Anywho, I think when I update it later, I'll put the randskin.xml on E: with the pref.xml




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users