Jump to content


Photo

Hard Drive, Free And Used Space Display


  • Please log in to reply
20 replies to this topic

#1 MrSin

MrSin

    X-S Enthusiast

  • Members
  • 13 posts

Posted 06 January 2005 - 07:39 AM

Hard Drive, Free and Used Space Display

To add Hard Drive Free and Used Space information display, when 'Y' button is pressed.

user posted image

Paste the following code at the end of default.xip/default.xap file:

CODE

//
//  HDD Space.
//
function GetXboxHardDiskStats()
{
       var DDPartition;
       var nFreeSpace = 0;
       var nTotalSpace = 0;
       var nArraySize = 7; // Can be 4 or 7.
       var hddInfo = "          XBOX HARD DISK\n";

       DDPartition = new Array(nArraySize);

       DDPartition[1] = "C:";
       DDPartition[2] = "E:";
       DDPartition[3] = "F:";
       DDPartition[4] = "G:";
       DDPartition[5] = "X:";
       DDPartition[6] = "Y:";
       DDPartition[7] = "Z:";

       for (var i = 1; i < nArraySize + 1; i = i + 1)
       {
               nFreeSpace = theHardDrive.GetFreeSpace(DDPartition[i] + "\\");
               nTotalSpace = theHardDrive.GetTotalSpace(DDPartition[i] + "\\");
               if(nTotalSpace != 0){
                       hddInfo = hddInfo + DDPartition[i] + " " + nFreeSpace + "MB of " + nTotalSpace + "MB\r";
               }
       }

       TellUser(theTranslator.Translate(hddInfo),"");
}
//
//  End.
//


To view HHD information from the main menu when the 'Y' button is pressed, find the following in default.xip/default.xap:

CODE

