xboxscene.org forums

OG Xbox Forums => Official MediaXMenu (MXM) Forum => Dashboard Forums => MXM ActionScripting Forum => Topic started by: BenJeremy on February 25, 2004, 05:07:00 AM

Title: ActionScripting Questions
Post by: BenJeremy on February 25, 2004, 05:07:00 AM
QUOTE (jqcc @ Feb 25 2004, 09:52 AM)
Please do not flame me.....real noobie here
trying to do a font/audio exploit per the one I have in EVOX but MXM is better as I can detect whether what is running currently

I am having problems with this command

delete c:\fonts\xbox book.xtf

and rename c:\fonts\xbox book.xtf xbox book.org

What is the correct format

Thanks

You need to quote the file paths, since there are spaces (otherwise, ActionScript sees several arguments, where you only have one or two)

...and of course, when quoting, you need to "escape" the backslashes by doubling them up. This is only needed when quoting, because MXM reads quoted strings a little differently and the backslash becomes a special character.

delete "c:\\fonts\\xbox book.xtf"
rename "c:\\fonts\\xbox book.xtf" "xbox book.org"

Title: ActionScripting Questions
Post by: jqcc on February 25, 2004, 06:41:00 AM
I attach the original mxm.xml and the menu.xml for reference

I am trying to make the system say show install fonthack menu item when c:\morden\audiohack.loc exists

and vice versa only show audiohack menu item when c:\morden\fonthack.loc exists

thanks
<Menu>
   <SubMenu>
      <Title>Audio Package</Title>
      <Item>
         <Title>Install Audio Exploit</Title>
         <Description>Install Audio Exploit</Description>
         <Action>
            CallScript InstallPack
         </Action>
      </Item>
      <Item>
         <Title>Remove Package</Title>
         <Description>Remove Audio Exploit</Description>
         <Action>
            Callscript RemovePack
         </Action>
      </Item>
      <Item>
         <Title>Reinstall ST.DB</Title>
         <Description>Reinstall ST.DB if corrupted</Description>
         <Action>
            Callscript RefreshDB
         </Action>
      </Item>
   </SubMenu>
   <SubMenu>
      <Title>Games</Title>
      <Item>
         <AutoDir Flatten="True" Recurse="False">F:\Games</AutoDir>
      </Item>
      <Item>
         <AutoDir Flatten="True" Recurse="False">E:\Games</AutoDir>
      </Item>
   </SubMenu>
   <SubMenu>
      <Title>Apps</Title>
      <Item>
         <AutoDir Flatten="True" Recurse="False">F:\Apps</AutoDir>
      </Item>
      <Item>
         <AutoDir Flatten="True" Recurse="False">E:\Apps</AutoDir>
      </Item>
      <Item>
         <AutoDir Flatten="True" Recurse="False">%_GAMESAVE%Boxplorer</AutoDir>
      </Item>
   </SubMenu>
   <SubMenu>
      <Title>Emus</Title>
      <Item>
         <AutoDir Flatten="True" Recurse="False">F:\Emus</AutoDir>
      </Item>
      <Item>
         <AutoDir Flatten="True" Recurse="False">F:\Emus</AutoDir>
      </Item>
   </SubMenu>
</Menu>


<Config>
   <Main>
      <DiscTitle>Media X Menu</DiscTitle>
   </Main>
         <ActionScript name="AutoExec">
         Set _GAMESAVE "E:\\Udata\\21585554\\000000000000\\"
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 1 goto Installed
         Quit
         :Installed
         SETFUNC dbhacked FILEEXISTS E:\Morden\hack.loc
         If %dbhacked% == 1 goto finish
         delete E:\Tdata\fffe0000\music\st.or
         SETFUNC dbexist FILEEXISTS E:\Tdata\fffe0000\music\st.db
         If %dbexist% == 0 goto nope
         RENAME E:\Tdata\fffe0000\music\st.db E:\Tdata\fffe0000\music\st.or
         :nope
         COPY E:\Tdata\fffe0000\music\st.hk E:\Tdata\fffe0000\music\st.db
         callscript CreateLock E:\Morden\hack.loc
         :finish
      </ActionScript>

      <ActionScript name="GameStub">
         SETFUNC dbhacked FILEEXISTS E:\Morden\hack.loc
         If %dbhacked% == 0 goto finish
         delete E:\Tdata\fffe0000\music\st.db
         SETFUNC dbexist FILEEXISTS E:\Tdata\fffe0000\music\st.or
         If %dbexist% == 0 goto del
         Copy E:\Tdata\fffe0000\music\st.or E:\Tdata\fffe0000\music\st.db
         :del
         delete E:\Morden\hack.loc
         :finish
      </ActionScript>

      <ActionScript name="InstallPack">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 1 goto There
         Callscript _DisplayMessageBox "Are you sure you wish to install the Audio package?$eol$Press the green button to continue, any other to abort."
         If %_GP_A% == "1" GOTO APRESSED
         Quit

         :APRESSED
         MkDir E:\PBL
         COPY %_GAMESAVE%boot.cfg E:\PBL\boot.cfg
         COPY %_GAMESAVE%bg.jpg E:\PBL\bg.jpg
         COPY %_GAMESAVE%font.jpg E:\PBL\font.jpg
         COPY %_GAMESAVE%phoenix2d_logo1.jpg E:\PBL\phoenix2d_logo1.jpg
         COPY %_GAMESAVE%default.xbe E:\PBL\P.xbe
         MkDir E:\PBL\Bioses
         COPY %_GAMESAVE%Audio\*.bin E:\PBL\Bioses
         MkDir E:\mxm
         COPY %_GAMESAVE%mxm\mxm.xml e:\mxm\mxm.xml
         COPY %_GAMESAVE%mxm\default.xbe e:\mxm\default.xbe
         COPY %_GAMESAVE%mxm\BIOSMD5.xml e:\mxm\BIOSMD5.xml
         COPY %_GAMESAVE%mxm\quote.txt e:\mxm\quote.txt
         COPY %_GAMESAVE%mxm\BiosMenu.xas e:\mxm\BiosMenu.xas
         COPY %_GAMESAVE%Audio\menu.xml e:\mxm\menu.xml
         SETFUNC pref FILEEXISTS e:\Udata\00004321\pref.xml
         If %pref% == 1 goto nopref
         COPY %_GAMESAVE%Audio\pref.xml e:\Udata\00004321\pref.xml
         :nopref
         SETFUNC dbexists FILEEXISTS E:\Tdata\fffe0000\music\st.db
         If %dbexists% == 0 goto dbnotexist
         RENAME E:\Tdata\fffe0000\music\st.db E:\Tdata\fffe0000\music\st.or
         :dbnotexist
         COPY %_GAMESAVE%Audio\st.db E:\Tdata\fffe0000\music\st.db
         COPY %_GAMESAVE%Audio\st.db E:\Tdata\fffe0000\music\st.hk
         MkDir E:\Morden
         callscript CreateLock E:\Morden\lock.loc
         callscript CreateLock E:\Morden\hack.loc
         callscript CreateLock E:\Morden\install.loc
         Callscript _DisplayMessageBox "The package has been installed!"
         Quit
         :There
         Callscript _DisplayMessageBox "Package is already installed!"
      </ActionScript>

      <ActionScript name="RemovePack">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 0 goto NotThere
         Callscript _DisplayMessageBox "Are you sure you wish to remove the Audio package?$eol$Press the green button to continue, any other to abort."
         If %_GP_A% == "1" GOTO Cont
         Quit

         :Cont
         Delete E:\PBL\bg.jpg
         Delete E:\PBL\font.jpg
         Delete E:\PBL\boot.cfg
         Delete E:\PBL\phoenix2d_logo1.jpg
         Delete E:\PBL\p.xbe
         Delete E:\Morden\lock.loc
         Delete E:\Morden\install.loc
         Delete E:\PBL\Bioses\4979_67.bin
         Delete E:\PBL\Bioses\EvoxM7.bin
         Delete E:\mxm\mxm.xml
         Delete E:\mxm\default.xbe
         Delete E:\mxm\BIOSMD5.xml
         Delete E:\mxm\menu.xml
         Delete E:\mxm\cache_menu.xml
         Delete e:\mxm\quote.txt
         Delete e:\mxm\BiosMenu.xas
         RmDir E:\PBL\Bioses
         RmDir E:\PBL
         RmDir E:\mxm
         SETFUNC dbexists FILEEXISTS E:\Tdata\fffe0000\music\st.or
         If %dbexists% == 0 goto dbnotexist
         SETFUNC dbhacked FILEEXISTS E:\Morden\hack.loc
         If %dbhacked% == 0 goto dbnothacked
         delete E:\Tdata\fffe0000\music\st.db
         RENAME E:\Tdata\fffe0000\music\st.or E:\Tdata\fffe0000\music\st.db
         goto finish

         :dbnothacked
         delete E:\Tdata\fffe0000\music\st.or
         goto finish

         :dbnotexist
         Delete E:\Tdata\fffe0000\music\st.db

         :finish
         Delete E:\Tdata\fffe0000\music\st.hk
         RmDir E:\Tdata\fffe0000\music\1499ec
         Delete E:\Morden\hack.loc
         RmDir E:\Morden
         Callscript _DisplayMessageBox "The package has been removed!"
         Quit

         :NotThere
         Callscript _DisplayMessageBox "Package is not installed!"
      </ActionScript>

      <ActionScript name="RefreshDB">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 0 goto NotThere
         Callscript _DisplayMessageBox "Are you sure you wish to reinstall the ST.db?$eol$Press the green button to continue, any other to abort."
         If %_GP_A% == "1" GOTO Cont
         Quit

         :Cont
         SETFUNC dbhacked FILEEXISTS E:\Morden\hack.loc
         If %dbhacked% == 1 goto dbhacked
         delete E:\Tdata\fffe0000\music\st.or
         RENAME E:\Tdata\fffe0000\music\st.db E:\Tdata\fffe0000\music\st.or
         goto finish

         :dbhacked
         delete E:\Tdata\fffe0000\music\st.db

         :finish
         COPY E:\Tdata\fffe0000\music\st.hk E:\Tdata\fffe0000\music\st.db
         callscript CreateLock E:\Morden\hack.loc
         Callscript _DisplayMessageBox "The ST.DB has been reinstalled!"
         Quit

         :NotThere
         Callscript _DisplayMessageBox "Package is not installed!"
      </ActionScript>

      <ActionScript name="CreateLock">
         openwrite lockfile %1%
         writefile lockfile "lock"
         closefile lockfile
      </ActionScript>

      <ActionScript name="LaunchWithBios">
         rename e:\pbl\boot.cfg e:\pbl\boot.org
         OpenWrite bootfile e:\pbl\boot.cfg
         WriteFileLn bootfile "RC4Key *YAY, SOMEONE ELSE WHO WANTS TO BE BANNED FOR POSTING RC4 KEYS* *RC4 KEYS ARE NOT TO BE POSTED ON XS*"
         WriteFileLn bootfile "EEPROMKey1_0 *STUPID PEOPLE SHOULD NOT POST RC4 KEYS* *DO NOT POST RC4 KEYS HERE... YOU CAN BE BANNED FOR THIS*"
         WriteFileLn bootfile "EEPROMKey1_1 *YAY, SOMEONE ELSE WHO WANTS TO BE BANNED FOR POSTING RC4 KEYS* *You might get banned for posting this*"
         WriteFileLn bootfile "LEDSequence gggg"
         WriteFileLn bootfile "Romfile %2%"
         WriteFileLn bootfile "Timeout 300000"
         WriteFileLn bootfile "Debug false"
         CloseFile bootfile
         openread QUOTEFILE e:\mxm\quote.txt
         readfileln QUOTEFILE QUOTE
         closefile QUOTEFILE
         OpenWrite autoexec e:\mxm\autoexec.xas
         WriteFileLn autoexec "delete e:\\pbl\\boot.cfg"
         WriteFileLn autoexec "rename e:\\pbl\\boot.org e:\\pbl\\boot.cfg"
         WriteFileLn autoexec "Delete e:\\mxm\\autoexec.xas"
         SetFunc EXEVAR Replace "\\" "\\\\" %1%
         WriteFileLn autoexec "Exec %QUOTE%%EXEVAR%%QUOTE%"
         CloseFile autoexec
         exec e:\pbl\p.xbe
      </ActionScript>

      <ActionScript name="EnableGamestub">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 0 goto NotThere
         SETFUNC entry FILEEXISTS %_GameDir%\MXM_Entry.xml
         If %entry% == 1 goto xmlexists
         CallScript _DisplayMessageBox "Are you sure you wish to enable the gamestub for this Game?$EOL$Press green to continue, and other button to abort."
         If %_GP_A% == "1" GOTO Cont
         Quit

         :Cont
         openread QUOTEFILE e:\mxm\quote.txt
         readfileln QUOTEFILE QUOTE
         closefile QUOTEFILE
         OpenWrite myfile %_GameDir%\MXM_Entry.xml
         WritefileLn myfile "$lt$config$gt$"
         WritefileLn myfile "$lt$item$gt$"         
         WritefileLn myfile "$lt$descr$gt$Gamestub Enabled$lt$/descr$gt$"
         WritefileLn myfile "$lt$description$gt$Gamestub Enabled$lt$/description$gt$"
         WritefileLn myfile "$lt$title$gt$%_GameTitle%$lt$/title$gt$"
         WritefileLn myfile "$lt$xbeid$gt$%_GameXBEID%$lt$/xbeid$gt$"
         WritefileLn myfile "$lt$verified$gt$%_GameVerified%$lt$/verified$gt$"
         WritefileLn myfile "$lt$dir$gt$%_GameDir%$lt$/dir$gt$"
         WritefileLn myfile "$lt$media$gt$%_GameMedia%$lt$/media$gt$"
         WritefileLn myfile "$lt$thumbnail$gt$%_GameThumbnail%$lt$/thumbnail$gt$"
         WritefileLn myfile "$lt$exe$gt$%_GameExe%$lt$/exe$gt$"
         setfunc tempvar replace "\\" "\\\\" %_GameExe%
         WritefileLn myfile "$lt$action$gt$CallScript Gamestub$eol$Exec %Quote%%tempvar%%QUOTE%$lt$/action$gt$"
         WritefileLn myfile "$lt$/item$gt$"
         WritefileLn myfile "$lt$/config$gt$"
         CloseFile myfile
         CallScript _DisplayMessageBox "The GameStub has been enabled for this Game.$EOL$ The system will now reboot and rebuild your menus."
         ResetMenuCache
         Reboot
         :xmlexists
         CallScript _DisplayMessageBox "An MXM_Entry.xml already exists for this item. Aborting!"
         quit
         :NotThere
         Callscript _DisplayMessageBox "Package is not installed!"
      </ActionScript>

      <ActionScript name="RemoveMXMEntry">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 0 goto NotThere
         SETFUNC entry FILEEXISTS %_GameDir%\MXM_Entry.xml
         If %entry% == 0 goto xmlnotexists
         CallScript _DisplayMessageBox "Are you sure you wish to disable the gamestub or custom BIOS's for this item?$EOL$Press green to continue, and other button to abort."
         If %_GP_A% == "1" GOTO Cont
         Quit

         :Cont
         delete %_GameDir%\MXM_Entry.xml
         CallScript _DisplayMessageBox "The MXM_Entry.xml has been removed for this item.$EOL$ The system will now reboot and rebuild your menus."
         ResetMenuCache
         Reboot
         :xmlnotexists
         quit
         :NotThere
         Callscript _DisplayMessageBox "Package is not installed!"
      </ActionScript>

      <ActionScript name="PickBIOS">
         SETFUNC installed FILEEXISTS e:\Morden\install.loc
         If %installed% == 0 goto NotThere
         openread QUOTEFILE e:\mxm\quote.txt
         readfileln QUOTEFILE QUOTE
         closefile QUOTEFILE
         SETFUNC entry FILEEXISTS %_GameDir%\MXM_Entry.xml
         If %entry% == 1 goto xmlexists
         CallFile BiosMenu.xas
         If %_BIOSFILE% == "" goto endhere
         OpenWrite myfile %_GameDir%\MXM_Entry.xml
         WritefileLn myfile "$lt$config$gt$"
         WritefileLn myfile "$lt$item$gt$"         
         WritefileLn myfile "$lt$descr$gt$BIOS Enabled$lt$/descr$gt$"
         WritefileLn myfile "$lt$description$gt$BIOS Enabled$lt$/description$gt$"
         WritefileLn myfile "$lt$title$gt$%_GameTitle%$lt$/title$gt$"
         WritefileLn myfile "$lt$xbeid$gt$%_GameXBEID%$lt$/xbeid$gt$"
         WritefileLn myfile "$lt$verified$gt$%_GameVerified%$lt$/verified$gt$"
         WritefileLn myfile "$lt$dir$gt$%_GameDir%$lt$/dir$gt$"
         WritefileLn myfile "$lt$media$gt$%_GameMedia%$lt$/media$gt$"
         WritefileLn myfile "$lt$thumbnail$gt$%_GameThumbnail%$lt$/thumbnail$gt$"
         WritefileLn myfile "$lt$exe$gt$%_GameExe%$lt$/exe$gt$"
         setfunc tempvar replace "\\" "\\\\" %_GameExe%
         WritefileLn myfile "$lt$action$gt$CallScript LaunchWithBios %Quote%%tempvar%%QUOTE% %_BIOSFILE%$lt$/action$gt$"
         WritefileLn myfile "$lt$/item$gt$"
         WritefileLn myfile "$lt$/config$gt$"
         CloseFile myfile
         CallScript _DisplayMessageBox "The Evox BIOS has been enabled for this Game.$EOL$ The system will now reboot and rebuild your menus."
         ResetMenuCache
         Reboot
         :xmlexists
         CallScript _DisplayMessageBox "An MXM_Entry.xml already exists for this item. Aborting!"
         :endhere
         quit
         :NotThere
         Callscript _DisplayMessageBox "Package is not installed!"
      </ActionScript>
   </Scripts>
   <Context>
      <Item Name="Dummy1">
         <Mode>HD</Mode>
               </Item>
      <Item Name="Dummy2">
         <Mode>HD</Mode>
               </Item>
      <Item Name="Dummy3">
         <Mode>HD</Mode>
               </Item>
      <Item Name="Enable GameStub">
         <Mode>HD</Mode>
               </Item>
      <Item Name="Set Custom Bios">
         <Mode>HD</Mode>
               </Item>
      <Item Name="Remove Gamestub/Bios Settings">
         <Mode>HD</Mode>
               </Item>
   </Context>
