xboxscene.org forums

Author Topic: Reboot, Powercycle Script Help  (Read 93 times)

letkemanp

  • Archived User
  • Newbie
  • *
  • Posts: 1
Reboot, Powercycle Script Help
« on: November 20, 2003, 06:40:00 AM »

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
Logged

yourwishismine

  • Archived User
  • Sr. Member
  • *
  • Posts: 325
Reboot, Powercycle Script Help
« Reply #1 on: November 20, 2003, 07:12:00 AM »

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


This post has been edited by yourwishismine: Nov 20 2003, 03:18 PM
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Reboot, Powercycle Script Help
« Reply #2 on: November 20, 2003, 09:43:00 AM »

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

yourwishismine

  • Archived User
  • Sr. Member
  • *
  • Posts: 325
Reboot, Powercycle Script Help
« Reply #3 on: November 20, 2003, 10:47:00 AM »

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

This post has been edited by yourwishismine: Nov 20 2003, 06:53 PM
Logged

yourwishismine

  • Archived User
  • Sr. Member
  • *
  • Posts: 325
Reboot, Powercycle Script Help
« Reply #4 on: November 20, 2003, 11:10:00 AM »

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

Logged

49er

  • Archived User
  • Newbie
  • *
  • Posts: 18
Reboot, Powercycle Script Help
« Reply #5 on: November 26, 2003, 12:23:00 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


This post has been edited by 49er: Nov 26 2003, 08:25 AM
Logged

yourwishismine

  • Archived User
  • Sr. Member
  • *
  • Posts: 325
Reboot, Powercycle Script Help
« Reply #6 on: November 26, 2003, 03:11:00 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
Logged