Jump to content


Photo

ActionScripting Questions


  • Please log in to reply
68 replies to this topic

#1 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 15 October 2003 - 04:48 PM

Just cranking up a new thread. Ask questions, and I'll try and clarify.

Ask here about the clinic posts, as well... since that thread is locked.

#2 DBZRacer

DBZRacer

    X-S Expert

  • Members
  • PipPipPip
  • 620 posts
  • Xbox Version:v1.1

Posted 15 October 2003 - 08:53 PM

Also another request... Is there a way to have MXM pick up action scripts in the menu automatically like in the autodirs? Of course we would have to standardize a heading to give descriptions and whatnot like a make shift xbe id. but i think it would be beneficial for other users to be able to just drop a predefined action script in an action script subfolder and have mxm autoconfig to launch it. Barring that there arent any additional extensions needed...

#3 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 15 October 2003 - 10:32 PM

ok, having problems with text color.

1. can i change the text color of a variable in a msgbox without using coordinate?

2. im a dumbass..can you provide an example..i cant get it to do it.






#4 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 15 October 2003 - 10:37 PM

QUOTE (koldfuzion @ Oct 15 2003, 07:32 PM)
ok, having problems with text color.

1. can i change the text color of a variable in a msgbox without using coordinate?

2. im a dumbass..can you provide an example..i cant get it to do it.

Sorry, messageboxes only suport a single standard color.

I wanted to do something more complex, but it's just not easy to do.

#5 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 15 October 2003 - 11:43 PM

ok no problem. I'm still a dumbass. smile.gif


got the ip portion of th new user script "semi-complete" as far as the UI goes... would like others to look at it though to see if it could be done in a more efficient way

thats what i was wanting the coloring for, to simulate a "cursor" so ppl didnt get lost editing the IP address.


How can i do it like in the system menu? or is that possible from actionscript?

Edited by koldfuzion, 15 October 2003 - 11:45 PM.


#6 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 15 October 2003 - 11:53 PM

QUOTE (koldfuzion @ Oct 15 2003, 08:43 PM)
ok no problem. I'm still a dumbass. smile.gif


got the ip portion of th new user script "semi-complete" as far as the UI goes... would like others to look at it though to see if it could be done in a more efficient way

thats what i was wanting the coloring for, to simulate a "cursor" so ppl didnt get lost editing the IP address.


How can i do it like in the system menu? or is that possible from actionscript?

I was thinking of just throwing up four boxes, with each part of the number... Left/Right to change boxes (focus indicated by box drawn behind it, larger, different colors) and up/down to change each section's number.

You could also set the color of the "focused" box's text, too...

As for menus, since I'm not changing the system font, you should be able to set up standard positioning to simulate menu action, as well...

#7 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 15 October 2003 - 11:56 PM

hrmm.. might need to go back. its a little weird but this is what we have so far. (works ok)


QUOTE

;##############################
;# Script: MXM Setup Script
;# Authors: DBZRacer, KoldFuzion
;# Date: 10-15-2003
;# Version: .001
;# Purpose: To allow for actionscript setup of MXM.XML
;##############################


;################ DEFINE VARIABLES  ################
;#              192.168.001.003 ; default IP for new setup?
SET IP1 "1"    ;1xx.xxx.xxx.xxx
SET IP2 "9"    ;x9x.xxx.xxx.xxx
SET IP3 "2"    ;xx2.xxx.xxx.xxx
SET IP4 "1"    ;xxx.1xx.xxx.xxx
SET IP5 "6"    ;xxx.x6x.xxx.xxx
SET IP6 "8"    ;xxx.xx8.xxx.xxx
SET IP7 "0"    ;xxx.xxx.0xx.xxx
SET IP8 "0"    ;xxx.xxx.x0x.xxx
SET IP9 "1"    ;xxx.xxx.xx1.xxx
SET IP10 "0"    ;xxx.xxx.xxx.0xx
SET IP11 "0"    ;xxx.xxx.xxx.x0x
SET IP12 "3"    ;xxx.xxx.xxx.xx3
SET CIP "1"  ;used to place cursor
SET NEWIP "192.168.001.003"
SET IPBOXLEFT 145