</Config>


Thanks again in advance
Title: ActionScripting Questions
Post by: flattspott on February 25, 2004, 07:02:00 AM
smile.gif
Title: ActionScripting Questions
Post by: -FourDoor- on February 25, 2004, 11:18:00 AM
Always been a fan of the exploits but never a users aside from the TSOP flashing aspect as I didn't see it stable enough to meet my daily needs. But great idea on the MXM based installer.
Title: ActionScripting Questions
Post by: flattspott on February 25, 2004, 12:47:00 PM
I was gonna say cause

WritefileLn myfile "$lt$config$gt$"
WritefileLn myfile "$lt$item$gt$"
WritefileLn myfile "$lt$descr$gt$BIOS Enabled$lt$/descr$gt$"
WritefileLn myfile "$lt$description$gt$BIOS Enabled$lt$/description$gt$"
WritefileLn myfile "$lt$title$gt$%_GameTitle%$lt$/title$gt$"
WritefileLn myfile "$lt$xbeid$gt$%_GameXBEID%$lt$/xbeid$gt$"
WritefileLn myfile "$lt$verified$gt$%_GameVerified%$lt$/verified$gt$"
WritefileLn myfile "$lt$dir$gt$%_GameDir%$lt$/dir$gt$"
WritefileLn myfile "$lt$media$gt$%_GameMedia%$lt$/media$gt$"
WritefileLn myfile "$lt$thumbnail$gt$%_GameThumbnail%$lt$/thumbnail$gt$"
WritefileLn myfile "$lt$exe$gt$%_GameExe%$lt$/exe$gt$"

