Jump to content


Photo

Reboot, Powercycle Script Help


  • Please log in to reply
6 replies to this topic

#1 letkemanp

letkemanp

    X-S Enthusiast

  • Members
  • 3 posts

Posted 20 November 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

#2 yourwishismine

yourwishismine

    X-S Genius

  • Members
  • PipPipPipPip
  • 890 posts
  • Xbox Version:unk

Posted 20 November 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

Edited by yourwishismine, 20 November 2003 - 03:11 PM.


#3 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 20 November 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.

#4 yourwishismine

yourwishismine

    X-S Genius

  • Members
  • PipPipPipPip
  • 890 posts
  • Xbox Version:unk

Posted 20 November 2003 - 06:40 PM

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).

Edited by yourwishismine, 20 November 2003 - 06:46 PM.


#5 yourwishismine

yourwishismine

    X-S Genius

  • Members
  • PipPipPipPip
  • 890 posts
  • Xbox Version:unk

Posted 20 November 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



#6 49er

49er

    X-S Young Member

  • Members
  • Pip
  • 55 posts

Posted 26 November 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

Edited by 49er, 26 November 2003 - 08:18 AM.


#7 yourwishismine

yourwishismine

    X-S Genius

  • Members
  • PipPipPipPip
  • 890 posts
  • Xbox Version:unk

Posted 26 November 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... smile.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users