;################ DEFINE FUNCTIONS  ################



;################ SCRIPT FLOW LOGIC  ################

:SKINPATH
  BeginDraw UseCurrent
    MessageBox "A To Change IP$eol$X to Quit"
  EndDraw
  Input
    If %_GP_A% == "1" GOTO IP
    If %_GP_X% == "1" GOTO IQUIT
  QUIT





;################ START IP  ################
:IP
  BeginDraw UseCurrent
    MessageBox "Use Thumbpad LEFT-RIGHT to move cursor$eol$Thumbpad UP-DOWN to change values$eol$$eol$IP:

%IP1%%IP2%%IP3%.%IP4%%IP5%%IP6%.%IP7%%IP8%%IP9%.%IP10%%IP11%%IP12%$eol$$eol$A to Continue.$eol$X to Quit$eol$B

to Go Back$eol$Y To Reset IP"
Box %IPBOXLEFT% 202 14 21 0x7000FF00 0x00FFFFFF
  EndDraw
  Input
    If %_GP_D_UP% == "1" GOTO IPUP
    If %_GP_D_DN% == "1" GOTO IPDN
    If %_GP_D_RT% == "1" GOTO IPNEXT
    If %_GP_D_LF% == "1" GOTO IPPREV
    If %_GP_A% == "1" GOTO SAVEIP
    If %_GP_B% == "1" GOTO SKINPATH
    If %_GP_X% == "1" GOTO IQUIT
    If %_GP_Y% == "1" GOTO REDEFINEIP
  Quit

:IPUP ;Up was pushed, increase number by upper adjustment
ADD IP%CIP% 1
IF %IP1% == 3 GOTO ADJ1Upper
IF %IP2% == 10 GOTO ADJ2Upper
IF %IP3% == 10 GOTO ADJ2Upper
IF %IP4% == 3 GOTO ADJ1Upper
IF %IP5% == 10 GOTO ADJ2Upper
IF %IP6% == 10 GOTO ADJ2Upper
IF %IP7% == 3 GOTO ADJ1Upper
IF %IP8% == 10 GOTO ADJ2Upper
IF %IP9% == 10 GOTO ADJ2Upper
IF %IP10% == 3 GOTO ADJ1Upper
IF %IP11% == 10 GOTO ADJ2Upper
IF %IP12% == 10 GOTO ADJ2Upper
GOTO IP

:IPBOXLEFT0 ; 1st digit cursor
SET IPBOXLEFT 147
GOTO IP

:IPBOXLEFT1 ; 1st digit cursor
SET IPBOXLEFT 147
GOTO IP

:IPBOXLEFT2 ; 2nd digit cursor
SET IPBOXLEFT 158
GOTO IP

:IPBOXLEFT3 ; 3rd digit cursor
SET IPBOXLEFT 171
GOTO IP

:IPBOXLEFT4 ; 4rd digit cursor
SET IPBOXLEFT 187
GOTO IP

:IPBOXLEFT5 ; 5rd digit cursor
SET IPBOXLEFT 200
GOTO IP

:IPBOXLEFT6 ; 6rd digit cursor
SET IPBOXLEFT 213
GOTO IP

:IPBOXLEFT7 ; 7rd digit cursor
SET IPBOXLEFT 229
GOTO IP

:IPBOXLEFT8 ; 8rd digit cursor
SET IPBOXLEFT 243
GOTO IP

:IPBOXLEFT9 ; 9rd digit cursor
SET IPBOXLEFT 257
GOTO IP

:IPBOXLEFT10 ; 10rd digit cursor
SET IPBOXLEFT 272
GOTO IP

:IPBOXLEFT11 ; 11rd digit cursor
SET IPBOXLEFT 285
GOTO IP

:IPBOXLEFT12 ; 12rd digit cursor
SET IPBOXLEFT 298
GOTO IP

:IPBOXLEFT13 ; 13rd digit cursor
SET IPBOXLEFT 298
GOTO IP