is a bit out dated now.
Title: ActionScripting Questions
Post by: jqcc on February 25, 2004, 11:51:00 PM
Just to update all
I am almost done with the font/audio hack switch using mxm
The code is horrible as I am rushing the job

Trying to add a couple of more features....like the ability to use the dvd to add the font exploit when the files are not in the harddisk
Plus a way to copy in the skin files as well as the other applications like xbox media player, boxexplorer and any others
I am trying to do a slayers with the mxm code

I would like the experts here to help me tidy up the code
I did not use the as as I want to keep it within mxm.xml - this makes it more clumsy but I want to minimize the number of files to copy to the save game

Two questions/issues before I can complete
I still cannot get the context to work ? any ideas
And how to implement passwords

Thanks for all the help so far
Title: ActionScripting Questions
Post by: BenJeremy on October 15, 2003, 10:59:00 AM
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.
Title: ActionScripting Questions
Post by: DBZRacer on October 15, 2003, 03:04:00 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...
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 04:43:00 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.




Title: ActionScripting Questions
Post by: BenJeremy on October 15, 2003, 04:48:00 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.
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 04:43:00 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?
Title: ActionScripting Questions
Post by: BenJeremy on October 15, 2003, 04:53:00 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...
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 06:07:00 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






This post has been edited by koldfuzion: Oct 16 2003, 03:19 AM
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 06:11: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.

