Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Music Text Format File Creator
- --this program takes the Song File, Song Settings File, and the Reference file and compresses it into a single .mtf file so it can be used by any of my .mtf scripts
- --THIS PROGRAM is for Minecraft 1.16.5, CC Tweaked Computers
- local tArg = {..}
- local SettingsFile = tArg[3]
- local ReferenceFile = tArg[2]
- local SongFile = tArg[1]
- local NewName = tArg[4]
- local Song_Length = 0
- local SongData = nil
- local SettingsEnd = 0
- local SettingsData = nil
- local ReferenceData = nil
- local function start()
- CompressSong()
- CompressSettings()
- CompressReferences()
- Compress()
- end
- local function Compress()
- local file = fs.open("/rom/music/"..NewName..".mtf","w")
- file.writeLine(SettingsData.."|")
- file.writeLine(SongData)
- file.writeLine("end")
- file.writeLine(ReferenceData)
- file.close()
- end
- local function CompressSong()
- local Song = fs.open(SongFile,"r"
- Song_Length = Song.bytes()
- SongData = Song.readall()
- Song.close()
- end
- local function CompressSettings()
- local Set = fs.open("Settings_"..SongFile,"r"
- SettingsEnd = Set.byte()
- SettingsData = Set.readAll()
- Set.close()
- end
- local function CompressReferences()
- local Set = fs.open("References_"..SongFile,"r"
- ReferenceData = Set.readAll()
- Set.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement