Skip to content

Some notes on script extraction #4

@miltoncandelero

Description

@miltoncandelero

This project seems abandoned, but some notes in case a future traveler lands here trying to get a nice unpacking script for lune

  • Asking to not extract lua extracts the scripts into roblox model files... Not really what I expected 😅
    • The best way to actually not extract the lua files, is to keep the flag in true but stub the writeFile function
  • Empty folders are often confused with code folders, I "fixed" the isCodeTree function, it's slower than it was before (and is now recursive) but it understands better empty folders:
local function isCodeTree(instance: roblox.Instance)
	local toCheck = instance:GetDescendants()
	if #toCheck == 0 then
		return false
	end
	table.insert(toCheck, instance)
	for _, descendant in ipairs(toCheck) do
		-- If this descendant is not a lua script...
		if not isLuaSourceContainer(descendant.ClassName) then
			-- If it's a folder, recurse (unless for some reason we are our own grandfather)
			if descendant.ClassName == "Folder" then
				-- If our child is not a code tree, we are not a code tree :(
				if descendant ~= instance and not isCodeTree(descendant) then
					return false
				end
			else
				return false
			end
		end
	end
	return true
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions