|
  |
Actionscript Collection, Post/View available MXM Actionscripts |
|
|
| flattspott |
Feb 13 2004, 02:37 AM
|

X-S Freak
    
Group: Moderator
Posts: 1787
Joined: 14-April 03
From: Southern California
Member No.: 32293
Xbox Version: v1.0
360 version: v1 (xenon)

|
Actionscript Name: Entry MakerAuthor: flattspott Version: 6 Purpose: Allows user to make MXM Entries on the xbox Instructions: Included in the script file For Q&A's and more info about this script visit this thread: EntryMakerEDIT: Sorry guys this is a WIP script. This post has been edited by flattspott: May 27 2004, 09:21 AM
|
|
|
|
| |
| tayior7 |
Feb 17 2004, 03:18 AM
|

X-S Senior Member
 
Group: Members
Posts: 276
Joined: 10-November 02
Member No.: 8183

|
Actionscript Name: MXMPasswordScript Author: tayior7 Version: 1.1 Purpose: Alternate password option, hides actauly password Instructions: view readme.txt (below) For Q&A's about this script visit this thread: N/A
Readme:
| CODE | MXMPasswordScript V1.1 WRITTEN BY tayior7 thanks to kthulu for helping me get around that bug in MXM!
this script will ask for a password before launching a user specified file. Unlike the original passcode, this will use the buttons on your controller and will not be visable to the user. You can use this on as many items as u want, each with a different password, or whatever you want. To use on more than one item, just use different variables (duh)
How to use script in menu.xml
<Item> <Title>Game1</title> <Action> SET DIGIT1a A SET DIGIT2a B SET DIGIT3a X SET DIGIT4a Y SET DIGIT5a A SET PWSCRIPTPATH "E:\\scripts" SET PATHNAME "C:\\folder\\anotherfolder" SET FILENAME "default.xbe" Callfile %PWSCRIPTPATH%\pw.xas </Action> </Item>
What each line is:
################################################################ SET DIGIT1a A SET DIGIT2a B SET DIGIT3a X SET DIGIT4a Y SET DIGIT5a A ================================================================ These lines are used to define the password, in this example, the password would be A,B,X,Y,A. You can change each variable however you want, using these... A = A button B = B button X = X button Y = Y button BLACK = black button WHITE = white button START = start button BACK = back button DUP = d-pad up DDN = d-pad down DRT = d-pad right DLF = d-pad left TRLF = left thumbstick TRRT = right thumbstick for some reason the triggers wont work, but if for some reason you wanna try, u need to use: TRT = right trigger TLT = left trigger ################################################################
################################################################ SET PWSCRIPTPATH "E:\\scripts" ================================================================ This line tells MXM where the scripts are. The above line would tell MXM that pw.xas and pwscreen.xas are in E:\scripts\pw.xas and E:\scripts\pwscreen.xas ################################################################
################################################################ SET PATHNAME "C:\\folder\\anotherfolder" SET FILENAME "default.xbe" ================================================================ These lines tell the script what to launch if the password is correct. This above example would launch "C:\folder\anotherfolder\default.xbe" MAKE SURE THAT YOU HAVE DOUBLE \'S!!! IF YOU DONT, IT WONT WORK! ALSO MAKE SURE YOU HAVE QUOTES AROUND IT! ################################################################
################################################################ Callfile %PWSCRIPTPATH%\pw.xas ================================================================ This line executes the password script. Do not modify this line unless you know what ur doin. ################################################################
You can also put all the lines (except the Callfile line) inside pw.xas for added security.
Final Example: IF YOU WANT THE PASSWORD TO BE BLACK,WHITE,DPAD UP, DPAD DOWN, BLACK AND IT TO LAUCH "E:\DASHBOARDS\EVOX\EVOXDASH.XBE" THEN YOU WOULD DO THIS:
<Item> <Title>LAUNCH EVOX</title> <Action> SET DIGIT1a BLACK SET DIGIT2a WHITE SET DIGIT3a DUP SET DIGIT4a DDN SET DIGIT5a BLACK SET PWSCRIPTPATH "E:\\scripts" SET PATHNAME "E:\\dashboards\\evox" SET FILENAME "evoxdash.xbe" Callfile %PWSCRIPTPATH%\pw.xas </Action> </Item> |
Save As - pw.xas
| CODE | ;################################################## ;# Name: MXMPasswordScript ;# Author: tayior7 ;# Date: 3-20-2004 ;# File Name: pw.xas ;# Version: 1.1 ;# Purpose: Alternate password option, hides actauly password ;# Save file as: pw.xas ;##########################################################
:DIGIT1 SET PWTEXT "Enter password" Callfile %PWSCRIPTPATH%\pwscreen.xas Input IF %_GP_A% == "1" GOTO A1 IF %_GP_B% == "1" GOTO B1 IF %_GP_X% == "1" GOTO X1 IF %_GP_Y% == "1" GOTO Y1 IF %_GP_BLACK% == "1" GOTO BLACK1 IF %_GP_WHITE% == "1" GOTO WHITE1 IF %_GP_START% == "1" GOTO START1 IF %_GP_BACK% == "1" GOTO BACK1 IF %_GP_D_UP% == "1" GOTO DUP1 IF %_GP_D_DN% == "1" GOTO DDN1 IF %_GP_D_RT% == "1" GOTO DRT1 IF %_GP_D_LF% == "1" GOTO DLF1 IF %_GP_TRG_RT% == "1" GOTO TRT1 IF %_GP_TRG_LT% == "1" GOTO TLT1 IF %_GP_THUMB_LF% == "1" GOTO TRLF1 IF %_GP_THUMB_RT% == "1" GOTO TRRT1 QUIT
:A1 SET digit1 A GOTO digit2 :B1 SET digit1 B GOTO digit2 :X1 SET digit1 X GOTO digit2 :Y1 SET digit1 Y GOTO digit2 :BLACK1 SET digit1 BLACK GOTO digit2 :WHITE1 SET digit1 WHITE GOTO digit2 :START1 SET digit1 START GOTO digit2 :BACK1 SET digit1 BACK GOTO digit2 :DUP1 SET digit1 DUP GOTO digit2 :DDN1 SET digit1 DDN GOTO digit2 :DRT1 SET digit1 DRT GOTO digit2 :DLF1 SET digit1 DLF GOTO digit2 :TRT1 SET digit1 TRT GOTO digit2 :TLT1 SET digit1 TLT GOTO digit2 :TRLF1 SET digit1 TRLF GOTO digit2 :TRRT1 SET digit1 TRRT GOTO digit2
:DIGIT2 SET DIGIT1e "#" Callfile %PWSCRIPTPATH%\pwscreen.xas Input IF %_GP_A% == "1" GOTO A2 IF %_GP_B% == "1" GOTO B2 IF %_GP_X% == "1" GOTO X2 IF %_GP_Y% == "1" GOTO Y2 IF %_GP_BLACK% == "1" GOTO BLACK2 IF %_GP_WHITE% == "1" GOTO WHITE2 IF %_GP_START% == "1" GOTO START2 IF %_GP_BACK% == "1" GOTO BACK2 IF %_GP_D_UP% == "1" GOTO DUP2 IF %_GP_D_DN% == "1" GOTO DDN2 IF %_GP_D_RT% == "1" GOTO DRT2 IF %_GP_D_LF% == "1" GOTO DLF2 IF %_GP_TRG_RT% == "1" GOTO TRT2 IF %_GP_TRG_LT% == "1" GOTO TLT2 IF %_GP_THUMB_LF% == "1" GOTO TRLF2 IF %_GP_THUMB_RT% == "1" GOTO TRRT2 QUIT
:A2 SET digit2 A GOTO digit3 :B2 SET digit2 B GOTO digit3 :X2 SET digit2 X GOTO digit3 :Y2 SET digit2 Y GOTO digit3 :BLACK2 SET digit2 BLACK GOTO digit3 :WHITE2 SET digit2 WHITE GOTO digit3 :START2 SET digit2 START GOTO digit3 :BACK2 SET digit2 BACK GOTO digit3 :DUP2 SET digit2 DUP GOTO digit3 :DDN2 SET digit2 DDN GOTO digit3 :DRT2 SET digit2 DRT GOTO digit3 :DLF2 SET digit2 DLF GOTO digit3 :TRT2 SET digit2 TRT GOTO digit3 :TLT2 SET digit2 TLT GOTO digit3 :TRLF2 SET digit2 TRLF GOTO digit3 :TRRT2 SET digit2 TRRT GOTO digit3
:DIGIT3 SET DIGIT2e "#" Callfile %PWSCRIPTPATH%\pwscreen.xas Input IF %_GP_A% == "1" GOTO A3 IF %_GP_B% == "1" GOTO B3 IF %_GP_X% == "1" GOTO X3 IF %_GP_Y% == "1" GOTO Y3 IF %_GP_BLACK% == "1" GOTO BLACK3 IF %_GP_WHITE% == "1" GOTO WHITE3 IF %_GP_START% == "1" GOTO START3 IF %_GP_BACK% == "1" GOTO BACK3 IF %_GP_D_UP% == "1" GOTO DUP3 IF %_GP_D_DN% == "1" GOTO DDN3 IF %_GP_D_RT% == "1" GOTO DRT3 IF %_GP_D_LF% == "1" GOTO DLF3 IF %_GP_TRG_RT% == "1" GOTO TRT3 IF %_GP_TRG_LT% == "1" GOTO TLT3 IF %_GP_THUMB_LF% == "1" GOTO TRLF3 IF %_GP_THUMB_RT% == "1" GOTO TRRT3 QUIT
:A3 SET digit3 A GOTO digit4 :B3 SET digit3 B GOTO digit4 :X3 SET digit3 X GOTO digit4 :Y3 SET digit3 Y GOTO digit4 :BLACK3 SET digit3 BLACK GOTO digit4 :WHITE3 SET digit3 WHITE GOTO digit4 :START3 SET digit3 START GOTO digit4 :BACK3 SET digit3 BACK GOTO digit4 :DUP3 SET digit3 DUP GOTO digit4 :DDN3 SET digit3 DDN GOTO digit4 :DRT3 SET digit3 DRT GOTO digit4 :DLF3 SET digit3 DLF GOTO digit4 :TRT3 SET digit3 TRT GOTO digit4 :TLT3 SET digit3 TLT GOTO digit4 :TRLF3 SET digit3 TRLF GOTO digit4 :TRRT3 SET digit3 TRRT GOTO digit4
:DIGIT4 SET DIGIT3e "#" Callfile %PWSCRIPTPATH%\pwscreen.xas Input IF %_GP_A% == "1" GOTO A4 IF %_GP_B% == "1" GOTO B4 IF %_GP_X% == "1" GOTO X4 IF %_GP_Y% == "1" GOTO Y4 IF %_GP_BLACK% == "1" GOTO BLACK4 IF %_GP_WHITE% == "1" GOTO WHITE4 IF %_GP_START% == "1" GOTO START4 IF %_GP_BACK% == "1" GOTO BACK4 IF %_GP_D_UP% == "1" GOTO DUP4 IF %_GP_D_DN% == "1" GOTO DDN4 IF %_GP_D_RT% == "1" GOTO DRT4 IF %_GP_D_LF% == "1" GOTO DLF4 IF %_GP_TRG_RT% == "1" GOTO TRT4 IF %_GP_TRG_LT% == "1" GOTO TLT4 IF %_GP_THUMB_LF% == "1" GOTO TRLF4 IF %_GP_THUMB_RT% == "1" GOTO TRRT4 QUIT
:A4 SET digit4 A GOTO digit5 :B4 SET digit4 B GOTO digit5 :X4 SET digit4 X GOTO digit5 :Y4 SET digit4 Y GOTO digit5 :BLACK4 SET digit4 BLACK GOTO digit5 :WHITE4 SET digit4 WHITE GOTO digit5 :START4 SET digit4 START GOTO digit5 :BACK4 SET digit4 BACK GOTO digit5 :DUP4 SET digit4 DUP GOTO digit5 :DDN4 SET digit4 DDN GOTO digit5 :DRT4 SET digit4 DRT GOTO digit5 :DLF4 SET digit4 DLF GOTO digit5 :TRT4 SET digit4 TRT GOTO digit5 :TLT4 SET digit4 TLT GOTO digit5 :TRLF4 SET digit4 TRLF GOTO digit5 :TRRT4 SET digit4 TRRT GOTO digit5
:DIGIT5 SET DIGIT4e "#" Callfile %PWSCRIPTPATH%\pwscreen.xas Input IF %_GP_A% == "1" GOTO A5 IF %_GP_B% == "1" GOTO B5 IF %_GP_X% == "1" GOTO X5 IF %_GP_Y% == "1" GOTO Y5 IF %_GP_BLACK% == "1" GOTO BLACK5 IF %_GP_WHITE% == "1" GOTO WHITE5 IF %_GP_START% == "1" GOTO START5 IF %_GP_BACK% == "1" GOTO BACK5 IF %_GP_D_UP% == "1" GOTO DUP5 IF %_GP_D_DN% == "1" GOTO DDN5 IF %_GP_D_RT% == "1" GOTO DRT5 IF %_GP_D_LF% == "1" GOTO DLF5 IF %_GP_TRG_RT% == "1" GOTO TRT5 IF %_GP_TRG_LT% == "1" GOTO TLT5 IF %_GP_THUMB_LF% == "1" GOTO TRLF5 IF %_GP_THUMB_RT% == "1" GOTO TRRT5 QUIT
:A5 SET digit5 A GOTO CHECKPW :B5 SET digit5 B GOTO CHECKPW :X5 SET digit5 X GOTO CHECKPW :Y5 SET digit5 Y GOTO CHECKPW :BLACK5 SET digit5 BLACK GOTO CHECKPW :WHITE5 SET digit5 WHITE GOTO CHECKPW :START5 SET digit5 START GOTO CHECKPW :BACK5 SET digit5 BACK GOTO CHECKPW :DUP5 SET digit5 DUP GOTO CHECKPW :DDN5 SET digit5 DDN GOTO CHECKPW :DRT5 SET digit5 DRT GOTO CHECKPW :DLF5 SET digit5 DLF GOTO CHECKPW :TRT5 SET digit5 TRT GOTO CHECKPW :TLT5 SET digit5 TLT GOTO CHECKPW :TRLF5 SET digit5 TRLF GOTO CHECKPW :TRRT5 SET digit5 TRRT GOTO CHECKPW
:CHECKPW SET DIGIT5e "#" :DIGIT1t IF %digit1% == %DIGIT1a% GOTO DIGIT2t IF %digit1% != %DIGIT1a% GOTO URWRONG
:DIGIT2t IF %digit2% == %DIGIT2a% GOTO DIGIT3t IF %digit2% != %DIGIT2a% GOTO URWRONG
:DIGIT3t IF %digit3% == %DIGIT3a% GOTO DIGIT4t IF %digit3% != %DIGIT3a% GOTO URWRONG
:DIGIT4t IF %digit4% == %DIGIT4a% GOTO DIGIT5t IF %digit4% != %DIGIT4a% GOTO URWRONG
:DIGIT5t IF %digit5% == %DIGIT5a% GOTO PWCORRECT IF %digit5% != %DIGIT5a% GOTO URWRONG
:URWRONG SET PWTEXT "Password Incorrect" Callfile %PWSCRIPTPATH%\pwscreen.xas Delay 3 QUIT
:PWCORRECT SET PWTEXT "Password Correct" Callfile %PWSCRIPTPATH%\pwscreen.xas Delay 2 CD %PATHNAME% EXEC "%FILENAME%" QUIT |
Save As - pwscreen.xas
| CODE | ;################################################## ;# Name: MXMPasswordScript ;# Author: tayior7 ;# Date: 3-20-2004 ;# File Name: pwscreen.xas ;# Version: 1.1 ;# Purpose: Alternate password option, hides actauly password ;# Save file as: pwscreen.xas ;##########################################################
BeginDraw Box 180 160 195 55 0xFF000000 0x00000000 Box 195 175 25 25 0xFF000000 0x00000000 Box 230 175 25 25 0xFF000000 0x00000000 Box 265 175 25 25 0xFF000000 0x00000000 Box 300 175 25 25 0xFF000000 0x00000000 Box 335 175 25 25 0xFF000000 0x00000000 Text 200 175 LEFT "%DIGIT1e%" 0xFFFFFFFF Text 235 175 LEFT "%DIGIT2e%" 0xFFFFFFFF Text 270 175 LEFT "%DIGIT3e%" 0xFFFFFFFF Text 305 175 LEFT "%DIGIT4e%" 0xFFFFFFFF Text 340 175 LEFT "%DIGIT5e%" 0xFFFFFFFF Box 180 230 195 25 0xFF000000 0x00000000 Text 185 230 LEFT %PWTEXT% 0xFFFFFFFF EndDraw
|
This post has been edited by tayior7: Mar 20 2004, 06:57 PM
|
|
|
|
| |
| flattspott |
Apr 20 2004, 06:51 PM
|

X-S Freak
    
Group: Moderator
Posts: 1787
Joined: 14-April 03
From: Southern California
Member No.: 32293
Xbox Version: v1.0
360 version: v1 (xenon)

|
Actionscript Name: X2 BIOS Config ScriptAuthor: flattspott Version: 1.0 Purpose: To allow users to enable or disable X2 BIOS features from within MXM. Instructions: Included in the script file For Q&A's and a screenshot about this script visit this thread: X2ConfigSave As - X2Config.xas | CODE | ;###################################################### ;# Script: X2 BIOS Config Script ;# Author: flattspott ;# Date: 04-20-2004 ;# Version: 1.0 ;# Disclaimer: Should be safe but as always use at your own risk. ;# Info: Finally, a script from me that is MXM 0.9n.6 compatible ;# Purpose: To allow users to enable or disable X2 BIOS features from within MXM. ;# Usage: A standard CallFile will do ;# ;# CallFile <Path>\X2Config.xas ;# ;####################################################### :X2Status :IGRCheck SetFunc IGR FileExists E:\x2_IGR_disabled If# %IGR% == 1 Goto IGREnable If# %IGR% == 0 Goto IGRDisable :IGREnable Set Prompt1 "Press A to Enable: In Game Reset" Set Op1 Enable Goto NROECheck :IGRDisable Set Prompt1 "Press A to Disable: In Game Reset" Set Op1 Disable Goto NROECheck
:NROECheck SetFunc NROE FileExists E:\x2_NROE_disabled If# %NROE% == 1 Goto NROEEnable If# %NROE% == 0 Goto NROEDisable :NROEEnable Set Prompt2 "Press B to Enable: No Reset on Eject" Set Op2 Enable Goto XBLCCheck :NROEDisable Set Prompt2 "Press B to Disable: No Reset on Eject" Set Op2 Disable Goto XBLCCheck
:XBLCCheck SetFunc XBLC FileExists E:\x2_XBLC_disabled If# %XBLC% == 1 Goto XBLCEnable If# %XBLC% == 0 Goto XBLCDisable :XBLCEnable Set Prompt3 "Press X to Enable: Xbox Live Check" Set Op3 Enable Goto CECCheck :XBLCDisable Set Prompt3 "Press X to Disable: Xbox Live Check" Set Op3 Disable Goto CECCheck
:CECCheck SetFunc CEC FileExists E:\x2_CEC_disabled If# %CEC% == 1 Goto CECEnable If# %CEC% == 0 Goto CECDisable :CECEnable Set Prompt4 "Press Y to Enable: Clock Error Check" Set Op4 Enable Goto RefreshScreen :CECDisable Set Prompt4 "Press Y to Disable: Clock Error Check" Set Op4 Disable Goto RefreshScreen
:RefreshScreen BeginDraw Box 0 0 640 480 DarkBlue DarkBlue Text 320 125 Center "X2 BIOS Config Script" Text 320 200 Center "%Prompt1%" Text 320 220 Center "%Prompt2%" Text 320 240 Center "%Prompt3%" Text 320 260 Center "%Prompt4%" Text 320 300 Center "Press White to Exit" EndDraw
Input If %_GP_A% == "1" Goto %Op1%IGR If %_GP_B% == "1" Goto %Op2%NROE If %_GP_X% == "1" Goto %Op3%XBLC If %_GP_Y% == "1" Goto %Op4%CEC If %_GP_WHITE% == "1" Goto End Goto RefreshScreen
:DisableIGR OpenWrite X2 E:\x2_IGR_disabled CloseFile X2 Goto X2Status
:DisableNROE OpenWrite X2 E:\x2_NROE_disabled CloseFile X2 Goto X2Status
:DisableXBLC OpenWrite X2 E:\x2_XBLC_disabled CloseFile X2 Goto X2Status
:DisableCEC OpenWrite X2 E:\x2_CEC_disabled CloseFile X2 Goto X2Status
:EnableIGR Delete E:\x2_IGR_disabled Goto X2Status
:EnableNROE Delete E:\x2_NROE_disabled Goto X2Status
:EnableXBLC Delete E:\x2_XBLC_disabled Goto X2Status
:EnableCEC Delete E:\x2_CEC_disabled Goto X2Status
:End Quit |
|
|
|
|
| |
| SumDumGuy3 |
Sep 3 2004, 04:31 AM
|
X-S Young Member

Group: Members
Posts: 53
Joined: 10-August 04
Member No.: 137432

|
ok, I have been waiting long enough... I am still working on the installer so it is not completely finished yet. It is very nearly finished. I am hoping I can finish it tonight, if I focus on it... Anyway, until I can finish and release the main script, I thought I would go ahead and release some of the subscripts I am using for my loader.
For those of you (probably most of you) who do not know what loader, I am talking about. I wrote a loader/autoinstaller (whatever you want to call it) similar to the Slayers awile back. It was much more advanced than slayers... I tried to get him to use my code in his release (as I can not offer the same level of support that he does) but he felt mine was just too complex (agreed... complexity is a tradeoff of flexibility, mine was MUCH More flexible and therefore was more complex) Anyway, I think he started using bits and pieces of my loader in his but that's really not important for now...
What is important is that I needed to make a new version... his is just not comprehensive enough to suit the needs of some people. Anyway, so I agreed to make a new version. I can't wait for the next release of MXM and I will never go back to using Evox for writing the installer, now that I have found out about MXM, so this loader/autoinstaller is based entirely on mxm 0.9n.6. I understand the next release will completely change everything but until then this is the best I could come up with in a short period of time...
The scripts I will be including below are based on work I have done on that loader. I still have to finish the main script and all that fun stuff... But these might prove useful for some, if for nothing else for code samples and ideas on how some things could be implemented... That said... enjoy... let me know if you have questions or comments about this code... would love to hear some feedback...
Thanks, SumDumGuy
NotVal.xas
| CODE | ;############################################################################### ### ;# ;# Title: NotVal ;# Author: SumDumGuy ;# Filename: NotVal.xas ;# Date: 08-27-2004 ;# Version: 1.0 ;# Purpose: This is basically a function in a script. It accepts two arguments the Value ;# to return the Not of and the file to return it in. It then returns the Not value of that ;# arg (0 = 1, 1 = 0, True = False, False = True). It's basically like a toggle switch ;# ;############################################################################### ###
If %1% == "0" GOTO Ret1 If %1% == "1" GOTO Ret0 If %1% == False GOTO RetTrue If %1% == True GOTO RetFalse GOTO End
:Ret1 Set RetVal 1 GOTO WriteNot
:Ret0 Set RetVal 0 GOTO WriteNot
:RetTrue Set RetVal True GOTO WriteNot
:RetFalse Set RetVal False GOTO WriteNot
:WriteNot OpenWrite WFileHndl %2% WriteFileLn WFileHndl %RetVal% CloseFile WFileHndl GOTO End
:End Quit
|
FreeOnDrv.xas
| CODE | ;############################################################################### ### ;# ;# Title: Free On Drive ;# Author: SumDumGuy ;# Filename: FreeOnDrv.xas ;# Date: 09-26-2004 ;# Version: 1.0 ;# Purpose: This is basically a function in a script. It accepts two arguments the Drive ;# to check (in the form of G_Drive, F_Drive, E_Drive & C_Drive) and the file to return it in ;# It then returns the free space on that drive in MB with out any non-numerical characters. ;# ;############################################################################### ###
If %1% == "G_Drive" GOTO CheckG If %1% == "F_Drive" GOTO CheckF If %1% == "E_Drive" GOTO CheckE If %1% == "C_Drive" GOTO CheckC GOTO End
:CheckG Set FreeOnDrv $ShortDriveGFree$ GOTO CalcFree
:CheckF Set FreeOnDrv $ShortDriveFFree$ GOTO CalcFree
:CheckE Set FreeOnDrv $ShortDriveEFree$ GOTO CalcFree
:CheckC Set FreeOnDrv $ShortDriveCFree$ GOTO CalcFree
:CalcFree Setfunc FODLen LENGTH %FreeOnDrv% Sub FODLen 3 Setfunc FreeOnDrv RIGHT %FODLen% %FreeOnDrv% Setfunc FODLen LENGTH %FreeOnDrv% Sub FODLen 5 Setfunc FreeOnDrv LEFT %FODLen% %FreeOnDrv% Setfunc ByteType Right 2 %FreeOnDrv% Sub FODLen 2 Setfunc FreeOnDrv LEFT %FODLen% %FreeOnDrv% Setfunc FreeOnDrv REPLACE "," "" %FreeOnDrv% If %ByteType% == "KB" GOTO ConvertKB2MB GOTO Finished
:ConvertKB2MB DIV FreeOnDrv 1024 GOTO Finished
:Finished OpenWrite WFileHndl %2% WriteFileLn WFileHndl %FreeOnDrv% CloseFile WFileHndl GOTO End
:End Quit
|
TrayPrompt.xas
| CODE | ;############################################################################### ### ;# # ;# Title: Tray Prompt and Reboot or Shutdown # ;# Author: SumDumGuy # ;# Filename: TrayPrompt.xas # ;# Date: 08-27-2004 # ;# Version: 1.0 # ;# Purpose: Asks if they want to eject the DVD Tray, Then Reboots or Shutsdown # ;# # ;############################################################################### ###
GOTO TrayPrompt
:TrayPrompt BeginDraw UseCurrent MessageBox "Before you %1%.$eol$Would you like to Eject the DVD Drive Tray?$eol$$eol$Press the \"A\" button to Eject and %1%.$eol$$eol$Press the \"B\" button to Continue %1%$eol$without Ejecting.$eol$$eol$" EndDraw Input If %_GP_B% == "1" GOTO PerfAction If %_GP_A% == "1" GOTO EjectFirst If %_GP_BACK% == "1" GOTO End GOTO TrayPrompt
:EjectFirst TrayOpen BeginDraw UseCurrent MessageBox "Remove the CD/DVD and then Press any button to continue with %1%...$eol$$eol$" EndDraw Input
:PerfAction If %1% == "Shutdown" GOTO ShutDownNow If %1% == "Reboot" GOTO RebootNow
:ShutDownNow Shutdown GOTO End
:RebootNow Reboot GOTO End
:End Quit
|
BigDrive.xas
| CODE | ;############################################################################### ### ;# ;# Title: Biggest Drive ;# Author: SumDumGuy ;# Filename: BigDrive.xas ;# Date: 08-27-2004 ;# Version: 1.0 ;# Purpose: This is basically a function in a script. It accepts one argument, the ;# file to return the results in. It returns the letter of the drive with the most ;# most free space out of G, F, E & C. ;# ;############################################################################### ###
Set RetValFile Y:\RetVal.dat Set SelPartCMsg "Press \"Y\" for the C Partition with %FreeOnC% MB$eol$$eol$" Set SelPartEMsg "Press \"X\" for the E Partition with %FreeOnE% MB$eol$$eol$" Set SelPartFMsg "Press \"A\" for the F Partition with %FreeOnF% MB$eol$$eol$" Set SelPartGMsg "Press \"B\" for the G Partition with %FreeOnG% MB$eol$$eol$"
Copy %ScriptsPath%\RetVal.dat Y:\ CallFile %ScriptsPath%\FreeOnDrv.xas G_Drive %RetValFile% OPENREAD FileHndl %RetValFile% READFILELN FileHndl FreeOnG CLOSEFILE FileHndl Delete %RetValFile%
Copy %ScriptsPath%\RetVal.dat Y:\ CallFile %ScriptsPath%\FreeOnDrv.xas F_Drive %RetValFile% OPENREAD FileHndl %RetValFile% READFILELN FileHndl FreeOnF CLOSEFILE FileHndl Delete %RetValFile%
Copy %ScriptsPath%\RetVal.dat Y:\ CallFile %ScriptsPath%\FreeOnDrv.xas E_Drive %RetValFile% OPENREAD FileHndl %RetValFile% READFILELN FileHndl FreeOnE CLOSEFILE FileHndl Delete %RetValFile%
Copy %ScriptsPath%\RetVal.dat Y:\ CallFile %ScriptsPath%\FreeOnDrv.xas C_Drive %RetValFile% OPENREAD FileHndl %RetValFile% READFILELN FileHndl FreeOnC CLOSEFILE FileHndl Delete %RetValFile%
:CheckGFree If %FreeOnG% !#^ "free" GOTO CheckFFree Set FreeOnG 0 Set SelPartGMsg "" GOTO CheckFFree
:CheckFFree If %FreeOnF% !#^ "free" GOTO CheckEFree Set FreeOnF 0 Set SelPartFMsg "" GOTO CheckEFree
:CheckEFree If %FreeOnE% !#^ "free" GOTO CheckCFree Set SelPartEMsg "" GOTO ErrorPrompt
:CheckCFree If %FreeOnC% !#^ "free" GOTO TestGPart Set SelPartCMsg "" GOTO ErrorPrompt
:TestGPart If# %FreeOnG% < %FreeOnF% GOTO TestFPart If# %FreeOnG% < %FreeOnE% GOTO TestFPart If# %FreeOnG% < %FreeOnC% GOTO TestFPart Set BigDrive 4 Set BigDrvLetter G GOTO AcceptPrompt
:TestFPart If# %FreeOnF% < %FreeOnE% GOTO TestEPart If# %FreeOnF% < %FreeOnC% GOTO TestEPart Set BigDrive 3 Set BigDrvLetter F GOTO AcceptPrompt
:TestEPart If# %FreeOnE% < %FreeOnC% GOTO TestCPart Set BigDrive 2 Set BigDrvLetter E GOTO AcceptPrompt
:TestCPart Set BigDrive 1 Set BigDrvLetter C GOTO AcceptPrompt
:AcceptPrompt BeginDraw UseCurrent MessageBox "The C partition appears to have %FreeOnC% MB$eol$The E partition appears to have %FreeOnE% MB$eol$The F partition appears to have %FreeOnF% MB$eol$The G partition appears to have %FreeOnG% MB$eol$$eol$The %BigDrvLetter% drive appears to have the most free space$eol$on it. X-Loader will attempt to use the %BigDrvLetter% Drive.$eol$$eol$Press \"Start\" to change this selection$eol$$eol$Press any other button to accept this selection$eol$$eol$" EndDraw Input If %_GP_START% != "1" GOTO WriteDrive GOTO TargetDrvPrompt
:TargetDrvPrompt BeginDraw UseCurrent MessageBox "Select the partition to load apps/games/etc to...$eol$$eol$%SelPartCMsg%%SelPartEMsg%%SelPartFMsg%%SelPartGMsg%" EndDraw Input If %_GP_Y% == "1" GOTO SetCPart If %_GP_X% == "1" GOTO SetEPart If %_GP_A% == "1" GOTO SetFPart If %_GP_B% == "1" GOTO SetGPart GOTO TargetDrvPrompt
:SetCPart Set BigDrive 1 GOTO WriteDrive
:SetEPart Set BigDrive 2 GOTO WriteDrive
:SetFPart Set BigDrive 3 GOTO WriteDrive
:SetGPart Set BigDrive 4 GOTO WriteDrive
:WriteDrive OpenWrite WFileHndl %1% WriteFileLn WFileHndl %BigDrive% CloseFile WFileHndl GOTO End
:ErrorPrompt BeginDraw UseCurrent MessageBox "An Error was encountered. There does not appear$eol$to be any free space on the System partitions.$eol$$eol$Press any button to Reboot.$eol$$eol$" EndDraw Input Callfile %ScriptsPath%\TrayPrompt.xas Shutdown
:End Quit
|
Edit: I updated this post on 9/26/04 to reflect corrections to the FreeOnDrv Script. It incorrectly reported because when I first wrote it I did not know (and therefore take into account) that some values were returned as KB instead of MB. This has been fixed now.
thx, sdg
This post has been edited by SumDumGuy3: Sep 26 2004, 05:55 AM
|
|
|
|
| |
| SumDumGuy3 |
Sep 5 2004, 03:23 AM
|
X-S Young Member