:IPDN ;Down was pushed, decrease number by lower adjustment
SUB IP%CIP% 1
IF %IP1% == -1 GOTO ADJ1Lower
IF %IP2% == -1 GOTO ADJ1Lower
IF %IP3% == -1 GOTO ADJ1Lower
IF %IP4% == -1 GOTO ADJ1Lower
IF %IP5% == -1 GOTO ADJ1Lower
IF %IP6% == -1 GOTO ADJ1Lower
IF %IP7% == -1 GOTO ADJ1Lower
IF %IP8% == -1 GOTO ADJ1Lower
IF %IP9% == -1 GOTO ADJ1Lower
IF %IP10% == -1 GOTO ADJ1Lower
IF %IP11% == -1 GOTO ADJ1Lower
IF %IP12% == -1 GOTO ADJ1Lower
GOTO IP

:IPNEXT ;shift right to next number
ADD CIP 1
IF %CIP% == 13 GOTO ADJRIGHT
GOTO IPBOXLEFT%CIP%
GOTO IP

:IPPREV ;shift left to previous number
SUB CIP 1
IF %CIP% == 0 GOTO ADJLEFT
GOTO IPBOXLEFT%CIP%
GOTO IP

:ADJLEFT ;dont allow to go below 1 LEFT
SET CIP 1
GOTO IPBOXLEFT%CIP%
GOTO IP

:ADJRIGHT ;dont allow MORE THAN 12 TO RIGHT
SET CIP 12
GOTO IPBOXLEFT%CIP%
GOTO IP


:ADJ1Lower ;dont allow negative numbers
SET IP%CIP% 0
GOTO IP

:ADJ1Upper ;Upper limit for first digit in group
SET IP%CIP% 2
GOTO IP

:ADJ2Upper ;upper limit for second and third digit in group
SET IP%CIP% 9
GOTO IP

:SAVEIP
SET NEWIP "%IP1%%IP2%%IP3%.%IP4%%IP5%%IP6%.%IP7%%IP8%%IP9%.%IP10%%IP11%%IP12%"
messagebox "%NEWIP%
Quit

:REDEFINEIP
SET IP1 "1"    ;1xx.xxx.xxx.xxx
SET IP2 "9"    ;x9x.xxx.xxx.xxx
SET IP3 "2"    ;xx2.xxx.xxx.xxx
SET IP4 "1"    ;xxx.1xx.xxx.xxx
SET IP5 "6"    ;xxx.x6x.xxx.xxx
SET IP6 "8"    ;xxx.xx8.xxx.xxx
SET IP7 "0"    ;xxx.xxx.0xx.xxx
SET IP8 "0"    ;xxx.xxx.x0x.xxx
SET IP9 "1"    ;xxx.xxx.xx1.xxx
SET IP10 "0"    ;xxx.xxx.xxx.0xx
SET IP11 "0"    ;xxx.xxx.xxx.x0x
SET IP12 "3"    ;xxx.xxx.xxx.xx3
SET CIP "1"  ;used to place cursor
SET NEWIP "192.168.001.003"
GOTO IP

:IQUIT
Quit
;################ End IP  ################






;############################ TO DO LIST ####################
;####  Main  ######
; -DiscTitle
; -DiscSubTitle
; -SkinPath

;####  Network  ######
; -IP
; -Subnet
; -Gateway
; -DNS1
; -DNS2


;####  FTPServer  ######
; -ServerPort
; -username
; -password
; -port
; -allow anonymouse
; -anon root

;####  Preferences  ######
; -Nickname
; -Timeserver IP
; -DVDPlayer
; -DeepMultiSearch (true false)

;####  Music  ######
; -UseMusic True
; -Global True
; -Random True


;####  NewsFeed
; -X-S Add
; -X-S Remove





Edited by koldfuzion, 16 October 2003 - 02:08 AM.


#8 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 16 October 2003 - 12:00 AM

maybe once we put the actual "text" in for what the IP setting box will say..

we could just use a transparent box with a border outline over top the ip to show the cursor? or will the box appear behing the messagebox? hrmm.. maybe the messageboxs need to be semi-transparent to facilitate this.

Edited by koldfuzion, 16 October 2003 - 12:01 AM.


#9 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 16 October 2003 - 12:08 AM

QUOTE (koldfuzion @ Oct 15 2003, 09:00 PM)
maybe once we put the actual "text" in for what the IP setting box will say..

we could just use a transparent box with a border outline over top the ip to show the cursor? or will the box appear behing the messagebox? hrmm.. maybe the messageboxs need to be semi-transparent to facilitate this.

Drawing is done in the order you specify... just like skin layouts. You could use a transparent color (color parms now accept 0xFFFFFFFF notation, as well as named colors).



:::phew::: just switched machines here in my lair. The new box, a 2.6Ghz 800mhz FSB P4, is beefier than the old box, but I had installed new VS.NET and the latest XDK - and MXM was hosing badly. So I spent the evening here unhosing the code due to a bizarre difference in the STL libraries of VS.NET 2003 and the old VS.NET (for some reason, the NEWER implementation REMOVED functionality from the standard string classes)

#10 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 16 October 2003 - 12:23 AM

QUOTE
Drawing is done in the order you specify... just like skin layouts. You could use a transparent color (color parms now accept 0xFFFFFFFF notation, as well as named colors).


yea i read that in the txt file.. after doing skins i should have known better than to ask.

QUOTE
the NEWER implementation REMOVED functionality from the standard string classes


how bad will that affect mxm?


#11 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 16 October 2003 - 01:05 AM

QUOTE (koldfuzion @ Oct 15 2003, 09:23 PM)
QUOTE
Drawing is done in the order you specify... just like skin layouts. You could use a transparent color (color parms now accept 0xFFFFFFFF notation, as well as named colors).


yea i read that in the txt file.. after doing skins i should have known better than to ask.

QUOTE
the NEWER implementation REMOVED functionality from the standard string classes


how bad will that affect mxm?

Well, it shouldn't affect it, but it entailed me changing a bunch of "shortcut" code that used notation like:

sReturn = _T(".") + sReturn;

Which would tack the period on to the beginning of whatever sReturn was (these are text strings) - but the latest STL implementations from M$ seem to have removed the magic function that allowed me to add two strings together like that. Now I have to use:

sReturn.Format( _T(".%s"), sReturn.c_str() );

Which does the same thing.... oddly, though:

sReturn = sReturn + _T(".") ;

CAN be turned into:

sReturn += _T(".");

which is even more of a "shortcut" - yet it works. Actually, in retrospect, it might be that the implementation for the above shortcut worked before, but not now, perhaps due to some subtle change in the way the compiler is generating the appropriate C++ function calls (those lines are translated into some basic function calls)

At any rate, I'm adding a timer "special" - expect another update in an hour or so.


#12 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 16 October 2003 - 02:12 AM

I updated the previous post with the script.

Now it protects against moving too far left or right.. and uses a green shade over the current selected number in the IP.


Actually.. the current script could be used with a little of the new xml to enable IP changing in XML. If someone wants to do that (I hope so, or I will have to) then feel free to grab the script and modify etc.


#13 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 16 October 2003 - 03:06 AM

BJ, I've tried everything to get the MID string function to work... any help

SETFUNC MY3IP MID 3 1 "Freedy"

Actually, I cant get LEFT, MID and RIGHT too work.

TRIMLEFT, TRIMRIGHT, LEN, TRIM all work fine.

DBZRacer and I will release the IP part of this script to set your IP and update your mxm.xml (then reboot). DBZ is finishing up the xml stuff right now.

Please note: it will always start with a default IP address until I can break down the current ip into individual numbers, but its better than nothing.

Edited by koldfuzion, 16 October 2003 - 05:14 AM.


#14 DBZRacer

DBZRacer

    X-S Expert

  • Members
  • PipPipPip
  • 620 posts
  • Xbox Version:v1.1

Posted 16 October 2003 - 07:29 AM

Hey BJ, here's the update on the script KF and I are working on. I got as far as getting the write commands for the mxm.xml file done tonight just to make sure everything works right. I'll change the statics to real variables later and KF and I will work on the rest of the inputs/selections.

