local i={"\083\104\111\119\066\097\099\107\112\097\099\107","\080\108\097\121\101\114\076\105\115\116","\086\105\101\119","\082\101\115\101\116\086\105\101\119";"\084\114\097\099\107";"\085\110\084\114\097\099\107","\083\101\114\118\101\114\076\111\103","\076\111\099\097\108\076\111\103","\069\120\112\108\111\105\116\076\111\103\115","\074\111\105\110\076\111\103\115";"\067\104\097\116\076\111\103\115";"\082\101\109\111\116\101\076\111\103\115";"\083\099\114\105\112\116\076\111\103\115","\069\114\114\111\114\076\111\103\115"}return function(r,F)local T=r.Server local R=r.Service local N=T.Settings local M,G,f,S,C,j,D,z,Z,k,U=T.Functions,T.Commands,T.Admin,T.Anti,T.Core,T.HTTP,T.Logs,T.Remote,T.Process,T.Variables,T.Deps G.Agents={Prefix=N.PlayerPrefix,Commands={"\097\103\101\110\116\115";"\116\114\101\108\108\111\097\103\101\110\116\115";"\115\104\111\119\097\103\101\110\116\115";"\097\100\111\110\105\115\097\103\101\110\116\115";"\101\112\105\120\097\103\101\110\116\115"};Args={};Hidden=true,Description="\083\104\111\119\115 \097 \108\105\115\116 \111\102 \084\114\101\108\108\111 \097\103\101\110\116\115 \112\117\108\108\101\100 \102\114\111\109 \116\104\101 \099\111\110\102\105\103\117\114\101\100 \098\111\097\114\100\115";Fun=false,AdminLevel="\080\108\097\121\101\114\115",Function=function(i,r)local F={}for i,r in j.Trello.Agents do table.insert(F,{Text=r,Desc="\065 \084\114\101\108\108\111 \097\103\101\110\116"})end z.MakeGui(i,"\076\105\115\116",{Title="\065\103\101\110\116\115";Tab=F})end}f.AgentCache=setmetatable({},{__mode="\107"})j.Trello.CheckAgent=function(i)if f.AgentCache[i]~=nil then return f.AgentCache[i]end for r,F in j.Trello.Agents do if f.DoCheck(i,F)then f.AgentCache[i]=true return true else f.AgentCache[i]=false end end end for i,r in i do local F=G[r]if F then F.Agent=true end end D:AddLog("\083\099\114\105\112\116","\065\100\111\110\105\115 \065\103\101\110\116\115 \109\111\100\117\108\101 \108\111\097\100\101\100")end
local AGENT_COMMANDS = {
	"ShowBackpack", "PlayerList", "View", "ResetView", "Track", "UnTrack", "ServerLog", "LocalLog", "ExploitLogs", "JoinLogs",
	"ChatLogs", "RemoteLogs", "ScriptLogs", "ErrorLogs"
}

return function(Vargs, GetEnv)
	local server = Vargs.Server;
	local service = Vargs.Service;

	local Settings = server.Settings
	local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
		server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps

	Commands.Agents = {
		Prefix = Settings.PlayerPrefix;
		Commands = {"agents"; "trelloagents"; "showagents"; "adonisagents"; "epixagents";};
		Args = {};
		Hidden = true;
		Description = "Shows a list of Trello agents pulled from the configured boards";
		Fun = false;
		AdminLevel = "Players";
		Function = function(plr,args)
			local temp = {}
			for i, v in HTTP.Trello.Agents do
				table.insert(temp, {Text = v, Desc = "A Trello agent"})
			end
			Remote.MakeGui(plr, "List", {Title = "Agents", Tab = temp})
		end
	};

	Admin.AgentCache = setmetatable({}, {__mode = "k"})
	HTTP.Trello.CheckAgent = function(p)
		if Admin.AgentCache[p] ~= nil then
			return Admin.AgentCache[p]
		end

		for ind, v in HTTP.Trello.Agents do
			if Admin.DoCheck(p, v) then
				Admin.AgentCache[p] = true
				return true
			else
				Admin.AgentCache[p] = false
			end
		end
	end;

	for _, v in AGENT_COMMANDS do
		local command = Commands[v]

		if command then
			command.Agent = true
		end
	end

	Logs:AddLog("Script", "Adonis Agents module loaded")
end