Group: Members
Posts: 53
Joined: 10-August 04
Member No.: 137432

|
Ok, here is another of the scripts used in my X-Loader... This one is for a templating system... I will also add another script for repeating sections of a template. For now this script is strictly for replacing in-line template variables and not repeating ones.
So what is the point of this script you ask? Well, basically what I am using it for is to make templates for the various xbox apps configuration files. I used to make multiple copies of the configuration files, that were preconfigured for various situations. Then I would copy the appropriate config file over. But then that was when I used EvoX for my loader/auto-installer. Now that I am exploring the power of MXM for my loader, I decided to just make one config template for each program and then when the user makes their installation selections, it will go through the apps config templates replacing variables like "{TARGETDRIVE}" with the appropriate information i.e. "F:\". So the config file may some lines like:
| CODE | <home>E:\Apps\XBMC\</home>
|
or
| CODE | AutoAddItem "E:\Games\"
|
the template would have something more like:
| CODE | <home>{XBMCHOME}</home>
|
or
| CODE | AutoAddItem "{TARGETDRIVE}\Games\"
|
Then when you called this script you would do something like:
| CODE | CallFile "%ScriptsPath%\\ProcTPL_IL.xas" "D:\\ConfigFiles\\XBMC.tpl" "F:\\Apps\\XBMC\\XboxMediaCenter.xml" XBMCHOME "F:\\Apps\\XBMC\\"
|
| CODE | CallFile "%ScriptsPath%\\ProcTPL_IL.xas" "D:\\ConfigFiles\\EvoX.tpl" "F:\\Dashboards\\EvoX\\Evox.ini" TARGETDRIVE "F:"
|
Now, I know that you could do the xml's with MXMs xml functions but this is just a more generic script to allow you to do it for xmls, inis or any other file structure you may have the need to template... Anyway, hope it helps someone.. and even if not... it helps me... so  hehe ProcTPL_IL.xas | CODE | ;############################################################################### ### ;# ;# Title: Process Template In Line ;# Author: SumDumGuy ;# Filename: ProcTPL_IL.xas ;# Date: 09-04-2004 ;# Version: 1.0 ;# Purpose: Read In Source (Template) File, Replace Template Variables with appropriate ;# strings, Write New lines out to a file specified as the Target Location. ;# Accepts a Minimum of 4 and a Maximum of 10 arguments as follows: ;# %SourceFile%, %TargetFile%, %TMPLVAR1%, %NewSting1%, %TMPLVAR2%, %NewSting2%, .... ;# This script is for In Line Template Variable Replacement. Use the script: ;# ProcTemplateSec.xas for Section Template Variable Replacements. ;# ;############################################################################### ###
Set ScriptsPath $ActualPath$\Scripts Set SourceFile %1% Set TargetLoc %2%
SetFunc SourceExists FileExists %SourceFile% If %SourceExists% == "0" Goto RaiseError Goto OpenRWFiles
:OpenRWFiles OpenRead RFileHndl %SourceFile% ReadFileLn RFileHndl CurrentLine OpenWrite WFileHndl %TargetLoc% Goto ProcFile
:ProcFile SetFunc NewLine Replace "{%3%}" "%4%" "%CurrentLine%" Set CurrentLine %NewLine% Set NewLine "" If %5% == "" Goto WriteLine SetFunc NewLine Replace "{%5%}" "%6%" "%CurrentLine%" Set CurrentLine %NewLine% Set NewLine "" If %7% == "" Goto WriteLine SetFunc NewLine Replace "{%7%}" "%8%" "%CurrentLine%" Set CurrentLine %NewLine% Set NewLine "" If %9% == "" Goto WriteLine SetFunc NewLine Replace "{%9%}" "%10%" "%CurrentLine%" Set CurrentLine %NewLine% Set NewLine "" If %11% == "" Goto WriteLine SetFunc NewLine Replace "{%11%}" "%12%" "%CurrentLine%" Set CurrentLine %NewLine% Set NewLine "" Goto WriteLine
:WriteLine WriteFileLn WFileHndl %CurrentLine% FileStat RFileHndl ContinueRead If %ContinueRead% == "0" Goto CloseRWFiles ReadFileLn RFileHndl CurrentLine Goto ProcFile
:CloseRWFiles CloseFile RFileHndl CloseFile WFileHndl Goto End
:End Quit
:RaiseError BeginDraw UseCurrent MessageBox "The first argument in this script$eol$%SourceFile%$eol$Must be a pre-existing template file.$eol$$eol$" EndDraw Input Goto End
|
Regards, SDG
|
|
|
|
| |
| SumDumGuy3 |
Sep 10 2004, 07:50 AM
|
X-S Young Member

