letkemanp
Nov 20 2003, 02:33 PM
I am new to MXM and MXM Scripting. I have tried to create a script the does the following:
Reboot - if A is pressed
Shutdown - if X is pressed
ResetMenuCache and PowerCycle - if R Trigger is pressed
PowerCycle - if L Trigger is pressed
No matter what I press the system reboots, I am probably missing some simple thing. Can anyone help me out? Below is the code:
BeginDraw UseCurrent
MessageBox "Reboot$eol$Press A to Reboot$eol$Press L to Cycle Power$eol$Press X to Shutdown$eol$Press R to Force Menu Rebuild And Reboot"
EndDraw
Input
If %_GP_A% == "1" GOTO APRESSED
If %_GP_L% == "1" GOTO LPRESSED
If %_GP_TRG_LT% == "1" GOTO YPRESSED
If %_GP_TRG_RT% == "1" GOTO RPRESSED
:APRESSED
Reboot
QUIT
:LPRESSED
PowerCycle
QUIT
:XPRESSED
Shutdown
QUIT
:RPRESSED
ResetMenuCache
PowerCycle
QUIT
yourwishismine
Nov 20 2003, 03:05 PM
Well the 1st thing I notice is that none of your options are pointing to the xpressed section and all the others tell the xbox to reboot...
so it will reboot every time... here's what I modified...
| CODE |
BeginDraw UseCurrent MessageBox "Reboot$eol$Press A to Reboot$eol$Press L to Cycle Power$eol$Press X to Shutdown$eol$Press R to Force Menu Rebuild And Reboot" EndDraw Input If %_GP_A% == "1" GOTO APRESSED If %_GP_TRG_LT% == "1" GOTO LPRESSED If %_GP_X% == "1" GOTO XPRESSED If %_GP_TRG_RT% == "1" GOTO RPRESSED
:APRESSED Reboot QUIT
:LPRESSED PowerCycle QUIT
:XPRESSED Shutdown QUIT
:RPRESSED ResetMenuCache PowerCycle QUIT
|
koldfuzion
Nov 20 2003, 05:36 PM
you need to assign different buttons besides the triggers, they are "shift" buttons and not buttons to use like X Y A B Start Back, Black or White.
dont ask me what i mean by shift buttons, i dunno.
yourwishismine
Nov 20 2003, 07:03 PM
Based on what Koldfuzion shared... I think the proper way to do this would be like:
| CODE |
BeginDraw UseCurrent MessageBox "Reboot$eol$Press A to Reboot$eol$Press B to Cycle Power$eol$Press X to Shutdown$eol$Press Y to Force Menu Rebuild And Reboot" EndDraw Input If %_GP_A% == "1" GOTO APRESSED If %_GP_B% == "1" GOTO BPRESSED If %_GP_X% == "1" GOTO XPRESSED If %_GP_Y% == "1" GOTO YPRESSED
:APRESSED Reboot QUIT
:BPRESSED PowerCycle QUIT
:XPRESSED Shutdown QUIT
:YPRESSED ResetMenuCache PowerCycle QUIT
|
49er
Nov 26 2003, 08:16 AM
I've added a QUIT immediately after the IFs - that way pressing any other button cancels rather than reboots.
| CODE |
Input If %_GP_A% == "1" GOTO APRESSED If %_GP_B% == "1" GOTO BPRESSED If %_GP_X% == "1" GOTO XPRESSED If %_GP_Y% == "1" GOTO YPRESSED QUIT
|
yourwishismine
Nov 26 2003, 11:11 AM
So the finished product should be...
| CODE |
BeginDraw UseCurrent MessageBox "Reboot$eol$Press A to Reboot$eol$Press B to Cycle Power$eol$Press X to Shutdown$eol$Press Y to Force Menu Rebuild And Reboot" EndDraw Input If %_GP_A% == "1" GOTO APRESSED If %_GP_B% == "1" GOTO BPRESSED If %_GP_X% == "1" GOTO XPRESSED If %_GP_Y% == "1" GOTO YPRESSED QUIT
:APRESSED Reboot QUIT
:BPRESSED PowerCycle QUIT
:XPRESSED Shutdown QUIT
:YPRESSED ResetMenuCache PowerCycle QUIT
|
Thank you for pointing out the QUIT... missed that one...