Help - Search - Members - Calendar
Full Version: Colour Pack Randomization For Skin
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official MediaXMenu (MXM) Forum > MXM ActionScripting Forum
ub312g0d
I just made this and havent had a chance to test it out yet, it will include count.txt. that file will start off with just "SET count=0". That will make sense after you have looked it over. Can this be placed directly in my mxm_skin.xml file? also, If I made the skin look for variables( in this case image and colour) and put them as the background img source and the selection colour respectively, would it work? ty guys. Oh ya, the goal is to have the skin switch colours every boot.
CODE

;Colour pack changer
;All code created by ub312g0d

:Begin
;setting colour codes
SET red "E70000"
SET purple "C000E7"
SET orange "DC8000"
SET green "17EB00"
SET blue "007ADF"
SET aqua "00CDCE"
SET yellow "F0F100"
SET colour="E70000"

;open and writing counter to an external file to keep after reboot
OPENREAD count C:/skins/Crystal/count.txt
READFILELN count
OPENWRITE count C:/skins/Crystal/count.txt
ADD counter 1
WRITEFILE count %counter%
CLOSEFILE count

;checking counter
IF counter=1 goto cred
IF counter=2 goto cpurple
IF counter=3 goto corange
IF counter=4 goto cgreen
IF counter=5 goto cblue
IF counter=6 goto caqua
IF counter=7 goto cyellow
IF counter=8 goto reset

;setting proper colours as per the if statement
:cred
colour=%red%
SET image="red"
quit

:cpurple
colour=%purple%
SET image="purple"
quit

:corange
colour=%orange%
SET image="orange"
quit

:cgreen
colour=%green%
SET image="green"
quit

:cblue
colour=%blue%
SET image="blue"
quit

:caqua
colour=%aqua%
SET image="aqua"
quit

:cyellow
colour=%yellow%
SET image="yellow"
quit

:reset
OPENREAD count C:/skins/Crystal/count.txt
READFILELN count
OPENWRITE count C:/skins/Crystal/count.txt
set counter=0
WRITEFILE count %counter%
CLOSEFILE count
goto begin

quit
STARKES
If i wasnt so busy with your sister i would help you out dude. congrats on the skin though.
BenJeremy
Well, I plan on adding a lot of options for running scripts in MXM. Tying them to skins was one thing I wanted to do...

As I firm up the "Plug-n-play" standard, I'll impliment it into the "WIP"
ub312g0d
so no then I'll assume? Cuz that sucks hardcore, This would have made the script much more ub312, randomization comming soon too? cuz in that case I'll have to overhaul the code as well, but it would be shorter, and self contained. Damn, soo many features I cant play with without a wip.
BenJeremy
QUOTE (ub312g0d @ Jan 11 2004, 10:07 PM)
so no then I'll assume? Cuz that sucks hardcore, This would have made the script much more ub312, randomization comming soon too? cuz in that case I'll have to overhaul the code as well, but it would be shorter, and self contained. Damn, soo many features I cant play with without a wip.

??

Plug-n-play isn't in yet, but I've been writing the white paper for it, to firm up a good standard before implementing it.

As for "WIP" - erm, I thought you were already aboard.
geniusalz
Random resources is in already dry.gif
It selects randomly from a list of files.
geniusalz
QUOTE (STARKES @ Jan 11 2004, 10:46 PM)
If i wasnt so busy with your sister i would help you out dude. congrats on the skin though.

blink.gif
?
ub312g0d
lol, inside jokes, he's one of my friends irl. I also want the text to change colour at the same thime though. Is this still possible, as per the reason I made this script for real, I just put the other stuff for the images in after I finished it.
geniusalz
You don't need any = signs in SET.
And I don't think text colors can be set through scripts.

You can, however, keep a bunch of skin xml files and keep changing them through a script.
ub312g0d
that sounds cool...how exactly would I integrate that?
geniusalz
I could do that, but it wouldn't be overly useful without autoexec addons defined through skins (listening bj?) wink.gif

Nothing too fancy, just an autoexec script node in the skin xml that will 'append' (as discussed before) to the global autoexec script.
ub312g0d
ok, but if the image was changed randomly, woujld it still be possible to know what is and match the colour with this method? It sounds like you want to force the autoexec.xml to rename files in the skin so that only 1 at a time is mxm_skin.xml.
geniusalz
It's not possible to find out, but you can do this:

At startup, rename a random xml to MXM_skin.xml, and rename the corresponding image.

Using random resource only works if you only want random pics
ub312g0d
ok now that I know what I want to do.. how exactly would I go about it? And If I added code to the autoexec, wouldnt it be stuck there even if a user wanted to remove the skin? Would that create an error afterwards?
geniusalz
That's why I suggested each skin have an autoexec script tag, so it removes itself with the skin.

Here's the code (not perfect syntax tho)
Assuming you have 5 xml's/pics


CODE

SET num $rand$
MOD num 5
ADD num 1
DELETE pathmxm_skin.xml
DELETE pathmxm_skin.xml
COPY pathmxm_skin%num%.xml pathmxm_skin.xml


Same for pics. This way it's gonna put a random one each time you run the skin.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.