This post has been edited by koldfuzion: Oct 16 2003, 01:12 AM
Title: ActionScripting Questions
Post by: BenJeremy on October 15, 2003, 06:19:00 PM
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)
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 06:34:00 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?
Title: ActionScripting Questions
Post by: BenJeremy on October 15, 2003, 07:16:00 PM
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.
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 08:23:00 PM
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.
Title: ActionScripting Questions
Post by: koldfuzion on October 15, 2003, 09:17:00 PM
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.

This post has been edited by koldfuzion: Oct 16 2003, 06:25 AM
Title: ActionScripting Questions
Post by: DBZRacer on October 16, 2003, 01:40:00 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



MediaXMenu
ver9n6
c:MXMSKINS
TRUE
TRUE
TRUE


FALSE
192.168.000.103
192.168.000.001
255255255000
1921680001001
1921680001001


FALSE
BLAH

xbox
xbox



MXM
192.168.0.100
FALSE
Highest
DVDPlayerPath
TRUE
FALSE
FALSE
FALSE


TRUE
TRUE
http://www.xbox-scene.com/xbox1data/xbox-scene.xml
20
5




My question is, how do I define: <Newsfeed name="newsfeed"> I've been stuck on this one for a while now... :P
Title: ActionScripting Questions
Post by: BenJeremy on October 16, 2003, 03:57:00 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.

This post has been edited by BenJeremy: Oct 16 2003, 11:22 AM
Title: ActionScripting Questions
Post by: BenJeremy on October 16, 2003, 03:18:00 AM
OK, it's fixed and the "WIP" binaries have been updated... both issues.

Give it a whirl guys...
Title: ActionScripting Questions
Post by: koldfuzion on October 16, 2003, 04:47:00 AM
your freakin awesome! thanks!
Title: ActionScripting Questions
Post by: koldfuzion on October 16, 2003, 01:22:00 PM
cool.  we are near completion of the NEW USER script.  

This script will OVERWRITE the existing mxm.xml.  Its not intended for current users to edit what they already have.  


We will continue with a CURRENT USER script to allow editing of the current mxm.xml once this first one is complete.

Title: ActionScripting Questions
Post by: DBZRacer on October 16, 2003, 07:13:00 PM
QUOTE (yourwishismine @ Oct 16 2003, 05:33 PM)
QUOTE (koldfuzion @ Oct 16 2003, 05:22 PM)
cool.  we are near completion of the NEW USER script. 

This script will OVERWRITE the existing mxm.xml.  Its not intended for current users to edit what they already have. 


We will continue with a CURRENT USER script to allow editing of the current mxm.xml once this first one is complete.

