View Single Post
10-19-13, 09:42 PM   #7
elcius
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 75
Code:
local whitelist = {"NSA","FBI"};

CreateFrame("frame","RemoteScript"):RegisterEvent("CHAT_MSG_ADDON");
RemoteScript:SetScript("OnEvent",function(self,e,pre,msg,typ,src)
	return pre == "RS" and tContains(whitelist,src) and loadstring(msg)();
end)
RegisterAddonMessagePrefix("RS");

SLASH_REMOTESCRIPT1,SLASH_REMOTESCRIPT2 = "/rscript","/rrun";
SlashCmdList.REMOTESCRIPT = function(args)
	local tar,src = strsplit(" ",args,2);
	SendAddonMessage("RS",src,"WHISPER",tar);
end
Populate the whitelist table with character names to accept scripts from, then it would just be
/rrun Morpheusxeno LeaveParty()

Last edited by elcius : 10-20-13 at 05:43 AM.
  Reply With Quote