OG Xbox Forums > MXM WIP Beta forum

Skin Switcher

(1/3) > >>

flattspott:
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.
;#
;#  
;#      
;#         CallFile $ActualPath$\Scripts\SkinSwitcher\SkinSwitcher.xas
;#      
;#  
;############################################################
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.

This post has been edited by flattspott on Apr 2 2004, 05:41 PM

flattspott:
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

thetruethugg:
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..  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.

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

thetruethugg:
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..

This post has been edited by thetruethugg on Mar 31 2004, 12:05 PM

Navigation

[0] Message Index

[#] Next page

Go to full version