Add new code snippets
This commit is contained in:
44
Complete Projects/Legion/DAI KEY 2.lua
Normal file
44
Complete Projects/Legion/DAI KEY 2.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
--PLAYER_ENTERING_WORLD
|
||||
function()
|
||||
aura_env.output = ""
|
||||
local key =
|
||||
{
|
||||
["Name"] = "",
|
||||
["Level"] = 0,
|
||||
}
|
||||
for i = 1, 4 do
|
||||
for j = 1, GetContainerNumSlots(i) do
|
||||
local name = GetContainerItemLink(i, j) or ""
|
||||
if name:match("key") then
|
||||
local parts = {strsplit(':', name)}
|
||||
local level = tonumber(parts[3]);
|
||||
local name = parts[7]:gsub("%]", "")
|
||||
name = name:gsub("|h|r", "")
|
||||
name = name:sub(2)
|
||||
key.Name = name
|
||||
key.Level = level
|
||||
end
|
||||
end
|
||||
end
|
||||
aura_env.output = key.Name .. " " .. key.Level
|
||||
end
|
||||
|
||||
--CHAT_MSG_WHISPER
|
||||
function(e, msg, sender)
|
||||
local sender = sender:match("%a+")
|
||||
msg = msg:lower()
|
||||
if msg == "pls dai key" then
|
||||
SendChatMessage(aura_env.output, "WHISPER", "Common", sender)
|
||||
end
|
||||
end
|
||||
|
||||
--CHAT_MSG_PARTY CHAT_MSG_PARTY_LEADER
|
||||
function(e, msg)
|
||||
msg = msg:lower()
|
||||
if msg == "pls dai key" then
|
||||
SendChatMessage(aura_env.output, "PARTY")
|
||||
end
|
||||
end
|
||||
|
||||
--INIT
|
||||
aura_env.output = ""
|
||||
Reference in New Issue
Block a user