CODE


;##############################
;# Script: MXM Setup Script
;# Authors: DBZRacer, KoldFuzion
;# Date: 10-15-2003
;# Version: .001
;# Purpose: To allow for actionscript setup of MXM.XML
;##############################


;################ DEFINE VARIABLES  ################
;#               192.168.001.003; default IP for new setup?
SET IP1 "1"    ;1xx.xxx.xxx.xxx
SET IP2 "9"    ;x9x.xxx.xxx.xxx
SET IP3 "2"    ;xx2.xxx.xxx.xxx
SET IP4 "1"    ;xxx.1xx.xxx.xxx
SET IP5 "6"    ;xxx.x6x.xxx.xxx
SET IP6 "8"    ;xxx.xx8.xxx.xxx
SET IP7 "0"    ;xxx.xxx.0xx.xxx
SET IP8 "0"    ;xxx.xxx.x0x.xxx
SET IP9 "1"    ;xxx.xxx.xx1.xxx
SET IP10 "0"   ;xxx.xxx.xxx.0xx
SET IP11 "0"   ;xxx.xxx.xxx.x0x
SET IP12 "3"   ;xxx.xxx.xxx.xx3
SET CIP "1" ;used to place cursor
SET NEWIP "192.168.001.003"
SET IPBOXLEFT 145

;################ DEFINE FUNCTIONS  ################


;################ Temp to see DBZRacers Script  ################


:START
 BeginDraw UseCurrent
   MessageBox "Press A to Run KoldFuzions IP nput Script$eol$Press B to Run DBZRacers XMLWRite Script"
 EndDraw
 Input
   If %_GP_A% == "1" GOTO SKINPATH
   If %_GP_B% == "1" GOTO XMLWRITESTART
Quit



;################ SCRIPT FLOW LOGIC  ################

:SKINPATH
SETFUNC SKINDIR FileExists c:\MXMskins
IF# %SKINDIR% == 0 GOTO MAKEDIRS
IF# %SKINDIR% == 1 GOTO IP

:MAKEDIRS
 BeginDraw UseCurrent
   MessageBox "A MXM Skin directory does not exist! (c:\\mxmskins)$eol$$eol$ A to Create$eol$X to Skip"
 EndDraw
 Input
   If %_GP_A% == "1" GOTO CREATESKINDIR
   If %_GP_X% == "1" GOTO IP
Quit

:CREATESKINDIR
MkDir c:\mxmskins
 BeginDraw UseCurrent
   MessageBox "c:\mxmskins directory has been created.$eol$$eol$Place your skin files in this directory."
 EndDraw
delay 5
GOTO IP
QUIT


;################ START IP  ################
:IP
 BeginDraw UseCurrent
   MessageBox "Use Thumbpad LEFT-RIGHT to move cursor$eol$Thumbpad UP-DOWN to change values$eol$$eol$IP:

%IP1%%IP2%%IP3%.%IP4%%IP5%%IP6%.%IP7%%IP8%%IP9%.%IP10%%IP11%%IP12%$eol$$eol$A to Continue.$eol$X to Quit$eol$B to Go

Back$eol$Y To Reset IP"
Box %IPBOXLEFT% 202 14 21 0x7000FF00 0x00FFFFFF
 EndDraw
 Input
   If %_GP_D_UP% == "1" GOTO IPUP
   If %_GP_D_DN% == "1" GOTO IPDN
   If %_GP_D_RT% == "1" GOTO IPNEXT
   If %_GP_D_LF% == "1" GOTO IPPREV
   If %_GP_A% == "1" GOTO SAVEIP
   If %_GP_B% == "1" GOTO SKINPATH
   If %_GP_X% == "1" GOTO IQUIT
   If %_GP_Y% == "1" GOTO REDEFINEIP
 Quit

