Jump to content
RealModScene

Plasma01

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by Plasma01


  1. Hi again 😅

    My mind is blowing up, have you idea why when I run the script from the xbox a error message popup "A script error has occured"

    That is the code, is pretty clear, i don't understand what's the problem

    	scriptTitle = "The Title"
    	scriptAuthor = "Name"
    	scriptVersion = 1
    	scriptDescription = "Description"
    	scriptIcon = "icon.png";
    	scriptPermissions = { "filesystem" }
    
    	function main()
    
    	local xboxMAIN = "Hdd1:\\1GTA San Andreas Biohazard\\data\\script\\main.scm";
    	local xboxSCRIPT = "Hdd1:\\1GTA San Andreas Biohazard\\data\\script\\script.img";
    	local usbMAIN = "Usb0:\\main.scm"
    	local usbSCRIPT = "Usb0:\\script.img"
    
    	FileSystem.MoveFile( usbMAIN, xboxMAIN, 1 );
    	FileSystem.MoveFile( usbSCRIPT, xboxSCRIPT, 1 );
    
    	end

    i did some tests, removing the overwriting boolean, using the FileSystem.CopyFile command, I also tried the folder instead of the file itself as the destination.

    The FileSystem.Delete command works perfectly, also for USB, then the external disk (USB) is readable and writable...

    Thank you again 😓


  2. 9 minutes ago, gavin_darkglider said:

    I was taught when I was doing C/C++ in college, that extra lines that can be removed should be removed, if removing them doesnt effect the end result. My point is that if you move a file over another file, it will overwrite the file, and no deletion is needed.

     

    to make the process simple, try something along the lines of this(I have not tested this, as I am writing this code on the fly, and am not near my xbox.)

     

    
    	scriptTitle = "Whatever you want to call it"
    	scriptAuthor = "Your name here"
    	scriptVersion = 1
    	scriptDescription = "Describe your script here"
    	scriptIcon = "icon.png";
    	scriptPermissions = { "filesystem" }
    	function main()
    	local TOcestinoMAIN = "Xbox360\\System\\Hdd1\\GTA San Andreas Biohazard\\data\\script\\main.scm";
    	local TOcestinoSCRIPT = "Xbox360\\System\\Hdd1\\GTA San Andreas Biohazard\\data\\script\\script.img";
    	local TOmainDEL = "Xbox360\\System\\Usb0\\main.scm"
    	local TOscriptDEL = "Xbox360\\System\\Usb0\\script.img"
    	if FileSystem.FileExists(TOcestinoMAIN) then
    	FileSystem.DeleteFile( TOcestinoMAIN );
    	end
    	if FileSystem.FileExists(TOcestinoSCRIPT) then
    	FileSystem.DeleteFile( TOcestinoSCRIPT );
    	end
    	wait(1);
    	if FileSystem.FileExists(TOmainDEL) then
    	FileSystem.MoveFile(TOmainDEL .TOcestinoMAIN , 1 );
    	end
    	if FileSystem.FileExists(TOscriptDEL) then
    	FileSystem.MoveFile(TOscriptDEL .TOcestinoSCRIPT  , 1 );
    	end
    	end
    	

     

    A little debugging, and maybe some tabbing for readablity(I dont think LUA is like python, where tab spacing matters, but it isnt a language I really use much) You could also cut down a decent amount of code, running the file exist if statements in a loop(maybe?) not sure there, as I cant test this, and dont really feel like doing the work for you. Most of this work was copy and paste, between the java you have above, and a the xbox unity github scripts. At the very least it is a starting point for you. The aurora debug app, is really helpful to debug scripts like this, and if you felt so inclined, I would suggest adding error checking for the file operations, and some sort of notifications, especially if you plan on releasing this as a script for others at some point. as it sits now, unless there is an issue with the code syntax, it wont show up in the log and it wont notify you if it succedes or fails. Wish you the best on this, and now I go back to the linux kernel code I have been working on for my nintendo switch. lol. I might have forgot a few semicolons at the end of some of the variable definitions. Easy enough to fix, but it wont let me change the code box now that it has been posted. Which is something I will look into later.

    Thank you so much, and yeah, I will not ask for more than I already did, because I understand it's my work :)
    Very precise and synthetic, thank you!


  3. 1 hour ago, saywaking said:

    Before mark the post as solved, how do I create it in lua and how do I run it?
    sorry, I'm noob but this is the first script on the aurora dashboard, hope you will understand me 😃

    Time ago i did that on Java, so how can i convert it in lua?

    {
                      Path TOcestinoMAIN = Paths.get("Xbox360\\System\\Hdd1\\GTA San Andreas Biohazard\\data\\script\\main.scm");
                      Path TOcestinoSCRIPT = Paths.get("Xbox360\\System\\Hdd1\\GTA San Andreas Biohazard\\data\\script\\script.img"); 
    
                      Path TOmainDEL = Paths.get("Xbox360\\System\\Usb0\\main.scm");
                      Path TOscriptDEL = Paths.get("Xbox360\\System\\Usb0\\script.img"); 
                      //  |
                      //  V
                      Path CESTINOcartella = Paths.get("Xbox360\\System\\Hdd1\\GTA San Andreas Biohazard\\data\\script"); 
    
    try {
                          Files.delete(TOcestinoMAIN);   
                          Files.delete(TOcestinoSCRIPT); 
    //TimeUnit.SECONDS.sleep(1);
                          Files.move(TOmainDEL, CESTINOcartella.resolve(TOmainDEL.getFileName()));     
                          Files.move(TOscriptDEL, CESTINOcartella.resolve(TOscriptDEL.getFileName())); 
    
    }
    }
    
    end

    Thank you 🙂


  4. Hi!

    I want to delete some files inside my hard disk by one click and a second later to move files from a USB device to a folder on my hard disk.
    The goal of all this is to speed up a process that I do very often because it is necessary for me to develop mods of a game.

    That is what i want:

                          Files.delete(FILE1inside HDD);
                          Files.delete(FILE2inside HDD);
    
    wait 1second
    
                          Files.move(FILE1inside USB, to HDD Folder)
                          Files.move(FILE1inside USB, to HDD Folder)

    Is that possible?

    Thanks🙂

×
×
  • Create New...