DEF theMainMenu Level
{

    ..........

   control DEF theMainMenuJoy Joystick
   {
       function OnADown()
       {
       ..............
       }


or to view it from the Hard Drive menu (I have it on both), find the following in default.xip/hard_drive.xap:

CODE

DEF theHardDriveMenu Level
{

    ..........

   control DEF theMainMenuJoy Joystick
   {
       function OnADown()
       {
       ..............
       }


and insert this code (below) after the 'OnADown()' function.

CODE

//
//  XBox Hard Disk Space Information.
//
function OnYDown()
{
       PlaySoundB();
       GetXboxHardDiskStats();
}
//
//  End.
//


You don't need to use 'OnYDown()' function, your could use any of the other buttons, with the exception of 'A' and 'B', 'B' can be used from the main menu, but I have the quick shutdown function assigned to 'B' for my main menu.

Done!

#2 MrSin

MrSin

    X-S Enthusiast

  • Members
  • 13 posts

Posted 06 January 2005 - 09:01 AM

if you don't want drives 'X', 'Y' or 'Z' to be displayed, change the following:

CODE

function GetXboxHardDiskStats()
{
      var DDPartition;
      var nFreeSpace = 0;
      var nTotalSpace = 0;

      var nArraySize = 7; // Can be 4 or 7.


change to:

CODE

var nArraySize = 4; // Can be 4 or 7.


Then it will only display 'C', 'E', 'F' and 'G' (if you have one). Plus if you have a 'G' drive there are to many lines to fit on the window, so removing X, Y and Z looks better.


#3 iLLNESS

iLLNESS

    X-S Genius

  • XS-BANNED
  • PipPipPipPip
  • 766 posts
  • Location:Ontario, Canada
  • Interests:computers, video games, my gf, movies, drinking
  • Xbox Version:v1.3
  • 360 version:v1 (xenon)

Posted 06 January 2005 - 09:12 AM

uhm.. im sure i could manage this myself.. but since im lazy ill ask

uhm... what exactly are you telling us to do?
i know to add the function to the bottom of the default.xap

but the next 3 codes..?

well after looking a the code some more... i know

but most people here are used to full code replacements.. so ill do the liberty of this:


paste this in no matter what at the bottom of your default.xap
CODE

//
//  HDD Space.
//
function GetXboxHardDiskStats()
{
      var DDPartition;
      var nFreeSpace = 0;
      var nTotalSpace = 0;
      var nArraySize = 7; // Can be 4 or 7.
      var hddInfo = "          XBOX HARD DISK\n";

      DDPartition = new Array(nArraySize);

      DDPartition[1] = "C:";
      DDPartition[2] = "E:";
      DDPartition[3] = "F:";
      DDPartition[4] = "G:";
      DDPartition[5] = "X:";
      DDPartition[6] = "Y:";
      DDPartition[7] = "Z:";

      for (var i = 1; i < nArraySize + 1; i = i + 1)
      {
              nFreeSpace = theHardDrive.GetFreeSpace(DDPartition[i] + "\\");
              nTotalSpace = theHardDrive.GetTotalSpace(DDPartition[i] + "\\");
              if(nTotalSpace != 0){
                      hddInfo = hddInfo + DDPartition[i] + " " + nFreeSpace + "MB of " + nTotalSpace + "MB\r";
              }
      }

      TellUser(theTranslator.Translate(hddInfo),"");
}
//
//  End.
//


if u want to use Y button as hdd info from the root menu, replace this:
CODE

control DEF theMainMenuJoy Joystick
   {
       function OnADown()
       {
           PlaySoundA();
           if(nCurMainMenuItem == 0)
           {
               theMusicMenuIn.Play();
               GoToMusic();
           }
           else if(nCurMainMenuItem == 1)
           {
               theSettingsMenuIn.Play();
               GoToHardDrive();
           }
           else if(nCurMainMenuItem == 2)
           {
           }
           else if(nCurMainMenuItem == 3)
           {
               theSettingsMenuIn.Play();
               GoToSettings();
           }
       }

with this:
CODE

control DEF theMainMenuJoy Joystick
   {
       function OnADown()
       {
           PlaySoundA();
           if(nCurMainMenuItem == 0)
           {
               theMusicMenuIn.Play();
               GoToMusic();
           }
           else if(nCurMainMenuItem == 1)
           {
               theSettingsMenuIn.Play();
               GoToHardDrive();
           }
           else if(nCurMainMenuItem == 2)
           {
           }
           else if(nCurMainMenuItem == 3)
           {
               theSettingsMenuIn.Play();
               GoToSettings();
           }
       }
function OnYDown()
{
    PlaySoundB();
           GetXboxHardDiskStats();
}

basically the reason i was confused is cause MrSin didnt explain those .......s meant to scroll to a spot where u could fit in the snippet ohmy.gif
hopefully this will prevent some confusion

props to mrsin however... great script smile.gif

#4 MrSin

MrSin

    X-S Enthusiast

  • Members
  • 13 posts

Posted 06 January 2005 - 09:39 AM

Sorry about that, mine doesn't look like that (been altered) so thats why I did not include the whole code.

Also as an easier option that would be accessible from all menu, you could do step one (as above) and then do this instead of the other steps:

In default.xip/default.xap, locate:

CODE

function QuickLaunchA()
{

}

function QuickLaunchB()
{

}


Now all you need to do is add the following code to either one:

CODE

PlaySoundB();
GetXboxHardDiskStats();


Like so:

CODE

function QuickLaunchA()
{
     PlaySoundB();
     GetXboxHardDiskStats();
}


This will allow access via Left Trigger + Right Trigger + A or B.

#5 wsly

wsly

    X-S Senior Member

  • XS-BANNED
  • PipPip
  • 158 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 06 January 2005 - 03:35 PM

sweet.... any way to add the IP in there too?

#6 clif

clif

    X-S Member

  • Members
  • Pip
  • 81 posts

Posted 06 January 2005 - 11:40 PM

yes there is i can post a code for it when i get home, if someone hasent already. it is a fairly easy code, but you will have to get rid of the other options so you could have like space for e and f your ip and you mb temp and your cpu temp, anything els that i could throw on there?

#7 wsly

wsly

    X-S Senior Member

  • XS-BANNED
  • PipPip
  • 158 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 07 January 2005 - 01:51 AM

awesome... I think that'll cover it... that just complete's the whole dash for me!!

#8 wsly

wsly

    X-S Senior Member

  • XS-BANNED
  • PipPip
  • 158 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 07 January 2005 - 11:52 AM

still waiting...

#9 Dazza

Dazza

    X-S Young Member

  • Members
  • Pip
  • 30 posts
  • Location:Rugby, England
  • Xbox Version:v1.2

Posted 07 January 2005 - 12:41 PM

Heres the code I used.....

In the default.xip/default.xap file just replace the old GetXboxHardDiskStats function with this code

CODE

function GetXboxHardDiskStats()
{
      var DDPartition;
      var nFreeSpace = 0;
      var nTotalSpace = 0;
      var nArraySize = 4; // Needs to be 4 for everything else to fit
      var xboxInfo = "         XBOX INFORMATION\r";
      var sIPAddress = theXboxNetwork.GetXboxIP();
      var nIntTemp = theConfig.GetInternalTemp();
      var nCPUTemp = theConfig.GetCPUTemp();

      DDPartition = new Array(nArraySize);

      DDPartition[1] = "C:";
      DDPartition[2] = "E:";
      DDPartition[3] = "F:";
      DDPartition[4] = "G:";

      for (var i = 1; i < nArraySize + 1; i = i + 1)
      {
              nFreeSpace = theHardDrive.GetFreeSpace(DDPartition[i] + "\\");
              nTotalSpace = theHardDrive.GetTotalSpace(DDPartition[i] + "\\");
              if(nTotalSpace != 0){
                      xboxInfo = xboxInfo + DDPartition[i] + " " + nFreeSpace + "MB of " + nTotalSpace + "MB\r";
              }
      }
      xboxInfo = xboxInfo + "\r";
      xboxInfo = xboxInfo + "IP: " + sIPAddress + "\r"; // Show IP Address
      xboxInfo = xboxInfo + "Int Temp: " + nIntTemp + " C  CPU Temp: " + nCPUTemp + " C\r"; // Show Temps
      TellUser(theTranslator.Translate(xboxInfo),"");
}



#10 motofo

motofo

    X-S Member

  • Members
  • Pip
  • 86 posts

Posted 07 January 2005 - 02:53 PM

How can I add the IP on the Main menu itself instead of having the information pop up in its own window? Tweakin this dash ROCKS biggrin.gif

#11 wsly

wsly

    X-S Senior Member

  • XS-BANNED
  • PipPip
  • 158 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 07 January 2005 - 06:47 PM

the ip addition doesn't seem to be working

#12 dope_ghost18

dope_ghost18

    X-S Member

  • Members
  • Pip
  • 109 posts

Posted 07 January 2005 - 07:06 PM

worked for me

#13 wsly

wsly

    X-S Senior Member

  • XS-BANNED
  • PipPip
  • 158 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 07 January 2005 - 07:09 PM

my bad... had to reboot a cpl times till it finally showed...

#14 HoBoz

HoBoz

    X-S Young Member

  • Members
  • Pip
  • 40 posts
  • Xbox Version:v1.4
  • 360 version:v1 (xenon)

Posted 08 January 2005 - 04:07 AM

is there a way to show it in fahreheit?

#15 MrSin

MrSin

    X-S Enthusiast

  • Members
  • 13 posts

Posted 08 January 2005 - 05:39 AM

I have not tested this, but their is no reason why it should not work:

After:

CODE

var nIntTemp = theConfig.GetInternalTemp();
var nCPUTemp = theConfig.GetCPUTemp();


add:

CODE

// Convert C to F.
var nIntTempF = nIntTemp * 9/5 + 32;
var nCPUTempF = nCPUTemp * 9/5 + 32;

// If you wanted to convert to Kelvin:
K = C + 273.


You could round it with the Math.round() function also if you like:

CODE

// Convert C to F.
var nIntTempF = Math.round(nIntTemp * 9/5 + 32);
var nCPUTempF = Math.round(nCPUTemp * 9/5 + 32);


Then change this line:

CODE

xboxInfo = xboxInfo + "Int Temp: " + nIntTemp + " C  CPU Temp: " + nCPUTemp + " C\r";


To look like:

CODE

xboxInfo = xboxInfo + "Int Temp: " + nIntTempF + " F  CPU Temp: " + nCPUTempF + " F\r";


That should do it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users