:IPUP;Up was pushed, increase number by upper adjustment
ADD IP%CIP% 1
IF %IP1% == 3 GOTO ADJ1Upper
IF %IP2% == 10 GOTO ADJ2Upper
IF %IP3% == 10 GOTO ADJ2Upper
IF %IP4% == 3 GOTO ADJ1Upper
IF %IP5% == 10 GOTO ADJ2Upper
IF %IP6% == 10 GOTO ADJ2Upper
IF %IP7% == 3 GOTO ADJ1Upper
IF %IP8% == 10 GOTO ADJ2Upper
IF %IP9% == 10 GOTO ADJ2Upper
IF %IP10% == 3 GOTO ADJ1Upper
IF %IP11% == 10 GOTO ADJ2Upper
IF %IP12% == 10 GOTO ADJ2Upper
GOTO IP

:IPBOXLEFT0; 1st digit cursor
SET IPBOXLEFT 147
GOTO IP

:IPBOXLEFT1; 1st digit cursor
SET IPBOXLEFT 147
GOTO IP

:IPBOXLEFT2; 2nd digit cursor
SET IPBOXLEFT 158
GOTO IP

:IPBOXLEFT3; 3rd digit cursor
SET IPBOXLEFT 171
GOTO IP

:IPBOXLEFT4; 4rd digit cursor
SET IPBOXLEFT 187
GOTO IP

:IPBOXLEFT5; 5rd digit cursor
SET IPBOXLEFT 200
GOTO IP

:IPBOXLEFT6; 6rd digit cursor
SET IPBOXLEFT 213
GOTO IP

:IPBOXLEFT7; 7rd digit cursor
SET IPBOXLEFT 229
GOTO IP

:IPBOXLEFT8; 8rd digit cursor
SET IPBOXLEFT 243
GOTO IP

:IPBOXLEFT9; 9rd digit cursor
SET IPBOXLEFT 257
GOTO IP

:IPBOXLEFT10; 10rd digit cursor
SET IPBOXLEFT 272
GOTO IP

:IPBOXLEFT11; 11rd digit cursor
SET IPBOXLEFT 285
GOTO IP

:IPBOXLEFT12; 12rd digit cursor
SET IPBOXLEFT 298
GOTO IP

:IPBOXLEFT13; 13rd digit cursor
SET IPBOXLEFT 298
GOTO IP

:IPDN;Down was pushed, decrease number by lower adjustment
SUB IP%CIP% 1
IF %IP1% == -1 GOTO ADJ1Lower
IF %IP2% == -1 GOTO ADJ1Lower
IF %IP3% == -1 GOTO ADJ1Lower
IF %IP4% == -1 GOTO ADJ1Lower
IF %IP5% == -1 GOTO ADJ1Lower
IF %IP6% == -1 GOTO ADJ1Lower
IF %IP7% == -1 GOTO ADJ1Lower
IF %IP8% == -1 GOTO ADJ1Lower
IF %IP9% == -1 GOTO ADJ1Lower
IF %IP10% == -1 GOTO ADJ1Lower
IF %IP11% == -1 GOTO ADJ1Lower
IF %IP12% == -1 GOTO ADJ1Lower
GOTO IP

:IPNEXT;shift right to next number
ADD CIP 1
IF %CIP% == 13 GOTO ADJRIGHT
GOTO IPBOXLEFT%CIP%
GOTO IP

:IPPREV;shift left to previous number
SUB CIP 1
IF %CIP% == 0 GOTO ADJLEFT
GOTO IPBOXLEFT%CIP%
GOTO IP

:ADJLEFT;dont allow to go below 1 LEFT
SET CIP 1
GOTO IPBOXLEFT%CIP%
GOTO IP

:ADJRIGHT;dont allow MORE THAN 12 TO RIGHT
SET CIP 12
GOTO IPBOXLEFT%CIP%
GOTO IP


:ADJ1Lower;dont allow negative numbers
SET IP%CIP% 0
GOTO IP

:ADJ1Upper;Upper limit for first digit in group
SET IP%CIP% 2
GOTO IP

:ADJ2Upper;upper limit for second and third digit in group
SET IP%CIP% 9
GOTO IP

:SAVEIP
SET NEWIP "%IP1%%IP2%%IP3%.%IP4%%IP5%%IP6%.%IP7%%IP8%%IP9%.%IP10%%IP11%%IP12%"
messagebox "%NEWIP%
Quit

