Universal Script 📌
2.0k Views
258 Executions

wUNC 1 2

Universal Script 📌
infinitescripts
infinitescriptsPublished 10
10 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

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
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


Comments

2
Log in to join the conversation. Login
HAPPY_SCRIPTER's profile picture
HAPPY_SCRIPTER10 months ago

what

1
infinitescripts's profile picture
infinitescriptsUploader10 months ago

brah i accidently made the description the script

1

Tags

More universal scripts

See all
Universal Script 📌
16
2
Approved 19 minutes ago
Universal Script 📌
3.9k
185.5k
Bumped 6 hours ago
Script hub
563
48
7 hours ago
Universal Script 📌
28.8k
673.9k
Bumped 9 hours ago
Script hub
14.0k
2.7k
Bumped 11 hours ago
Key System
Paid
Script hub
263.9k
88.5k
Bumped 12 hours ago
Key System
Universal Script 📌
3.1k
10.5k
Bumped 12 hours ago
Universal Script 📌
785
47
Approved 12 hours ago