Help - Search - Members - Calendar
Full Version: Hard Drive, Free And Used Space Display
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official Team UIX Forums > User.Interface.X (UIX) Code
MrSin
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!
MrSin
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.
iLLNESS
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
MrSin
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.
wsly
sweet.... any way to add the IP in there too?
clif
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?
wsly
awesome... I think that'll cover it... that just complete's the whole dash for me!!
wsly
still waiting...
Dazza
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),"");
}

motofo
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
wsly
the ip addition doesn't seem to be working
dope_ghost18
worked for me
wsly
my bad... had to reboot a cpl times till it finally showed...
HoBoz
is there a way to show it in fahreheit?
MrSin
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.
HoBoz
Thanks it works, but I had to modify it a little to get it to fit.

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();
// Convert C to F.
var nIntTempF = Math.round(nIntTemp * 9/5 + 32);
var nCPUTempF = Math.round(nCPUTemp * 9/5 + 32);

     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 + "MB: " + nIntTempF + " F  CPU: " + nCPUTempF + " F\r"; // Show Temps
     TellUser(theTranslator.Translate(xboxInfo),"");
}
TMG8
nice job MrSin and Dazza, i took the code it worked great, i didnt really think i needed the ip showing since there is the network settings tab so i went and added bios version and dash version instead, here is the code to do as so.....

CODE
//
//  HDD Space.
//
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 nIntTemp = theConfig.GetInternalTemp();
     var nCPUTemp = theConfig.GetCPUTemp();
     var nROMVersion = theConfig.GetROMVersion();
     var nXdashVersion = theConfig.GetXdashVersion();

     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 + "\nK: " + nROMVersion + "\rD: " + nXdashVersion + "\r";   //Show Dash  & Bios Version
     xboxInfo = xboxInfo + "Int Temp: " + nIntTemp + "C  CPU Temp: " + nCPUTemp + " C\r"; // Show Temps
     TellUser(theTranslator.Translate(xboxInfo),"");
}
//
//  End.
//


this is really my first time ever posting any code so i hope it works... and first time ever making something work nicely in a dash too! have fun with it
TMG8
hmm well i wasnt able to edit my post but i wanted to update....
The ip address is shown as well as bios version and dash. with this little menu you are able to most likely add one more display but for now heres the code
CODE
//
//  HDD Space.
//
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 nIntTemp = theConfig.GetInternalTemp();
     var nCPUTemp = theConfig.GetCPUTemp();
     var nROMVersion = theConfig.GetROMVersion();
     var nXdashVersion = theConfig.GetXdashVersion();
     var sIPAddress = theXboxNetwork.GetXboxIP();

     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 + "\nK: " + nROMVersion + "\rD: " + nXdashVersion + " IP: " + sIPAddress + "\r";     //Show Dash  & Bios Version
     xboxInfo = xboxInfo + "MB Temp: " + nIntTemp + "C  CPU Temp: " + nCPUTemp + " C\r"; // Show Temps
     TellUser(theTranslator.Translate(xboxInfo),"");
}
//
//  End.
//  


its pretty simple maybe i should have payed attention in class, but i think im remembering things now... tongue.gif well anyways i hope this info is helpful.
CrakkedOut
beerchug.gif
CompFreak07
I decided I was going to add fan speed in my display. I also converted C* to F*. Here it is :
CODE

//
// HDD Space.
//
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 nIntTemp = theConfig.GetInternalTemp();
var nCPUTemp = theConfig.GetCPUTemp();
var nIntTempF = Math.round(nIntTemp * 9/5 + 32);
var nCPUTempF = Math.round(nCPUTemp * 9/5 + 32);
var nROMVersion = theConfig.GetROMVersion();
var nXdashVersion = theConfig.GetXdashVersion();
var sIPAddress = theXboxNetwork.GetXboxIP();
var nFanSpeed = theConfig.GetFanSpeed() * 2;

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 + "\Fan Speed: " + nFanSpeed + " %\r";
xboxInfo = xboxInfo + "\nK: " + nROMVersion + "\rD: " + nXdashVersion + " IP: " + sIPAddress + "\r"; //Show Dash & Bios Version
xboxInfo = xboxInfo + "MB Temp: " + nIntTempF + " F CPU Temp: " + nCPUTempF + " F\r";
TellUser(theTranslator.Translate(xboxInfo),"");
}
//
// End.
//
rhythmeister
Are these specifically for the original or comm build? Keeps on freakin out my box, won't boot UIX after putting in the HDD info code uhh.gif Any help would be greatly appreciated as I'm not exactly up on coding-I did intro HTML module a few yrs back and that's the height of it!
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.