Universal Script 📌
2.8k Views
37 Executions

Small UNC and Executor Test

Universal Script 📌
SubnauticaLaser
SubnauticaLaserPublished 10
2 years 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

Tests your executor for a few checks

Updates

  1. Script edited: Create script

View Raw
local passes, fails, undefined = 0, 0, 0
local running = 1



local uncTestV2 = {}



uncTestV2.getGlobal = function(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



uncTestV2.startV1 = function(name, aliases, callback)
	running += 1

	task.spawn(function()
		if not callback then
			print("⏺️ " .. name)
		elseif not uncTestV2.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


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!