From 4927c6433dc4daaddf85d177e490b3382ba1d0d5 Mon Sep 17 00:00:00 2001 From: min Date: Fri, 13 Feb 2026 01:22:18 -0500 Subject: [PATCH] feat: dims report / limited user --- cfg.lua | 5 +++++ index.lua | 32 +++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/cfg.lua b/cfg.lua index 941096c..cc52b60 100644 --- a/cfg.lua +++ b/cfg.lua @@ -6,5 +6,10 @@ return { subscribeLog = true, admin = true, }, + ["kashmoney447"] = { + subscribeLog = false, + admin = false, + limited = true, + } } } diff --git a/index.lua b/index.lua index 297c908..81b4393 100644 --- a/index.lua +++ b/index.lua @@ -57,6 +57,30 @@ local cmds = { ch.send(unm, mparts, "rpt") end, + dims = function(unm, args) + tk:refresh() + + local ins = table.insert + + local mparts = {} + ins(mparts, { text = "finished generating dimension report!\n" }) + + local n, nplrs = 0, 0 + for _, _ in next, tk.plrs do nplrs = nplrs + 1 end + for i, v in pairs(tk.plrs) do + local line = string.format("user: %s dim=%s", i, q(v.dimension)) + n = n + 1 + if n ~= nplrs then + line = line .. "\n" + end + + ins(mparts, { text = "[" }) + ins(mparts, { text = "s", color = "aqua" }) + ins(mparts, { text = "] " .. line }) + end + + ch.send(unm, mparts, "rpt") + end, unsublog = function(unm, args) if not cfg.users[unm].subscribeLog then ch.send(unm, "you're already aren't subscribed!", "users") @@ -170,11 +194,17 @@ local function processMessage(unm, msg, hidden) local cmd = table.remove(args, 1) - if cfg.users[unm] == nil then + local user = cfg.users[unm] + if user == nil then ch.reportLog("foreign user " .. unm .. " tries: " .. cmd) return end + if user.limited and (cmd ~= "dims" and cmd ~= "faketpa" and cmd ~= "help" and cmd ~= "ping") then + ch.reportLog("limited user " .. unm .. " tries: " .. cmd) + return + end + local handler = cmds[cmd] if handler then ch.reportLog("user " .. unm .. " runs: " .. cmd)