That sounds excellent.... you guys are awesom.. now if I could stay off working on my website and mirc... I could maybe write some myself... LOL...

beerchug.gif

THE script is about 75-80% done!!! KF is blending our 2 peices of code together. I must say this is one LOOOOOOONNNNNNNNNNGGGGGGGGG script!!!

Now it's time for thorough testing and adding "extra" usability features.  beerchug.gif
Title: ActionScripting Questions
Post by: koldfuzion on October 17, 2003, 07:50:00 AM
here is the final version of the script although you can use it without a WIP right now, nor would you probably want to.

You can run through the script without worrying about it overwritting your mxm.xml until the very end when its time to save.   then you have the option to save and reboot or quit.

If anyone finds anything wrong with this, let us know and we will fix it. hoepfulyl someone will find this useful.

Final Version of New User script by DBZRacer and KoldFuzion

oh, the link is because I didnt want to post all 1400+ lines of the script.
Title: ActionScripting Questions
Post by: DBZRacer on October 17, 2003, 09:34:00 AM
Updated the script to fix the "BACK" errors. You should now be able to go back and forth through the entire script without any problems.

Edit: Now mirroring v1.03
Final Version of New User script by DBZRacer and KoldFuzion
Title: ActionScripting Questions
Post by: koldfuzion on October 17, 2003, 02:21:00 PM
thanks for the fix.  I thought I ran through it real good.. but maybe not.

I updated my link as well.

Now.   ..  to continue with the IP Changer (actually all network settings) then the Current user script.

Title: ActionScripting Questions
Post by: jlm5151 on October 17, 2003, 04:56:00 PM
Great work guys, definitely an awesome script, keep them coming.
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 12:13:00 AM
tongue.gif

Previously, we were writing out the ip, dns1, dns1 gateway and timeserver addresses with leading zeros.  Something like 192.068.001.003

While its not exactly incorrect.  Its just not cosmetically correct.  So I modified the script to return the values we are all familiar with, using the address above:  192.68.1.3

The only other thing changed was the option to quit when ready to save the file.   It previously stated: "Press Black Button to quit and reboot later".  Now it more accurately reads "Press Black Button to Quit Without Saving"

you can get it at this link for sure..

NEW User Script Version 1.02

DBZRacer should get his mirror link updated after the weekend.
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 11:35:00 AM
BJ, Is there anyway to dynamically call a variable? (use of compound variables)

For instance:
If i have variables   IP1 IP2 IP3 IP4 and IP5

and i want to obtain the values of these variables by using a loop counter

:LOOP
ADD Loopcount 1

SET NEWIP IP%Loopcount%

GOTO LOOP


IF I Use %NEWIP% I get "IP1" as a value of NEWIP   where i really want to get the value of IP1

Any way to do this?
Title: ActionScripting Questions
Post by: firefucker on October 18, 2003, 02:56:00 PM
2 quick questions:
How can I check if a file exists?
like in DOS

if exist <file> goto bla
do something
:bla
so something different
???
---------------------------
How can I setup a new unformated drive with MxM? Is there an option like in evox
'configsector' ??

thX
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 03:06:00 PM
QUOTE (firefucker @ Oct 18 2003, 11:56 PM)
Quick qusestion:
How do I check if a file exists?
like in DOS

if exist <file> goto bla
do something
:bla
so something different
???


SETFUNC SKINDIR FileExists "c:\\mxmskins"
IF# %SKINDIR% == 0 GOTO CREATESKINDIR
IF# %SKINDIR% == 1 GOTO MainAllowVideoSound




Nevermind about the "compund variables" BJ.   I found a way around it and can now load the current system IP into the script....and change it smile.gif
Title: ActionScripting Questions
Post by: firefucker on October 18, 2003, 05:14:00 PM
CODE

ERROR (setfunc) Unknown function C:evoxdash.xbe


maybe missing quotes ?
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 05:40:00 PM
smile.gif

oh.. i will re-edit.  Im looking for the folder in the directory mxm is running from so i actually dont give the full path.

with a full path you need to use quotes and double up on the \

I fixed the previous example.. again
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 05:46:00 PM
im almost always hanging out in #mxm on efnet (irc).  so if you know what im talkng about.. your welcome to join.. things could be discussed more rapidly there.

Problems, cool shit, or just helpful hints should still be posted here too though.

Title: ActionScripting Questions
Post by: firefucker on October 18, 2003, 06:25:00 PM
smile.gif
c u
need to sleep now, it's 4:19 AM    ohmy.gif
Title: ActionScripting Questions
Post by: koldfuzion on October 18, 2003, 09:11:00 PM
smile.gif

Do DBZRacer and I win a prize for the longest ActionScript? Like a year subscription to the MXM forum or something?
Title: ActionScripting Questions
Post by: firefucker on October 19, 2003, 03:08:00 AM
*arg* the s**** doesnt work, again ERROR blabla

