ScriptBlox is undergoing maintenance, so downtime is possible. Sorry for the inconvenience!
Universal Script 📌
1.6k Views

wUNC 1 2

Universal Script 📌Uploaded by
5 months ago
Please login to perform these actions:

Description

--[[ WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk! ]] local passes, fails, undefined = 0, 0, 0 local running = 0 local function getGlobal(path) local value = getfenv(0) while value ~= nil and path ~= "" do local name, nextValue = string.match(path, "^([^.]+)%.?(.*)$") value = value[name] path = nextValue end return value end local function test(name, aliases, callback) running += 1 task.spawn(function() if not callback then print("⏺️ " .. name) elseif not getGlobal(name) then fails += 1 warn("⛔ " .. name) else local success, message = pcall(callback) if success then passes += 1 print("✅ " .. name .. (message and " • " .. message or "")) else fails += 1 warn("⛔ " .. name .. " failed: " .. message) end end local undefinedAliases = {} for _, alias in ipairs(aliases) do if getGlobal(alias) == nil then table.insert(undefinedAliases, alias) end end if #undefinedAliases > 0 then undefined += 1 warn("⚠️ " .. table.concat(undefinedAliases, ", ")) end running -= 1 end) end -- Header and summary print("\n") print("wUNC Environment Check") print("✅ - Pass, ⛔ - Fail, ⏺️ - No test, ⚠️ - Missing aliases\n") task.defer(function() repeat task.wait() until running == 0 local rate = math.round(passes / (passes + fails) * 100) local outOf = passes .. " out of " .. (passes + fails) print("\n") print("wUNC v1.2 Summary") print("✅ Tested with a " .. rate .. "% success rate (" .. outOf .. ")") print("⛔ " .. fails .. " tests failed") print("⚠️ " .. undefined .. " globals are missing aliases") end) -- Cache test("cache.invalidate", {}, function() local container = Instance.new("Folder") local part = Instance.new("Part", container) cache.invalidate(container:FindFirstChild("Part")) assert(part ~= container:FindFirstChild("Part"), "Reference `part` could not be invalidated") end) test("cache.iscached", {}, function() local part = Instance.new("Part") assert(cache.iscached(part), "Part should be cached") cache.invalidate(part) assert(not cache.iscached(part), "Part should not be cached") end) test("cache.replace", {}, function() local part = Instance.new("Part") local fire = Instance.new("Fire") cache.replace(part, fire) assert(part ~= fire, "Part was not replaced with Fire") end) test("cloneref", {}, function() local part = Instance.new("Part") local clone = cloneref(part) assert(part ~= clone, "Clone should not be equal to original") clone.Name = "Test" assert(part.Name == "Test", "Clone should have updated the original") end) test("compareinstances", {}, function() local part = Instance.new("Part") local clone = cloneref(part) assert(part ~= clone, "Clone should not be equal to original") assert(compareinstances(part, clone), "Clone should be equal to original when using compareinstances()") end) -- Closures local function shallowEqual(t1, t2) if t1 == t2 then return true end local UNIQUE_TYPES = { ["function"] = true, ["table"] = true, ["userdata"] = true, ["thread"] = true, } for k, v in pairs(t1) do if UNIQUE_TYPES[type(v)] then if type(t2[k]) ~= type(v) then return false end elseif t2[k] ~= v then return false end end for k, v in pairs(t2) do if UNIQUE_TYPES[type(v)] then if type(t2[k]) ~= type(v) then return false end elseif t1[k] ~= v then return false end end return true end test("checkcaller", {}, function()

View Raw
Edited By: infinitescripts Download


Comments
2
User profile picture
infinitescripts 5 months ago
brah i accidently made the description the script
User profile picture
HAPPY_SCRIPTER 5 months ago
what
Please Login to add a comment.