Group: Members
Posts: 53
Joined: 10-August 04
Member No.: 137432

|
Ok, here is my little script to transfer MXM_Entry.xml and the associated video/image files from a common source folder to the appropriate game/app folder for use by MXM. Currently it does not reset the menu cache for the user, they are warned though.
To call it, use something like the following:
| CODE | Callfile C:\Scripts\MXMEntries.xas F:\Games F:\Media\Info
|
| CODE | ;############################################################################### ### ;# ;# Title: MXM Entries ;# Author: SumDumGuy ;# Filename: MXMEntries.xas ;# Date: 09-09-2004 ;# Version: 1.0 ;# Purpose: This script copies MXM_Entry.xml and associated files given two arguments. ;# first argument is the Target Patch i.e. F:\Games. The second argument is Source ;# location for the entry info. the entry info needs to contain a set of folders with ;# the xbeid as the foldername and containing at least a MXM_Entry.xml file and any ;# other needed files for the prev videos, thumbs, covers, help screens.... ;# ;############################################################################### ###
Set searchPath %1% Set InfoPath %2%
:Search BeginSearch %searchPath%\*
:StartSearch SearchType sType SearchItem sName If "%sName%" == "" Goto DoneSearch If %sType% == "dir" Goto Check If %sType% == "file" Goto SearchContinue
:SearchContinue SearchNext Goto StartSearch
:DoneSearch EndSearch Goto Finish
:Check SetFunc isExe FileExists %sName%\default.xbe If %isExe% != 1 Goto SearchContinue SetFunc strExeTitle XBETITLE %sName%\default.xbe SetFunc strExeID XBEID %sName%\default.xbe
:CheckPV Set strVidFound "Was" SetFunc isVid FileExists %sName%\MXM_SS.wmv If %isVid% == 1 Goto CheckThm Set strVidFound "Was Not"
:CheckThm Set strThmFound "Was" SetFunc isThm FileExists %sName%\MXM_Thumb.jpg If %isThm% == 1 Goto CheckEntry SetFunc isThm FileExists %sName%\MXM_Thumb.png If %isThm% == 1 Goto CheckEntry SetFunc isThm FileExists %sName%\MXM_Thumb.bmp If %isThm% == 1 Goto CheckEntry SetFunc isThm FileExists %sName%\MXM_Thumb.tga If %isThm% == 1 Goto CheckEntry Set strThmFound "Was Not"
:CheckEntry Set strEntryFound "Was" SetFunc isEntry FileExists %sName%\MXM_Entry.xml If %isEntry% == 1 Goto InfoAvail Set strEntryFound "Was Not"
:InfoAvail Set strInfoFound "Was" SetFunc isInfo FileExists %InfoPath%\%strExeID%\MXM_Entry.xml If %isInfo% == 1 Goto ShowFindings Goto SearchContinue
:ShowFindings If %isEntry% == 1 Goto SearchContinue BeginDraw MessageBox "Game Found$eol$==========$eol$$eol$%strExeTitle%$eol$$eol$A MXM_Entry file %strEntryFound% Found$eol$A Preview Video %strVidFound% Found$eol$A Thumbnail %strThmFound% Found.$eol$$eol$Would you like to copy Media Info for this App/Game?$eol$$eol$Press \"A\" to Copy$eol$Press \"B\" to Skip$eol$$eol$" EndDraw Input If %_GP_A% == "1" GOTO CopyInfo Goto SearchContinue
:CopyInfo Copy %InfoPath%\%strExeID%\* %sName%\ Goto SearchContinue
:Finish BeginDraw MessageBox "MXMEntries has finished Running.$eol$$eol$NOTE: If you copied any of the MXM_Entry files, you will need to$eol$reset the menu cache and reboot.$eol$$eol$Press any button to exit$eol$$eol$" EndDraw Input Quit
|
As usual, I would love to hear any feedback, suggestions, comments, questions... whatever...
Thanks SDG
|
|
|
|
| |
|
  |
|