:REDEFINEIP
SET IP1 "1"    ;1xx.xxx.xxx.xxx
SET IP2 "9"    ;x9x.xxx.xxx.xxx
SET IP3 "2"    ;xx2.xxx.xxx.xxx
SET IP4 "1"    ;xxx.1xx.xxx.xxx
SET IP5 "6"    ;xxx.x6x.xxx.xxx
SET IP6 "8"    ;xxx.xx8.xxx.xxx
SET IP7 "0"    ;xxx.xxx.0xx.xxx
SET IP8 "0"    ;xxx.xxx.x0x.xxx
SET IP9 "1"    ;xxx.xxx.xx1.xxx
SET IP10 "0"   ;xxx.xxx.xxx.0xx
SET IP11 "0"   ;xxx.xxx.xxx.x0x
SET IP12 "3"   ;xxx.xxx.xxx.xx3
SET CIP "1" ;used to place cursor
SET NEWIP "192.168.001.003"
GOTO IP

:IQUIT
Quit
;################ End IP  ################






;############################ TO DO LIST ####################

;####   Start XML ######

:XMLWRITESTART

;XML FIle is Named and Created
XMLOPEN NewXML
XMLCreate NewXML CONFIG


;####   Main  ######

BeginDraw UseCurrent
 MessageBox "Begin MAIN"
EndDraw
Delay 1

; -DiscTitle XML Write
XMLSetValue NewXML !.MAIN.DiscTitle MediaXMenu

; -DiscSubTitle XML Write
XMLSetValue NewXML !.MAIN.DiscSubtitle ver9n6

; -SkinPath XML Write
XMLSetValue NewXML !.MAIN.SkinsPath "c:\\MXMSKINS"

; -AllowVideoSound XML Write
XMLSetValue NewXML !.MAIN.AllowVideoSound TRUE

; -RemoveDuplicates XML Write
XMLSetValue NewXML !.MAIN.RemoveDuplicates TRUE

; -RemoveInvalid XML Write
XMLSetValue NewXML !.MAIN.RemoveInvalid TRUE




;####   Network  ######

BeginDraw UseCurrent
 MessageBox "Begin Network"
EndDraw
Delay 1

; -UseDHCP XML Write
XMLSetValue NewXML !.NETWORK.UseDHCP FALSE

; -IP XML Write
XMLSetValue NewXML !.NETWORK.IP 192.168.000.103

; -Gateway XML Write
XMLSetValue NewXML !.NETWORK.DefaultGateway 192.168.000.001

; -Subnet XML Write
XMLSetValue NewXML !.NETWORK.SubnetMask 255255255000

; -DNS1 XML Write
XMLSetValue NewXML !.NETWORK.DNS1 1921680001001

; -DNS2 XML Write
XMLSetValue NewXML !.NETWORK.DNS2 1921680001001



;####   FTPServer  ######

BeginDraw UseCurrent
 MessageBox "Begin FTPServer"
EndDraw
Delay 1

; -allow anonymous XML Write
XMLSetValue NewXML !.FTPServer.AllowAnon FALSE

; -ServerPort XML Write
XMLSetValue NewXML !.FTPServer.ServerPort BLAH

; -username XML Write
XMLSetValue NewXML !.FTPServer.User.Name xbox

; -password XML Write
XMLSetValue NewXML !.FTPServer.User.Password xbox


;####   Preferences  ######

BeginDraw UseCurrent
 MessageBox "Begin Preferences"
EndDraw
Delay 1


; -Nickname XML Write
XMLSetValue NewXML !.Preferences.Nickname MXM

; -Timeserver IP XML Write
XMLSetValue NewXML !.Preferences.TimeServerIP 192.168.0.100

; -SynchronizeClock XML Write
XMLSetValue NewXML !.Preferences.SynchronizeClock FALSE

; -FTPPriority XML Write
XMLSetValue NewXML !.Preferences.FTPPriority Highest

; -DVDPlayer XML Write
XMLSetValue NewXML !.Preferences.DVDPlayer DVDPlayerPath

; -DeepMultiSearch XML Write
XMLSetValue NewXML !.Preferences.DeepMultiSearch TRUE

; -AutoLaunchGame XML Write
XMLSetValue NewXML !.Preferences.AutoLaunchGame FALSE

; -AutoLaunchMovie XML Write
XMLSetValue NewXML !.Preferences.AutoLaunchMovie FALSE

; -AutoLoadMulti XML Write
XMLSetValue NewXML !.Preferences.AutoLoadMulti FALSE



;####   Music  ######

; *** DO WE REALLY NEED THIS NODE IN THE MXM.XML FILE since its defined in the skin
; -UseMusic True
; -Global True
; -Random True


;####   NewsFeed  ######

BeginDraw UseCurrent
 MessageBox "Begin NewsFeed"
EndDraw
Delay 1

; -NewsFeed Add  XML Write
XMLSetValue NewXML !.Newsfeed.Global TRUE
XMLSetValue NewXML !.Newsfeed.RotateChannels TRUE
XMLSetValue NewXML !.Newsfeed.URL http://www.xbox-scene.com/xbox1data/xbox-scene.xml
XMLSetValue NewXML !.Newsfeed.UpdateIntervalMin 20
XMLSetValue NewXML !.Newsfeed.RotateItemInterval 5

; -NewsFeed Remove TBD


;####   Save XML ######
;XML File is saved and closed
XMLSave NewXML c:\testmxmsaved.xml
XMLCLOSE NewXML



This xas spits out this xml test file at the moment.
CODE

<config>
<main>
<disctitle>MediaXMenu</disctitle>
<discsubtitle>ver9n6</discsubtitle>
<skinspath>c:MXMSKINS</skinspath>
<allowvideosound>TRUE</allowvideosound>
<removeduplicates>TRUE</removeduplicates>
<removeinvalid>TRUE</removeinvalid>
</main>
<network>
<usedhcp>FALSE</usedhcp>
<ip>192.168.000.103</ip>
<defaultgateway>192.168.000.001</defaultgateway>
<subnetmask>255255255000</subnetmask>
<dns1>1921680001001</dns1>
<dns2>1921680001001</dns2>
</network>
<ftpserver>
<allowanon>FALSE</allowanon>
<serverport>BLAH</serverport>
<user>
<name>xbox</name>
<password>xbox</password>
</user>
</ftpserver>
<preferences>
<nickname>MXM</nickname>
<timeserverip>192.168.0.100</timeserverip>
<synchronizeclock>FALSE</synchronizeclock>
<ftppriority>Highest</ftppriority>
<dvdplayer>DVDPlayerPath</dvdplayer>
<deepmultisearch>TRUE</deepmultisearch>
<autolaunchgame>FALSE</autolaunchgame>
<autolaunchmovie>FALSE</autolaunchmovie>
<autoloadmulti>FALSE</autoloadmulti>
</preferences>
<newsfeed>
<global>TRUE</global>
<rotatechannels>TRUE</rotatechannels>
<url>http://www.xbox-scene.com/xbox1data/xbox-scene.xml</url>
<updateintervalmin>20</updateintervalmin>
<rotateiteminterval>5</rotateiteminterval>
</newsfeed>
</config>


My question is, how do I define: <Newsfeed name="newsfeed"> I've been stuck on this one for a while now... tongue.gif

#15 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 16 October 2003 - 09:46 AM

I'll try and take a quick look at the string functions this morning before I go to work....

...as for setting attributes, XMLSetValue has an optional parameter "PrefAttr" - setting this to a string of any length should attempt to place the value in the attribute of an existing node or element....

CODE

XMLSetValue NewXML !.Newsfeed.Name "MyNewsfeed" true


EDIT: Well, just tested that, and it's not working right, but I should be able to fix it (IT seems to always create the element, even if one already exists - though you could put it first to make it create the tag, then set it)

ANOTHER EDIT: I should have this fixed shortly... found the bug with the Left/Right/Mid and also the problem with attributes. Testing now.

Edited by BenJeremy, 16 October 2003 - 10:11 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users