intelisense stuff

This commit is contained in:
MrNewb committed 2025-04-08 19:10:02 -04:00
1 parent e5190cdca0
commit 29d75163a9
13 files changed
+156 -23

No files matched your search

+28 -1
View File
@@ -1,5 +1,11 @@
Ids = Ids or {}
-- for unique ids
---This will generate a unique id.
---@param tbl table
---@param len number
---@param pattern string
---@return string
Ids.CreateUniqueId = function(tbl, len, pattern) -- both optional
tbl = tbl or {} -- table to check uniqueness. Ids to check against must be the key to the tables value
len = len or 8
@@ -21,22 +27,43 @@ Ids.CreateUniqueId = function(tbl, len, pattern) -- both optional
return id
end
---This will generate a unique id.
---@param tbl table
---@param len number
---@return string
Ids.RandomUpper = function(tbl, len)
return Ids.CreateUniqueId(tbl, len, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
end
---This will generate a unique id.
---@param tbl table
---@param len number
---@return string
Ids.RandomLower = function(tbl, len)
return Ids.CreateUniqueId(tbl, len, "abcdefghijklmnopqrstuvwxyz")
end
---This will generate a unique id.
---@param tbl table
---@param len number
---@return string
Ids.RandomString = function(tbl, len)
return Ids.CreateUniqueId(tbl, len, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
end
---This will generate a unique id.
---@param tbl table
---@param len number
---@return string
Ids.RandomNumber = function(tbl, len)
return Ids.CreateUniqueId(tbl, len, "0123456789")
end
---This will generate a unique id.
---@param tbl table
---@param len number
---@return string
Ids.Random = function(tbl, len)
return Ids.CreateUniqueId(tbl, len)
end
+9
View File
@@ -6,18 +6,27 @@ local function printMessage(level, color, message)
print(color .. '[' .. level .. ']:', message)
end
---This will print a colored message to the console with the designated prefix.
---@param message string
Prints.Info = function(message)
printMessage('INFO', '^5', message)
end
---This will print a colored message to the console with the designated prefix.
---@param message string
Prints.Warn = function(message)
printMessage('WARN', '^3', message)
end
---This will print a colored message to the console with the designated prefix.
---@param message string
Prints.Error = function(message)
printMessage('ERROR', '^1', message)
end
---This will print a colored message to the console with the designated prefix.
---@param message string
Prints.Debug = function(message)
printMessage('DEBUG', '^2', message)
end