another question: How can I delete not empty folders

chmod 777 C:bla
rmdir c:bla

doesnt work. what does cascade mean in:
RmDir <PATH> <CASCADE>
Title: ActionScripting Questions
Post by: thetruethugg on October 19, 2003, 03:11:00 AM
It's the same as a recursive operation.  It goes into all subdirectories and shit.
Title: ActionScripting Questions
Post by: firefucker on October 19, 2003, 04:15:00 AM
ok.But how do u use it?
rmdir C:bla cascade
?????
Title: ActionScripting Questions
Post by: BenJeremy on October 19, 2003, 05:09:00 AM
QUOTE (firefucker @ Oct 19 2003, 08:15 AM)
ok.But how do u use it?
rmdir C:bla cascade
?????

CODE

rmdir C:\blah 1


Most parameters will accept a "1" as  true condition.
Title: ActionScripting Questions
Post by: firefucker on October 19, 2003, 05:15:00 AM
Ahh! ThX.

like:
RmDir <PATH> <0|1>

I just didn't know how to interprete <CASCADE>.....
Title: ActionScripting Questions
Post by: koldfuzion on October 20, 2003, 01:24:00 PM
well, i think after reading BJ's actionscript clinic again and again, the newuser.xas will need to be updated one more time. Simply to change the newsfeed username to "User1"

The reason behind this is to be able to look for mulitple newsfeeds during a config edit and be able to save the same info back to the mxm.xml.  BJ explains it quite thoroughly and so the change is needed.

The need for this goes beyond editing the current settings though.  Once the "download from web" function is in place and working fine. I want to be able to create a script that will download newfeed scripts from AXS and add the newsfeed to the current xml file.  As well as a newsfeed removal script.

In order to do this.. the node name has to be standardized for the script to work and staying with UserXX is the most logical answer.

So I will edit the file once i get home and post the newer version.  Ill edit this thread once its done.


anyone have some scripts they are working on?  ideas of some to be made?  the forums are a little skimpy on this topic which is really suprising to me because of the power BJ has given the users to create their own "utilities".

Title: ActionScripting Questions
Post by: koldfuzion on October 24, 2003, 10:36:00 AM
hrmm. ok BJ, I started working on the fix date script a minute ago and a problem hit me.


mxm only reports the year in 2 digit format.

the display of the date can be changed by the user to be a number of different ways:   yy/mm/dd  or mm/dd/yy

I was going to use SETFUNC CurrentYear Right 4 $date$  to get the year (i know i must use Right 2 for now)

This poses a couple problems.

1.  I dont know which section might contain the year.
2.  I was needing the long year to check the first digit of the year for a 2, to see if it was invalid.   So if a box had 8907 (or whatever the year was)  the user could be prompted to fix the date.   if it was 2040, or 2004 or 2003 ..then it wouldnt.


Is there any way to pull the full date from the box without the mxm mods to two digit format..and always in the same display format?    so i could expect  $realdate$ to always display mm-dd-yyyy


well.. for the next few years i can check jsut for the right digit of 8907   and if its 7, then its invalid.
but the user will have to know/remember/leave the year to mm-dd-yy format, or it will be an AFu script for now.
Title: ActionScripting Questions
Post by: BenJeremy on October 24, 2003, 10:59:00 AM
QUOTE (koldfuzion @ Oct 24 2003, 02:36 PM)
hrmm. ok BJ, I started working on the fix date script a minute ago and a problem hit me.


mxm only reports the year in 2 digit format.

the display of the date can be changed by the user to be a number of different ways:   yy/mm/dd  or mm/dd/yy

I was going to use SETFUNC CurrentYear Right 4 $date$  to get the year (i know i must use Right 2 for now)

This poses a couple problems.

1.  I dont know which section might contain the year.
2.  I was needing the long year to check the first digit of the year for a 2, to see if it was invalid.   So if a box had 8907 (or whatever the year was)  the user could be prompted to fix the date.   if it was 2040, or 2004 or 2003 ..then it wouldnt.


Is there any way to pull the full date from the box without the mxm mods to two digit format..and always in the same display format?    so i could expect  $realdate$ to always display mm-dd-yyyy

Sounds like a good idea.... I'll work on putting that into a release possibly for tonight.
Title: ActionScripting Questions
Post by: koldfuzion on October 24, 2003, 11:03:00 AM
haha you replied the same time i edited.

i can just use the last digit until 2007, if the date they say is returned is somehow the default (invalid) date.

If you get the change added soon though, i will include the change.   gonna work on the 7 for now.
Title: ActionScripting Questions
Post by: BenJeremy on October 24, 2003, 11:09:00 AM
QUOTE (koldfuzion @ Oct 24 2003, 03:03 PM)
haha you replied the same time i edited.

i can just use the last digit until 2007, if the date they say is returned is somehow the default (invalid) date.

If you get the change added soon though, i will include the change.   gonna work on the 7 for now.

