xboxscene.org forums

Author Topic: Skin Switcher  (Read 2053 times)

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« on: March 29, 2004, 06:57:00 PM »

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
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #1 on: March 30, 2004, 02:05:00 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
Logged

thetruethugg

  • Archived User
  • Sr. Member
  • *
  • Posts: 432
Skin Switcher
« Reply #2 on: March 30, 2004, 01:11:00 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.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #3 on: March 30, 2004, 04:23:00 PM »

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

Logged

thetruethugg

  • Archived User
  • Sr. Member
  • *
  • Posts: 432
Skin Switcher
« Reply #4 on: March 31, 2004, 03:20:00 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..

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

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #5 on: March 31, 2004, 08:25:00 AM »

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
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #6 on: March 31, 2004, 09:06:00 AM »

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
Logged

thetruethugg

  • Archived User
  • Sr. Member
  • *
  • Posts: 432
Skin Switcher
« Reply #7 on: March 31, 2004, 03:49:00 PM »

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

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #8 on: March 31, 2004, 07:31:00 PM »

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

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Skin Switcher
« Reply #9 on: March 31, 2004, 07:59:00 PM »

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

thetruethugg

  • Archived User
  • Sr. Member
  • *
  • Posts: 432
Skin Switcher
« Reply #10 on: March 31, 2004, 11:58:00 PM »

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.  <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #11 on: April 01, 2004, 07:57:00 AM »

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.
Logged

thetruethugg

  • Archived User
  • Sr. Member
  • *
  • Posts: 432
Skin Switcher
« Reply #12 on: April 01, 2004, 05:54:00 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])..
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Skin Switcher
« Reply #13 on: April 01, 2004, 06:42:00 PM »

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
Logged