Help - Search - Members - Calendar
Full Version: Reboot, Powercycle Script Help
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official MediaXMenu (MXM) Forum > MXM ActionScripting Forum
letkemanp
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
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
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
QUOTE (koldfuzion @ Nov 20 2003, 01: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.

A "shit button" would be a modifier for another button...

in other words...

Pressing A while holding left trigger would have a different effect then Pressing A by itself...


[Think like pressing shift on your keyboard or on a typewritter]


That is my 1 pennies worth... (I lost my other penny.. so if I'm wrong, that's why).
yourwishismine
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
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
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... smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.