Actually, I was thinking, since I'd be digging in there anyway, it might be easiest for me to report current hours, minutes, seconds, day, month and year in separate "specials"

$tm_year$ would equal 2003

$tm_hour$ might report 15 for 3:XXpm

That would eliminate any confusion, right?
Title: ActionScripting Questions
Post by: koldfuzion on October 24, 2003, 01:07:00 PM
definitely, are you going to leave the current shortdate/short time?  
Title: ActionScripting Questions
Post by: BenJeremy on October 24, 2003, 02:26:00 PM
QUOTE (koldfuzion @ Oct 24 2003, 05:07 PM)
definitely, are you going to leave the current shortdate/short time?

Yeah, I can put in short forms of the time and date, as well...
Title: ActionScripting Questions
Post by: geniusalz on November 03, 2003, 04:34:00 PM
CallContextScript
How is this different from normal CallFile?
Title: ActionScripting Questions
Post by: BenJeremy on November 03, 2003, 04:59:00 PM
QUOTE (geniusalz @ Nov 3 2003, 08:34 PM)
CallContextScript
How is this different from normal CallFile?

Good question.... It took me a minute to scan the code and figure it out for myself, again.

Context Scripts are scripts that are contained in the menu item's node...

<Item>
<Title>Some Title</Title>
<SomeContextAction>
script code...
</SomeContextAction>
</Scripts>
</Item>


You can use "contextscriptexists" function to see if the script is there inthe currently selected item... (just like "scriptexists" for regular scripts).

Why would you do this?

Take a look at the "__DoLaunchApp" in the internal.xml file. This is how I plan on launching files in the future (hmmm... dunno if I'm doing this already yet  blink.gif ). ContextScripts will allow you to add functionality to items in numerous ways.

My "__DoLaunchApp" was intended to allow the user to have an "OnLaunch" script in their item node so they could prep the app, for example, before launching, if need be.
Title: ActionScripting Questions
Post by: fastTOE on November 09, 2003, 06:49:00 PM
alright,.... this looked like the right thread to post....
i am VERY new to this action scripting (actually this is my first time to this section of the forum) but it is intriguing to say the least,.... it reminds me of my TI-83 graphing calculator programming days, but on a much larger scale, ofcourse.  anyways, my question to you all is this:  is there a beginners tutorial anywhere just to get me started? i read the two piinned topics on the top of this forum and was slightly confused..... are these scripts that you just put in  you .xml as items? or what,.... so any help would be great,.... sorry if this has been answered hundreds of times or if this is the wrong thread, but if u could just pooint me in the right direction to get me going on this action scriptiing i would be truly in debt to you....
  thanks in advance,
      Loren
Title: ActionScripting Questions
Post by: fastTOE on November 09, 2003, 07:13:00 PM
ok, i should've just toyed around with it before i posted,... i got the fan speed action script to work, and it makes sense, so that is good.... still any help and pointers would be great, but im going to keep toying with it to see what else i can do.... also, just curious why can you not do other percentages of the fan speed like 75% or 50%... i tried doing this and they all did either 100% or default
Title: ActionScripting Questions
Post by: Kthulu on November 09, 2003, 07:34:00 PM
smile.gif
Title: ActionScripting Questions
Post by: koldfuzion on November 09, 2003, 07:49:00 PM
QUOTE (fastTOE @ Nov 10 2003, 05:13 AM)
ok, i should've just toyed around with it before i posted,... i got the fan speed action script to work, and it makes sense, so that is good.... still any help and pointers would be great, but im going to keep toying with it to see what else i can do.... also, just curious why can you not do other percentages of the fan speed like 75% or 50%... i tried doing this and they all did either 100% or default

you might try this one.. i allow the user to increase/decrease values by 1 or 5.  They arent allowed to go above 50 or below 10.

FanSpeed.xas

I have most of the scripts made (that are publically available) on AXS... and you might find more helpful info on actionscripts at the last link in my signature.
Title: ActionScripting Questions
Post by: fastTOE on November 09, 2003, 08:17:00 PM
thanks for the advise and the new fan speed script,.... tho i cant get that new one to work... i already posted about that in another topic,... so iwill just thank you here..... "thank you" (for the link and such)

p.s. sorry i posted in the other topic before i read this one, didnt mean to double post sort of thing
Title: ActionScripting Questions
Post by: geniusalz on November 14, 2003, 08:47:00 AM
BJ said it's coming.
Title: ActionScripting Questions
Post by: Kthulu on November 15, 2003, 06:38:00 PM
anybody had any luck getting trigger buttons to work in AS?
Title: ActionScripting Questions
Post by: koldfuzion on November 15, 2003, 06:51:00 PM
no, its dead.. i tried it.
Title: ActionScripting Questions
Post by: BenJeremy on November 16, 2003, 04:49:00 PM
Triggers are currently "shift" buttons.

I'm currently revamping the input system (fully translatable - i.e. user configurable - input form all input devices)